Joined: 29 Jul 2011
|Posted: Sun Nov 10, 2013 9:08 pm Post subject: Booting with root filesystem on mdraid RAID-1
|I'm trying to migrate an existing, perfectly functional Gentoo installation to a setup in which the root filesystem is mirrored across two disks using mdadm RAID-1. I am still hoping the reliability gain is worth the headache I'm getting from setting this up.
The system is an amd64 system with legacy BIOS, no EFI.
Steps I've taken so far:
- Set up a new, empty disk with a GPT using gdisk
- 3 partitions: BIOS boot partition (for Grub 2, non-EFI machine), '/boot' and 'rootfs'
- I've created degraded RAID-1 arrays (metadata version 1.2) in the partitions for '/boot' and 'rootfs'.
- I've updated mdadm.conf to include the "devices" (partitions, by PARTUUID) & arrays (output from mdadm --examine etc.).
- I've installed dracut because I need an initramfs to assemble the rootfs array and mount it.
Modifications I've made to dracut.conf are:
All required modules are statically compiled into my kernel; /usr is not on a separate partition so I figured I don't need usrmount.
- I've set up Grub 2 (on the one disk of the degraded arrays). I'm using raid=noautodetect since this system (normally) has several other software RAID arrays and I don't want random automatic stuff happening to them.
Results so far:
- I get to see a nice Grub 2 screen from which I can boot my kernel... just like before.
- Kernel boots, dracut starts spamming me
- Dracut times out trying to find the rootfs, which is passed to the kernel in root=UUID=...; dracut complains it cannot find that UUID -- I've tried all combinations of "rd.auto", "rd.auto=1" and "rd.md.uuid=mdadm:uuid:of:rootfsarray". I suppose the latter should do the trick by itself but dracut's documentation is rather unclear about that.
Dracut never seems to attempt to assemble the RAID-1 arrays. It finally drops into a shell, if I 'cat /proc/mdstat' no arrays have been assembled. I can see all the disks/partitions though, even the symlinks in /dev/disk/by-* are all there. Running "mdadm --examine --scan" lists both the arrays (boot and rootfs) correctly.
I'm probably missing something obvious. I have this running on another system without problems (using rd.auto=1 as only extra kernel parameters). Any hints or pointers to tutorials? I've been Googling this for a while.
EDIT: problem happens regardless of whether the array is degraded or not. Using "mdadm -A --scan" sets up the arrays correctly (correct names etc. as set through mdadm.conf) and the system can boot fine after exiting from the dracut shell. I've verified dracut has put udev rules in the initramfs to assemble the RAID arrays; they just never get triggered. I've enabled all kinds of debug output from dracut/udev and nothing interesting comes up. It just sits there doing nothing.