Name

Monitor mode

Synopsis

mdadm --monitor mddevice [options]

Monitor, or Follow, mode allows administrators to configure email notification, set up event handling, and share spare disks between arrays.

Options

-F, --follow, --monitor

Enables Follow mode for the specified array(s). mdadm will not exit when Follow mode is invoked. Instead, it polls arrays and monitors for critical events. Run mdadm in the background as necessary.

-m, --mail=

Sets the email address to notify when a failure event occurs. Example: -mderek or --mail=derek.

-p, --program=, --alert=

Executes the specified program when an event occurs. You can create homegrown scripts to help mdadm monitor and manage arrays. Examples of these options include -pmymdmonitor.sh or --program=/usr/local/sbin/mymdmonitor.pl.

-d, --delay=

Changes the number of seconds to wait between polling arrays (for example, -d30 or --delay=30 for thirty seconds). The default is one minute.

-s, --scan

When used in Monitor mode, consults /etc/mdadm.conf for a MAILADDR line that indicates where to email results, and for a PROGRAM line that indicates what program to run, instead of taking those pieces of information from the command line.

Example usage

When monitor mode is invoked, mdadm will not exit, so it’s a good idea to run it in the background and redirect its output to a file that you can examine. The following example polls /dev/md1 every sixty seconds (the default) and sends critical event notifications to root:

# nohup mdadm --monitor /dev/md1 --mail=root ...

Get Managing RAID on Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.