I'm posting this to document the correct procedure for myself, as well as to help anyone else who had this issue.
The Problems
After trying everything mentioned in this thread, I stumbled upon a clue finally reading the
mdadm manual:
mdadm supports RAID 10. As best I can gather, creating an
/dev/mdN device from two other
md devices won't work, since during boot, the system was reporting having to re-sync several of the arrays, right before the kernel panic.
On boot, I received the following error messages:
Code:
MOUNT: Mounting /dev/md5 on /mnt failed: No such file or directory.
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
I checked my partition tables (of the constituent drives) using
fdisk and was warned:
Code:
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
No, even after I got RAID working, this warning message showed up on the bare drives, so I think it's normal when using
mdadm. In any case, rewriting these partition tables from scratch didn't even fix the problem.
After double checking
/etc/fstab and switching to the huge kernel, the problem persisted, so I suspected the problem lay with
mdadm. That's when I started over, using
mdadm --create /dev/md0 --level 10 instead.
One more note before I move on: I loathe
fdisk, now. It apparently subscribes to the philosophy that usability may be sacrificed for precision, but the existence of
cfdisk shows that isn't a necessary tradeoff. My gribe is specific:
fdisk defaults to using sectors instead of cylinders, and (after being thoroughly confused by the math) I found out none of my partitions ended at cylinder boundaries. Hell, the default starting sector was almost 2000 sectors ahead of the first cylinder. I found out you could switch to cylinder mode using `u`, but found out that was deprecated.
The easiest solution for me? Create the partitions with
cfdisk. Note, however, that
cfdisk likes to make the first partition swap even if you tell it to type it as `fd`. The solution was to delete that partition and recreate it in
fdisk. Since it was already the right size and cylinder, I started in cylinder mode, printed the table, and used the same addresses to recreate the partition.
The Solution
Step One: Plan Partitions
I had a few goals. First, I wanted to separate the
/boot partition from the rest so I could mirror it across all drives, as suggested by the
lilo RAID readme and by the
README_RAID.txt on the Slackware install DVD. I also wanted to separate
/usr and
/home partitions to make upgrading simpler. I ended up using LVM from the previous two partitions, and keeping
/boot,
root, and
swap as primary partitions. We'll be referring back to this table when setting up
mdadm arrays.
Code:
MD # Partition # Mount Size (Full/2 for RAID 10) RAID Devices RAID Level
------+-------------+------------+---------------------------+--------------+------------
0 1 ~/boot~ 100M 4 1
1 2 ~/~ 20G/2 = 10G 4 10
2 3 swap 4G/2 = 2G 4 10
------+-------------+------------+---------------------------+--------------+------------
- 4 Extended - - -
3 5 ~/usr~ 40G/2 = 20G 4 10
4 6 ~/home~ Remainder (about ~250G) 4 10
- - Free space ~100MB - -
Step Two: Create Partitions
Create the partitions using both
cfdisk and
fdisk, as noted in the last two paragraphs of the previous section.
After you create the partitions on the first device, use
sfdisk to copy that partition table to the other drives, and check that they are parallel (all partitions start and end on the same sector, important for
lilo) using
fdisk.
Code:
sfdisk -d /dev/sda | sfdisk [--force] /dev/sdb
Optionally add the
--force flag to right pipe-side if needed, but be sure to reboot before continuing if you do.
Step Three: Create RAID Arrays
For my partitions, I created the following commands to create all my arrays.
Code:
mdadm --create /dev/md0 --level 1 --raid-devices 4 /dev/sd[abcd]1 --metadata=0.90
mdadm --create /dev/md1 --level 10 --raid-devices 4 /dev/sd[abcd]2
mdadm --create /dev/md2 --level 10 --raid-devices 4 /dev/sd[abcd]3
mdadm --create /dev/md3 --level 10 --raid-devices 4 /dev/sd[abcd]5
mdadm --create /dev/md4 --level 10 --raid-devices 4 /dev/sd[abcd]6
Step Four: Setup
Go ahead and type
setup to start the Slackware setup menu. Select your target partitions first, making sure to select the root partition (
/dev/md1 in my case) before setting up all the other partitions. Then, double check to make sure the correct swap partition is selected, and begin the installation.
When it comes time to configure
lilo, just choose the simple option, and add the following flag when prompted:
root=/dev/md1 (or whatever your root is). Exit setup when finished. Do not reboot.
Step Five: Edit Configuration
Switch to the new installation by typing:
Edit
/etc/lilo.conf, adding the following line without indenting:
Code:
raid-extra-boot = mbr-only
This increases the robustness of your boot setup. Change the
boot=something line to the correct RAID device, in my case:
Save the file. You don't have to run
lilo yet.
Step Six: Switch to Generic Kernel
The
/boot partition should be mounted, but if it isn't, type:
Code:
mount /dev/md0 /boot
Perform the following commands to remove the current kernel and activate the generic one:
Code:
cd /boot
rm vmlinuz System.map config
ln -s vmlinuz-generic-[TAB] vmlinuz
ln -s System.map-generic-[TAB] System.map
ln -s config-generic-[TAB] config
Prepare an initrd by first copying the example config file
Code:
cp /etc/mkinitrd.conf.example /etc/mkinitrd.conf
Then edit the configuration file. I uncommented as many lines as seemed necessary and filled in the appropriate values, including
ROOTDEV and
ROOTFS. The most important ones are
RAID="1" and
MODULE_LIST="ext4" and
LVM="1".
Run
mkinitrd -f -R. Note where the initrd image is output. Edit
/etc/lilo.conf again, adding
initrd = /boot/initrd.gz indented under the boot menu option for linux at the end of the file.
Run
lilo -t -v to test. Observe the warnings. If all looks good, go ahead and run
lilo without flags.
Reboot and pray.