.\" 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 " [--all] [--takeover] CONTAINER"
.SH OVERVIEW
The 2.6.27 kernel brings the ability to support external metadata arrays.
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
-.I mdmon
-to scan for containers and launch an
-.I mdmon
-instance for each one found.
+device to monitor. It can be a full path like /dev/md/container, or a
+simple md device name like md127.
.TP
-[NEWROOT]
-In order to support an external metadata raid array as the rootfs
+.B \-\-takeover
+This instructs
.I mdmon
-needs to be started in the initramfs environment. Once the initramfs
-environment mounts the final rootfs
+to replace any active
.I mdmon
-needs to be restarted in the new namespace. When NEWROOT is specified
+which is currently monitoring the array. This is primarily used late
+in the boot process to replace any
.I mdmon
-will terminate any
+which was started from an
+.B initramfs
+before the root filesystem was mounted. This avoids holding a
+reference on that
+.B initramfs
+indefinitely and ensures that the
+.I pid
+and
+.I sock
+files used to communicate with
.I mdmon
-instances that are running in the current namespace,
-.IR chroot (2)
-to NEWROOT, and continue monitoring the container.
+are in a standard place.
+.TP
+.B \-\-all
+This tells mdmon to find any active containers and start monitoring
+each of them if appropriate. This is normally used with
+.B \-\-takeover
+late in the boot sequence.
+
.PP
Note that
.I mdmon
is when the boot scripts need to restart it after mounting the new
root filesystem.
+.SH EXAMPLES
+
+.B " mdmon \-\-all \-\-takeover"
+.br
+Any
+.I mdmon
+which is currently running is killed and a new instance is started.
+This should be run late in the boot sequence and particularly after
+.B /var
+is mounted and writable.
.SH SEE ALSO
.IR mdadm (8),
.IR md (4).