Initramfs error handling, and mdadm - How to get mdadm's mount failure hook to function.

Luke Yelavich themuso at ubuntu.com
Fri Mar 7 06:11:39 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings all
I am in need of a bit of advice from those who have dealt with mdadm, particularly in relation to the initramfs, and degraded RAID arrays. I recently implemented the initramfs error handling spec,(1) and am now tracking down any bugs that need fixing. One particularly annoying bug is mdadm's mountroot failure hook not being able to function.

The way things are implemented at the moment, the initramfs checks for a valid root device node in /dev, say /dev/sda1 etc. With a Linux software RAID array, the root device node is something like /dev/md0. Packages/scripts are now able to register special hooks that can be called in the event that the root device node cannot be found. These hooks are designed to display useful information to the user when they are dumped to the busybox prompt, in the event the root filesystem cannot be brought up.

The problem with mdadm in this case, is that the /dev/md device node gets created, even if the array is degraded. The obvious consequence of this, is that the root device node is found, and the failure hook for mdadm is not run, causing the boot process to error out later on.

Debian's initramfs-tools has additional functionality, which also checks for a valid filesystem type of some sort. I'm not sure entirely what it does as I haven't fully read the code yet, but according to the comments and changelog, this seems to be more robust than simply using udev's vol-id mechanism. I am going to read the code more thoroughly, and see if it would solve the above problem, as well as test to see if the above behavior is the same with the added code from Debian. However, I'd rather not pull in other bits of code at this stage, unless there is a good need, and it fixes the problem in question.

So suggestions as to how this issue can be resolved would be much appreciated, and most welcome.

Thanks for your time.

Luke

(1) https://blueprints.launchpad.net/ubuntu/+spec/initramfs-error-handling
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH0NybjVefwtBjIM4RAs/DAJsHiHX9e0OQHDG37+PgCNCFdefJ7wCfVw6p
2ptC8PEKTV05PnZG2JuzUh0=
=sWDq
-----END PGP SIGNATURE-----



More information about the ubuntu-devel mailing list