Friday, April 29, 2005

Gentoo: Troubleshooting 1

So, I've got a system that isn't booting yet. The boot error is:

* Mounting proc at /proc [ ok ]
* Mounting sysfs at /sys [ !! ]
can't create lock file /etc/mtab~944: Read-only file system (use -n flag to override)


First, I have to go back to the boot CD and get up and running:

livecd root # passwd
livecd root # /etc/init.d/sshd start
livecd root # ifconfig
(at this point, I switch over to using SecureCRT on the other system)
livecd root # modprobe md
livecd root # modprobe raid1
livecd root # for i in 0 1 2 3; do mknod /dev/md$i b 9 $i; done
livecd root # mdadm --assemble /dev/md0 /dev/hda1 /dev/hdc1
livecd root # mdadm --assemble /dev/md1 /dev/hda2 /dev/hdc2
livecd root # mdadm --assemble /dev/md2 /dev/hda3 /dev/hdc3
livecd root # mdadm --assemble /dev/md3 /dev/hda4 /dev/hdc4


That gets the raid arrays up and running.

livecd root # swapon /dev/md2
livecd root # mount /dev/md1 /mnt/gentoo
livecd root # mount /dev/md0 /mnt/gentoo/boot
livecd root # modprobe dm-mod
livecd root # mkdir /etc/lvm
livecd root # echo 'devices { filter=["r/cdrom/"] }' >/etc/lvm/lvm.conf
livecd / # lvscan
livecd / # lvchange -ay vgmirror


Which gets the LVM2 up and running (and the logical volumes set to active).

# mount /dev/vgmirror/opt /mnt/gentoo/opt
# mount /dev/vgmirror/usr /mnt/gentoo/usr
# mount /dev/vgmirror/var /mnt/gentoo/var
# mount /dev/vgmirror/home /mnt/gentoo/home
# mount /dev/vgmirror/tmp /mnt/gentoo/tmp
# chmod 1777 /mnt/gentoo/tmp
# mount /dev/vgmirror/vartmp /mnt/gentoo/var/tmp
# chmod 1777 /mnt/gentoo/var/tmp
# mount -t proc none /mnt/gentoo/proc


Should be ready to chroot into the hard disk.

# chroot /mnt/gentoo /bin/bash ; env-update

Gonna redo my kernel configuration (see Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 4)) because I suspect that something needed to be loaded in differently.

# cd /usr/src/linux
# make menuconfig


Going to switch the LVM2 from loading as a "module" and change it to being "built-in". Could be an error on the Gentoo LVM2 page according to a note I see in the gentoo wiki.

# make && make modules_install
# cp arch/i386/boot/bzImage /boot/kernel-2.6.11-gentoo-Apr20
# cp System.map /boot/System.map-2.6.11-gentoo-Apr20
# cp .config /boot/config-2.6.11-gentoo-Apr20
# nano -w /etc/modules.autoload.d/kernel-2.6
(remove dm-mod from being auto-loaded)
livecd linux # exit
livecd / # cd /
livecd / # cat /proc/mounts

(unmount all of your mounted partitions, including the LVM mounts)

livecd / # umount ... (insert list of mounted file systems)

livecd / # vgchange -an vgmirror
livecd / # reboot

(remove the gentoo boot CD)


Now to see if it works. No luck. Redoing the above, but going to re-do my LVM2, but changing to be 'static' per the wiki.

# echo 'sys-fs/lvm2 static' >> /etc/portage/package.use
# emerge lvm2


No joy here either. Time to go do some more searching.

Attempt #3 (#4?), editing the grub.conf file and adding "udev" to the end of the "kernel" line. Nothing complex, just tack " udev" onto the end of the kernel line using nano.

No joy again.

Attempt #4 - added an initrd line to the grub.conf file. Doubtful that this will fix the issue.

Nope.

Attempt #5 - using this thread over at the gentoo forums, I added some more information to my kernel line in the grub.conf file.

Nope.

Sunday, April 24, 2005

Gentoo: Can't create lock file

