Messages in this thread | | | From | Ortwin Glück <> | Subject | Re: Failover root devices | Date | Thu, 17 Sep 2015 13:40:43 +0200 |
| |
> I would like to see Linux support multiple root devices
You can do that completely in user space from an initramfs.
From your init script you can do what you want. You may even parse /proc/cmdline and use the root= parameter as you propose. Then mount whatever root device you want by whatever method you like and finally exec switch_root /mnt/root /sbin/init "$@"
See here for example scripts for initramfs: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/initramfs.html
Above script actually makes it easy by supporting disk labels: root=LABEL=ROOT will boot the first available partition that is labelled ROOT. It is independent of the device name and works nice when you switch hardware vs. virtual machines for instance.
Ortwin
| |