raid & mkinitrd rescue mode
Last week I was setting up a machine with ide raid. It was of the cheap kind, software with bios aka fake raid aka dmraid, but the kind I had did actually offer some hardware support if using the proprietary driver. So since the dmraid driver in linux is compatible with this kind of raid I thought that I could just go on and use dmraid for install, then switch to proprietary driver afterwards. Unfortunately it didn't seem like raid 5 of this kind were supported by dmraid, so I went on using linux md raid in stead.
D'oh, first bug spotted, harddrake's (partition utility used by Mandriva installer) raid support was broken. This was in short time fixed by Mandriva ace Pixel, so I got around to install this way shortly afterwards. The install went smooth, but when I rebooted I wasn't able to boot. I banged my head against this issue trying to switch between lilo, grub & grub 2 as bootloaders all of them failing. After wasting too much time on this I figured out that the bootloader was unable to read the partition tables, setting up raid in bios and not using it obviously messed up things. So after killing of this bios raid stuff completely and reinstalling the bootloader worked fine. Now unfortunately I came across yet another raid issue, raid handling in mkinitrd was broken as well due to wrong awk syntax in mkinitrd script. After figurin out this, it was quite trivial to fix and I commited a fix for it shortly afterwards.
Dealing with this I came to think something I've thought of many times in the past, some minimal rescue environment in mkinitrd would be really nice! So after doing some googling I found some old patch for this. I've cleaned it up and improved it a bit as well as made some other fixes to mkinitrd (it seems that a lot of mkinitrd code is very outdated and much less used options has become brokendue to this:/) and submitted a patch to bugzilla. Since we're just days away from final release of 2008.1, this will certainly not enter cooker at this moment, but I really hope it will for 2009.0, it would be really nice to have for failsafe boot. :)
To make a initrd image using this you have to apply the patch to mkinitrd, then you make a new initrd with '--rescue' option. Now you have a initrd built with this, to activate it you pass 'rescue' as argument to kernel at boot. This will make you enter a minimal busybox rescue environment at the beginning of boot where you can perform diagnostics and investigate issues you might have, ie. like if mount of root device fails. Then you can just exit the evironment and the boot will continue as normal.
Quite simple and useful, isn't it? :)
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!