Well, first glitch. Looking at my boot screen with [Shift-PgUp] / [Shift-PgDn] to find the error. I see that the Software RAID is working fine (it built md0..md3 automatically).

* Mounting proc at /proc [ ok ]
* Mounting sysfs at /sys [ !! ]
can't create lock file /etc/mtab~944: Read-only file system (use -n flag to override)
* Mounting ramfs at /dev... [ ok ]
* Configuring system to use udev... [ ok ]
* Populating /dev with device nodes...
* Using /sbin/hotplug for udev management...
* Mounting devpts at /dev/pts... [ ok ]
* Activating (possible) swap... [ ok ]
* Remounting root filesystem read-only (if necessary)... [ ok ]
* Checking root filesystem...
ext2fs_check_if_mount: No such file or directory while determining whether /dev/md2 is mounted.
fsck.ext3: No such file or directory while trying to open /dev/md2
/dev/md2: The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck -b 8193 <device>
* Filesystem couldn't be fixed :( [ !! ]

Give root password for maintenance
(or type Control-D for normal startup):


So, according to a quick google, this indicates an issue with /etc/fstab.

I'll be digging into this in a few days when I get a chance. (See Troubleshooting 1.)

Wednesday, April 20, 2005

Gentoo Upgrading your Profile

At some point, I need to upgrade my Gentoo profile from 2004.3 to 2005.0. Here's the error message that you see on screen when you need to do this.

livecd linux # emerge (something)

!!! Your current profile is deprecated and not supported anymore.
!!! Please upgrade to the following profile if possible:
default-linux/x86/2005.0

To upgrade do the following steps:
# emerge -n '>=sys-apps/portage-2.0.51'
# cd /etc/
# rm make.profile
# ln -s ../usr/portage/profiles/default-linux/x86/2005.0 make.profile

# Gentoo has switched to 2.6 as the defaults for headers/kernels. If you wish
# to use 2.4 headers/kernels, then you should do the following to upgrade:
# emerge -n '>=sys-apps/portage-2.0.51'
# cd /etc/
# rm make.profile
# ln -s ../usr/portage/profiles/default-linux/x86/2005.0/2.4 make.profile

# More information can be found at the following URLs:
# http://www.gentoo.org/doc/en/gentoo-upgrading.xml
# http://www.gentoo.org/doc/en/migration-to-2.6.xml

Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 5)

Note: These directions are works-in-progress... in fact, they might not even work at all until I find out why I'm ending up with non-bootable systems (looks like a bug in the 2.6 kernel).

(previous step)

Time to install the bootloader. I plan on using GRUB:

# emerge grub

