kernel cmdline: root=/dev/sdb1,/dev/sda1 "fallback"?

From: Tomasz Chmielewski
Date: Wed Jan 17 2007 - 08:30:58 EST


I have a Linux (ARM) device that normally starts from /dev/sda1.

It is configured to do so via a cmdline in a RedBoot bootloader:

root=/dev/sda1


The device is pretty small and has no keyboard, video card etc., so if it ever happens to break (can be a disk failure, but also operator who messed with startup scripts), it has to be opened (warranty!).


These all unpleasant tasks could be avoided if it was possible to have a "fallback" device. For example, consider this hypothetical command line:

root=/dev/sdb1,/dev/sda1


/dev/sdb1 - USB-stick which can boot the device
/dev/sda1 - HDD which normally starts the device


It would mean, that kernel tries to boot the OS from /dev/sdb1, and if there isn't such a device, it tries to boot the OS from /dev/sda1.


In our case, /dev/sdb1 would be an external USB-stick capable to boot the device (in that case, we'd have to add rootdelay= option, too).
One would connect it only if he/she wants to service the device.

If /dev/sdb1 is not found by the kernel, the boot would start ("fallback") from /dev/sda1.


Does this make sense?


As I understand correctly, the needed change would have to be done in init/do_mounts.c, around "static int __init do_mount_root" and "void __init mount_block_root"? Any clues on that?


--
Tomasz Chmielewski
http://wpkg.org


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/