]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdmon: --switch-root
authorDan Williams <dan.j.williams@intel.com>
Thu, 2 Oct 2008 22:50:23 +0000 (15:50 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 15 Oct 2008 21:43:57 +0000 (14:43 -0700)
commit13047e4c0708ad06a6c0a07e79a080dade94df38
treef60c62c4cb9ec20916f1b13bec0f4d5d70d5a06f
parent883a6142e64c6ed3e0dfeb28b2d9e48ddafd4c18
mdmon: --switch-root

For raid rootfs we cannot run the array unmonitored for any length of
time.  At least XFS will not mount/replay the journal if the underlying
block device is readonly (FIXME it also seems that XFS does not always
honor the ro status of the backing device as I was able to hit the
BUG_ON(mddev->ro == 1) in md_write_start... but I digress).

So we need to start mdmon in the initramfs before '/' is mounted and
then restart it after the real rootfs is available.  Upon seeing the
--switch-root option, mdmon will kill any victims in the current
/var/run/mdadm directory and then chroot(2) before continuing.

The option is deliberately called 'switch-root' instead of 'chroot' to
hopefully indicate that this is different than doing "chroot mdmon
/dev/imsm".

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdmon.c