Now to configure GRUB (refer to my old post about GRUB for a more in-depth explanation of what I'm telling GRUB to do here).

# grub --no-floppy
grub> find /grub/stage1
(hd0,0)
(hd1,0)
grub> root (hd0,0)
grub> setup (hd0)
grub> device (hd0) /dev/hdc
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
#


Now, edit your config file for grub:

# nano -w /boot/grub/grub.conf

Here is what mine looks like. Yours may be different, depending on how you configured things (and remember that I'm using Software RAID).

# cat /boot/grub/grub.conf
default 0
timeout 30
title=Gentoo Linux 2.6.11 (April 20 2005)
root (hd0,0)
kernel /kernel-2.6.11-gentoo-Apr20 root=/dev/md2
#


Now I install various system tools (see the handbook):

# emerge syslog-ng
# rc-update add syslog-ng default
# emerge dcron
# rc-update add dcron default
# crontab /etc/crontab


Note: Now you need to unmount everything that you can (including LVM), possibly shutdown the RAID as well prior to reboot.

livecd gentoo # exit
livecd / # cd /
livecd / # cat /proc/mounts

(unmount all of your mounted partitions, including the LVM mounts)

livecd / # umount ... (insert list of mounted file systems)

livecd / # vgchange -an vgmirror
livecd / # reboot


Pull the CD-ROM at this point, otherwise the LiveCD will probably boot.

(next step)

Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 4)

Note: These directions are works-in-progress... in fact, they might not even work at all until I find out why I'm ending up with non-bootable systems (looks like a bug in the 2.6 kernel).

(previous step)

Time to configure the kernel.

# emerge lvm2
# emerge mdadm
# cd /usr/src/linux
# make menuconfig


Linux Kernel v2.6.11 Configuration
(C)ode maturity level options
(G)eneral setup
--> (C)onfigure standard kernel features for small systems (turn ON)
--> --> (O)ptimize for size (turn ON)
(L)oadable module support
(P)rocessor type and features
--> (P)rocessor family (changed to "Pentium-III...")
--> (S)ymetric multi-processing support (turned this one OFF)
--> M(a)chine Check Exception (turned this OFF)
(P)ower management options (ACPI, APM)
(B)us options (PCI, PCMCIA, EISA< MCA, ISA)
(E)xecutable file formats
(D)evice drivers
--> (P)arallel port support (turned OFF)
--> (A)TA/ATAPI/MFM/RLL support (turned ON the PDC20262 chipset support as BUILT-IN)
--> M(u)lti-device support (turn it ON)
--> --> (R)AID support (turn it ON as BUILT-IN)
--> --> --> (R)AID-1 mirroring mode (turn it ON as BUILT-IN)
--> --> (D)evice mapper support (set to MODULE, per section 13 of LVM2 guide)
--> (C)haracter Devices
--> --> (I)ntel/AMD/VIA HW Random Number Generator (turn ON as BUILT-IN)
--> (S)ound
--> --> (S)ound card support (turn OFF)
(F)ile systems
(P)rofiling support
(K)ernel hacking
(S)ecurity options
(C)ryptographic options
(L)ibrary routines

Exit and save your configuration. Then build the kernel (the following is for 2.6 kernels). Expect the compile to take about an hour.

# make && make modules_install

Now you need to install your kernel into the boot partition. Change the "2.6.6-gentoo" portion of the filenames to whatever you want.

# cp arch/i386/boot/bzImage /boot/kernel-2.6.11-gentoo-Apr20
# cp System.map /boot/System.map-2.6.11-gentoo-Apr20
# cp .config /boot/config-2.6.11-gentoo-Apr20


Now we need to configure LVM to auto-load.

# nano -w /etc/modules.autoload.d/kernel-2.6

Here is what my autoload file looks like:

# /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/modules.autoload.d/kernel-2.6,v 1.1 2003/07/16 18:13:45 azarah Exp $
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you'd like to load when the system
# starts into this file, one per line. Comments begin with # and
# are ignored. Read man modules.autoload for additional details.

# For example:
# 3c59x

dm-mod


Now, edit the /etc/fstab file:

# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs> <mountpoint> <type> <opts> <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/md0 /boot ext2 noauto,noatime 1 2
/dev/md1 / ext3 noatime 0 1
/dev/md2 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,ro,user 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0

/dev/vgmirror/opt /opt ext3 noatime 0 3
/dev/vgmirror/usr /usr ext3 noatime 0 3
/dev/vgmirror/var /var ext3 noatime 0 3
/dev/vgmirror/home /home ext3 noatime 0 3
/dev/vgmirror/tmp /tmp ext2 noatime 0 3
/dev/vgmirror/vartmp /var/tmp ext2 noatime 0 3

# NOTE: The next line is critical for boot!
none /proc proc defaults 0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none /dev/shm tmpfs defaults 0 0


Now, some misc stuff:

# echo yourhostname > /etc/hostname
# echo yourdnsname > /etc/dnsdomainname
# rc-update add domainname default
# nano -w /etc/conf.d/net
(either use iface_eth0="dhcp" or configure your IP and gateway)
# rc-update add net.eth0 default
# cat /etc/resolv.conf
(verify your DNS servers if you specified a static IP)
# nano -w /etc/rc.conf
(change CLOCK="UTC" to CLOCK="local")
# passwod
(set your root password to something you will remember)

# useradd -m -G users,wheel,audio -s /bin/bash john
# passwd john

(add a user called 'john' and set a password)


(next step)

Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 3)

Note: These directions are works-in-progress... in fact, they might not even work at all until I find out why I'm ending up with non-bootable systems (looks like a bug in the 2.6 kernel).

