FS#6027 - initrd provides no support for bootable partitionable arrays
Attached to Project:
Arch Linux
Opened by Glenn Matthys (RedShift) - Sunday, 17 December 2006, 13:38 GMT
Last edited by Tobias Powalowski (tpowa) - Thursday, 28 December 2006, 21:56 GMT
Opened by Glenn Matthys (RedShift) - Sunday, 17 December 2006, 13:38 GMT
Last edited by Tobias Powalowski (tpowa) - Thursday, 28 December 2006, 21:56 GMT
|
Details
ArchLinux: no partitionable array booting support
* Install # loadkeys be-latin1 # modprobe raid1 # mdadm --create --raid-devices=2 -l 1 -c 32 -a mdp /dev/md_d0 /dev/sda /dev/sdb # /arch/setup ... Choosing FTP install Setting up network * Prepare hard drive Partition Hard Drives /dev/md_d0: md_d0p1: 5000 MB linux bootable md_d0p2: 256 MB swap DONE Set Filesystem Mountpoints swap /dev/md_d0p2 swapfs / /dev/md_d0p1 reiserfs DONE * Select Packages (making sure mdadm is installed) ... DONE * Install Packages ... DONE * Configure System Nothing special, did not modify anything but rc.conf DONE * Install Kernel kernel26 DONE * Install Bootloader Modifying GRUB config file: kernel /boot/vmlinuz26 root=/dev/md_d0p1 ro md=d0,/dev/sda,/dev/sdb initrd /boot/kernel26-fallback.img Trying to install to /dev/sda GRUB install failed, when looking at vc5 the error is: grub> root DEVICE NOT FOUND Error 11: Unrecognized device string grub> setup(hd0) Error 12: Invalid device requested grub> quit It's quite obvious what goes wrong here. * Exit Install First reboot, otherwise grub weirdness occurs (grmbl) # loadkeys be-latin1 # mdadm --assemble --auto=mdp /dev/md_d0 /dev/sda /dev/sdb # mount /dev/md_d0p1 /mnt # mount -t proc proc /mnt/proc # mount --bind /dev /mnt/dev # chroot /mnt /bin/bash bash-3.2# grub grub> root(hd0,0) grub> setup(hd0) No failures grub> root(hd1,0) grub> setup (hd0) No failures grub> quit bash-3.2# exit # sync # reboot Okay so at this point the installation is complete. Upon boot, the kernel complains: ERROR: Failed to parse block device name for '/dev/md_d0p1' ERROR: root fs cannot be detected. Try using the rootfstype= kernel parameter kinit: Unable to mount root fs on device dev(0,0) kinit: init not found! Kernel panic - not syncing: attempted to kill init! The hard drives are attachted to an Adaptec 19160 controller, and is detected during bootup. I tested it with a self-compiled kernel, with the neccessairy things compiled in and the system boots up normally, so it's quite obvious the initrd does not have support for partitionable MD arrays. |
This task depends upon
kernel /boot/vmlinuz26 root=/dev/md_d0p1 ro md=d0,/dev/sda,/dev/sdb
1) create the right device nodes for partitionable arrays
2) mdassemble doesn't support partitionable arrays.
Have a look at the md manpage and look for "--auto" and "mdp"
Like the "normal" style, you partition two disks exactly the same way and create md devices from those partitions.
With partitionable arrays, you just create an array over your disks (let's say sda and sdb), which will form md_d0. Then you partition your array with cfdisk /dev/md_d0. After that, partitions show up as md_d0p1, md_d0p2, etc...
So you immediatly see the advantage, if a disk dies you just replace it. You don't have to copy your partition table from the other disk and you only need to notify one array that your array has to be rebuilt.
http://users.opengate.be/~glenn/arch/kernel.jpg
here is the output of a booted system with partitionable arrays, using a custom kernel with everything compiled in:
brw-rw---- 1 root disk 254, 0 Dec 11 18:22 md_d0
brw-rw---- 1 root disk 254, 1 Dec 11 18:22 md_d0p1
brw-rw---- 1 root disk 254, 2 Dec 11 18:22 md_d0p2
brw-rw---- 1 root disk 254, 3 Dec 11 18:22 md_d0p3
so it should mknod 254 0 /dev/md_d0 I think.
Now on bootup I get:
:: Running Hook [raid]
md: Will configure md0 (super-block) from /dev/sda,/dev/sdb, below.
Error: mdp devices detected but no mdp device found!
:: Running Hook [filesystems]
:: Loading root filesystem module.../init: 48: cannot open /dev/md_d0p1: No such device or address
:: Initramfs Completed - control passing to kinit
md: Will configure md_d0 (super-block) from /dev/sda,/dev/sdb, below.
kinit: cannot open root device dev(254,1)
kinit: init not found!
Kernel panic - Not syncing: Attempted to kill init!
please update your mdadm with the one above and replace raid with raid-partitions in mkinitcpio.conf and rebuild image.
thanks for testing
mdadm automatically creates 4 partitions if you need more you have to use a parameter option.
http://www.archlinux.org/~tpowa/mdadm-2.6-1.pkg.tar.gz
and replacing raid by raid-partitions
Glenn