lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Failover root devices
Date
 > 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



\
 
 \ /
  Last update: 2015-09-17 14:21    [W:0.052 / U:2.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site