(previous step)

Time to configure the timezone and setup the kernel, this is chapter 7 in the Gentoo handbook.

Timezone for me is EST5EDT, so here's how to set that up.

# ls /usr/share/zoneinfo
# ln -sf /usr/share/zoneinfo/EST5EDT /etc/localtime
# date
# zdump GMT
# zdump EST5EDT


Last year, I went with development-sources for the kernel in order to get 2.6. This is no longer necessary (and development-sources has been rolled into vanilla-sources). So I'm going to go with the default gentoo-sources.

# emerge gentoo-sources
# ls -l /usr/src


This takes a while to run (maybe an hour or two).

(next step)

Tuesday, April 19, 2005

Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 2)

(Continuation of part 1)

# ls -l /etc/make.profile

As far as I can tell the 2004.3 already uses the 2.6 kernel, so there's nothing to do here. I also configured my USE flags in my last post, so that's already done as well.

# cd /usr/portage
# scripts/bootstrap.sh


This will take a while to run (I estimate a few hours, maybe even overnight). Once that finishes, you move from stage2 to stage3.

# emerge --emptytree system

Which will also take a few hours.

(next step)

Gentoo 2004.3 on Gigabyte GA-6VA7+ (part 1)

Note: These directions are works-in-progress... in fact, they might not even work at all until I find out why I'm ending up with non-bootable systems (looks like a bug in the 2.6 kernel).

This is a continuation of Gentoo and Software RAID (2004.3), where I configured the disks and setup the RAID array. I'm now picking up at the point where the RAID array has been configured and we're ready to start installing file systems.

/dev/md0 - 128MB boot
/dev/md1 - 2GB root partition
/dev/md2 - 2GB swap
/dev/md3 - rest of disk (user files)

Now, some folks say copy the /etc/mdadm.conf file, but in the same breath, they indicate that mdadm does not require the use of a config file at all. Since I'm documenting my configuration here, and my array is extremely straightforward, I'm going to skip creating the mdadm.conf file and see how it goes.

Links:
Software RAID (Gentoo Tips-n-Tricks)
LinuxDevCenter article on mdadm

The LinuxDevCenter article actually explains how to create the mdadm.conf file yourself (semi-automatically). Notice the use of wild cards that lets me compactly express that I want all 4 partitions on /dev/hda and /dev/hdc to be used in arrays. You will need to edit the results to match the syntax of the mdadm.conf file.

# echo 'DEVICES /dev/hda*' >> /etc/mdadm.conf
# echo 'DEVICES /dev/hdc*' >> /etc/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm.conf
# nano -w /etc/mdadm.conf


Contents of my mdadm.conf file:

EVICES /dev/hda*
DEVICES /dev/hdc*
ARRAY /dev/md3 level=raid1 num-devices=2 devices=/dev/hda4,/dev/hdc4
ARRAY /dev/md2 level=raid1 num-devices=2 devices=/dev/hda3,/dev/hdc3
ARRAY /dev/md1 level=raid1 num-devices=2 devices=/dev/hda2,/dev/hdc2
ARRAY /dev/md0 level=raid1 num-devices=2 devices=/dev/hda1,/dev/hdc1


Picking up again with Chapter 4 of the installation handbook. This is also very similar to what I did back in June 2004 with Software RAID and LVM2.

# mke2fs /dev/md0
# mke2fs -j /dev/md1
# mkswap /dev/md2
# swapon /dev/md2
# mount /dev/md1 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/md0 /mnt/gentoo/boot


Now, we initialize the 4th raid partition for LVM2 operations. See Gentoo LVM2 Documentation for more details about this.

# modprobe dm-mod
# pvcreate /dev/md3
# echo 'devices { filter=["r/cdrom/"] }' >/etc/lvm/lvm.conf
# vgcreate vgmirror /dev/md3
# vgscan


Here is my plan for logical volumes inside the vgmirror partition (this uses up 22GB):

4GB /tmp (ext2)
4GB /var/tmp (ext2)
2GB /opt (ext3)
4GB /usr (ext3)
4GB /var (ext3)
4GB /home (ext3)

