Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

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
Task Type Bug Report
Category Installation
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


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
md_d0p1: 5000 MB linux bootable
md_d0p2: 256 MB swap

Set Filesystem Mountpoints
swap /dev/md_d0p2 swapfs
/ /dev/md_d0p1 reiserfs

* Select Packages
(making sure mdadm is installed)

* Install Packages

* Configure System
Nothing special, did not modify anything but rc.conf

* Install Kernel

* 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:

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

This task blocks these from closing
 FS#6031 - 0.8 installation ISO showstoppers 
Closed by  Tobias Powalowski (tpowa)
Monday, 29 January 2007, 21:28 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Thursday, 28 December 2006, 20:50 GMT
what boot parameters have you used? you need to assemble the arrays from grub/lilo boot entry, please refer to mkinitcpio wiki how to pass the correct parameters
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 21:32 GMT

kernel /boot/vmlinuz26 root=/dev/md_d0p1 ro md=d0,/dev/sda,/dev/sdb
Comment by Tobias Powalowski (tpowa) - Thursday, 28 December 2006, 21:57 GMT
strong guess, mdassemble is just limited, aaron or thomas please take a look at it
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 21:57 GMT
This is most likely because the initrd doesn't
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"
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 22:05 GMT
What are partitionable arrays?
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.
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 22:06 GMT Comment by Aaron Griffin (phrakture) - Thursday, 28 December 2006, 22:08 GMT
Can you please try with "raid=part" or "raid=partitionable" as a boot param?
Comment by Aaron Griffin (phrakture) - Thursday, 28 December 2006, 22:12 GMT
Also, are you using the 'raid' hook? If so, you only need this hook if you are doing something with the raid array afterwards. You may want to try removing that hook and specifying the rootfstype=* in the boot line. kinit's raid detection may be a bit better at picking this up, but I'm not entirely sure.
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 22:16 GMT
Same result with both raid=part and raid=partitionable.
Comment by Glenn Matthys (RedShift) - Thursday, 28 December 2006, 22:18 GMT
I'll get back to you tomorrow, the computer I'm testing it on makes too much noise and people here want to sleep :(
Comment by Glenn Matthys (RedShift) - Friday, 29 December 2006, 09:35 GMT
I think the solution here is just to make the initial ramdisk create device nodes.

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.

Comment by Tobias Powalowski (tpowa) - Saturday, 20 January 2007, 16:58 GMT
could you please try the attached raid hook, copy it to /lib/initcpio/hooks and rebuild initrd
   raid (0.5 KiB)
Comment by Glenn Matthys (RedShift) - Saturday, 20 January 2007, 19:42 GMT
Still no go

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!
Comment by Tobias Powalowski (tpowa) - Sunday, 21 January 2007, 10:11 GMT
please update your mdadm with the one above and replace raid with raid-partitions in mkinitcpio.conf and rebuild image.
thanks for testing
Comment by Aaron Griffin (phrakture) - Monday, 22 January 2007, 09:28 GMT
I don't know if creating device nodes manually is really a robust solution here. While it may work in this case, it's not a sure-thing.
Comment by Tobias Powalowski (tpowa) - Monday, 22 January 2007, 18:12 GMT
well its not really making them manually with mknod, mdadm registers the device to the kernel, just creating nodes doesn't make it working. As far as i did understand it, the kernel would autodetect everything if it's included in the kernel, modularized it's really more complicated, aaron could you add the kernel register thing to mdassemble, else i think we have no chance to get it working without mdadm.
mdadm automatically creates 4 partitions if you need more you have to use a parameter option.
Comment by Glenn Matthys (RedShift) - Monday, 29 January 2007, 15:19 GMT
Sorry to dissappoint you but it's still the same problem, using
and replacing raid by raid-partitions