]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdmon.8
mdmon: recognise --all in place of /proc/mdstat
[thirdparty/mdadm.git] / mdmon.8
diff --git a/mdmon.8 b/mdmon.8
index c9cb5de8561b6e618a3afe9067cf117645913506..9be03271430ea31ad85b1902d68c059a6ef37585 100644 (file)
--- a/mdmon.8
+++ b/mdmon.8
@@ -1,11 +1,11 @@
 .\" See file COPYING in distribution for details.
-.TH MDMON 8 "" v3.0-rc1
+.TH MDMON 8 "" v3.1.1
 .SH NAME
 mdmon \- monitor MD external metadata arrays
 
 .SH SYNOPSIS
 
-.BI mdmon " CONTAINER [NEWROOT]"
+.BI mdmon " CONTAINER [NEWROOT | PID]"
 
 .SH OVERVIEW
 The 2.6.27 kernel brings the ability to support external metadata arrays.
@@ -129,7 +129,9 @@ CONTAINER
 The
 .B container
 device to monitor.  It can be a full path like /dev/md/container, a simple md
-device name like md127, or /proc/mdstat which tells
+device name like md127, or
+.I \-\-all
+ which tells
 .I mdmon
 to scan for containers and launch an
 .I mdmon
@@ -148,6 +150,45 @@ will terminate any
 instances that are running in the current namespace,
 .IR chroot (2)
 to NEWROOT, and continue monitoring the container.
+
+Alternately the new
+.I mdmon
+can be started after the new root has been installed with
+.I pivotroot
+by passing
+.B /
+as the NEWROOT.  For
+.I mdmon
+to be able to find and kill the old
+.I mdmon
+there must be some part of the filesystem that persists from before
+the
+.I pivotroot
+to afterwards.  This can be
+.B /var/run/mdadm
+or some other directory.  The default other directory is
+.B /lib/init/rw/mdadm
+but this can easily be changed when
+.I mdmon
+is compiled.
+If
+.I mdmon
+cannot store the pid file in
+.B /var/run/mdadm
+it will store it in the other directory until
+.B /var/run/mdadm
+becomes available, or until it is killed.
+.TP
+[PID]
+If the second argument to
+.I mdmon
+does not start with a slash it is assumed to be the pid of a previous
+instance of
+.I mdmon
+to kill.  This is used internally by
+.I mdmon
+to pass the pid across a chroot/exec and should not be used otherwise.
+
 .PP
 Note that
 .I mdmon
@@ -159,6 +200,17 @@ RAID arrays.  The only times it is run other that by
 is when the boot scripts need to restart it after mounting the new
 root filesystem.
 
+.SH EXMAPLES
+
+.B "  mdmon --all /"
+.br
+Any
+.I mdmon
+which is currently running is killed and a new instance is started.
+This should be run early in the boot sequence after a
+.I pivotroot
+to the final root filesystem, but before that filesystem is remounted
+read-write.
 .SH SEE ALSO
 .IR mdadm (8),
 .IR md (4).