Create the logical volumes. If you see the error message "/etc/lvm/backup: fsync failed: Invalid argument", you can ignore this warning (according to Gentoo's LVM2 page).

# lvcreate -L4G -ntmp vgmirror
# lvcreate -L4G -nvartmp vgmirror
# lvcreate -L2G -nopt vgmirror
# lvcreate -L4G -nusr vgmirror
# lvcreate -L4G -nvar vgmirror
# lvcreate -L4G -nhome vgmirror
# ls -l /dev/vgmirror
# lvscan


Output of the lvscan command:

ACTIVE '/dev/vgmirror/tmp' [4.00 GB] next free (default)
ACTIVE '/dev/vgmirror/vartmp' [4.00 GB] next free (default)
ACTIVE '/dev/vgmirror/opt' [2.00 GB] next free (default)
ACTIVE '/dev/vgmirror/usr' [4.00 GB] next free (default)
ACTIVE '/dev/vgmirror/var' [4.00 GB] next free (default)
ACTIVE '/dev/vgmirror/home' [4.00 GB] next free (default)


Format the logical volumes:

# mke2fs /dev/vgmirror/tmp
# mke2fs /dev/vgmirror/vartmp
# mke2fs -j /dev/vgmirror/opt
# mke2fs -j /dev/vgmirror/usr
# mke2fs -j /dev/vgmirror/var
# mke2fs -j /dev/vgmirror/home


Make the directories to hold your mounted volumes. Mount your volumes.

# mkdir /mnt/gentoo/opt
# mkdir /mnt/gentoo/usr
# mkdir /mnt/gentoo/var
# mkdir /mnt/gentoo/home
# mount /dev/vgmirror/opt /mnt/gentoo/opt
# mount /dev/vgmirror/usr /mnt/gentoo/usr
# mount /dev/vgmirror/var /mnt/gentoo/var
# mount /dev/vgmirror/home /mnt/gentoo/home


Make the special directories to hold your temp file volumes (these require special permissions). Then mount your temp file volumes. Also mount your proc folder.

# mkdir /mnt/gentoo/tmp
# mount /dev/vgmirror/tmp /mnt/gentoo/tmp
# chmod 1777 /mnt/gentoo/tmp
# mkdir /mnt/gentoo/var/tmp
# mount /dev/vgmirror/vartmp /mnt/gentoo/var/tmp
# chmod 1777 /mnt/gentoo/var/tmp
# mkdir /mnt/gentoo/proc
# mount -t proc none /mnt/gentoo/proc


Now we move into Installation (chapter 5) in the handbook. Verify your system date and then start extracting the tarballs.

# date
# ls -l /mnt/cdrom/stages
# cd /mnt/gentoo
# tar -xvjpf /mnt/cdrom/stages/stage1-x86-2004.3.tar.bz2
# ls -l /mnt/cdrom/snapshots
# cd /mnt/gentoo
# tar -xvjf /mnt/cdrom/snapshots/portage-20041022.tar.bz2 -C /mnt/gentoo/usr
# cd /mnt/gentoo
# mkdir /mnt/gentoo/usr/portage/distfiles
# cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/


Before I configure the make.conf file, I should take a look at my system configuration.

# cat /proc/version
Linux version 2.6.9-gentoo-r1 (root@inertia) (gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)) #1 SMP Thu Nov 25 03:43:53 UTC 2004
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 8
model name : Celeron (Coppermine)
stepping : 6
cpu MHz : 568.097
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 1114.11


Now we're ready to edit the make.conf file and change flags:

# nano -w /mnt/gentoo/etc/make.conf

Here is my personal make.conf (use at your own risk). This is for a Celeron Coppermine CPU (Pentium III). I prefer to compile for size given the small amount of installed RAM on this system.

CFLAGS="-Os -march=pentium3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="apache2 kerberos ldap -apm -gif -gnome -gtk -jpeg -kde -mad -mikmod -mpeg -oggvorbis -opengl -oss -pdflib -png -qt -quicktime -sdl -truetype -xmms -xv"


Pick up again with Installing the Gentoo Base System in the handbook. Where we pick a mirror and start the move from stage1 to stage3. I see that the mirrorselect command has changed between 2004.0 and 2004.3.

# mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
# mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf


This should have dumped 2 extra lines into your make.conf file (cat /mnt/gentoo/etc/make.conf). Here is what got added to my make.conf file:

GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://gentoo.chem.wisc.edu/gentoo/"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"


Now we need to copy some files.

# cp -L /mnt/gentoo/etc/make.conf /mnt/gentoo/boot/make.conf-backupcopy
# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# cp -L /etc/mdadm.conf /mnt/gentoo/etc/mdadm.conf
# cp -L /etc/mdadm.conf /mnt/gentoo/boot/mdadm.conf-backupcopy
# mkdir /mnt/gentoo/etc/lvm
# cp -L /etc/lvm/lvm.conf /mnt/gentoo/etc/lvm/lvm.conf
# cp -L /etc/lvm/lvm.conf /mnt/gentoo/boot/lvm.conf-backupcopy


Change into the new system (note that we already mounted the proc filesystem earlier).

# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
# emerge --sync


This should update your portage tree to the latest version (and make take a while to run).

(See the next step)

Gentoo and Software RAID (2004.3)

Going back to the 2004.3 Gentoo Universal boot CD. Trying to get past my previous issue bd_claim issues when setting up a software RAID. This is on my Gigabyte GA-6VA7+ motherboard (notes on the Gigabyte GA-6VA7+ motherboard and other hardware).

Starting with the usual tricks:

1) Boot the system using the Universal CD
2) ifconfig - find out the IP address of the box
3) passwd - change the root password to something you know
4) Start the SSH daemon - /etc/init.d/sshd start

Since these drives were nuked since my last attempt, I have to re-configure the partitions.

# fdisk /dev/hda

Command: n
Command action: p
Partition number: 1
First cylinder: 1
Last cylinder: +128M
Command: a
Partition number: 1
Command: t
Hex code: fd

Command: n
Command action: p
Partition number: 2
First cylinder: [enter]
Last cylinder: +2048M
Command: t
Partition number: 2
Hex code: fd

Command: n
Command action: p
Partition number: 3
First cylinder: [enter]
Last cylinder: +2048M
Command: t
Partition number: 3
Hex code: fd

Command: n
Command action: p
First cylinder: [enter]
Last cylinder: [enter]
Command: t
Partition number: 4
Hex code: fd

Command: p

Command: w


This gives me a 128MB boot area, a 2GB swap area, a 2GB root area, with the rest of the disk set aside for my LVM2 partitions. Repeat the above commands to configure the 2nd disk in the same fashion (/dev/hdc for me).

Now I need to configure software RAID. This is a bit easier then last year since I don't need to muck with the /etc/raidtab file (instead, I'm going to use mdadm).

The following loads the 'md' module and creates the nodes (/dev/md*).

# modprobe md
# ls /dev/md*
ls: /dev/md*: No such file or directory
# for i in 0 1 2 3; do mknod /dev/md$i b 9 $i; done
# ls /dev/md*
/dev/md0 /dev/md1 /dev/md2 /dev/md3


Now, we create our RAID1 sets.

# modprobe raid1
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hdc1
mdadm: array /dev/md0 started.
# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hda2 /dev/hdc2
mdadm: array /dev/md1 started.
# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hdc2[1] hda2[0]
2000256 blocks [2/2] [UU]
[==>..................] resync = 13.8% (277760/2000256) finish=3.6min speed=7920K/sec
md0 : active raid1 hdc1[1] hda1[0]
125376 blocks [2/2] [UU]

unused devices: <none>


Seems to be working fine. Once each RAID set finishes initialization, I'll create the next one in the series using the following commands:

# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hda3 /dev/hdc3
# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hda4 /dev/hdc4


The last RAID set will take a while to initialize (2 hours?), so I'm going to go work on other things while it runs. I also need to go back and review the documentation to see what else I need to do when doing software RAID.