LinuxCommandLibrary

zed

ZFS event monitoring daemon

TLDR

Start zed in foreground mode

$ sudo zed -F
copy
Start zed with verbose output
$ sudo zed -v
copy
Run in foreground without state file
$ sudo zed -M
copy
Specify alternative config directory
$ sudo zed -d [/etc/zfs/zed.d]
copy

SYNOPSIS

zed [-FhMvV] [-c conffile] [-d confdir] [-I idle] [-p pidfile] [-P path] [-s statefile]

DESCRIPTION

zed (ZFS Event Daemon) monitors ZFS kernel events and executes scripts in response. It listens for events like scrub completion, device failures, pool imports, and data errors, then runs corresponding handler scripts.
Scripts are stored in /etc/zfs/zed.d/ with naming convention event-name.sh. Enabled scripts are symlinked to be active. Common events include:
- resilver.finish - Resilver completed
- scrub.finish - Scrub completed
- statechange - Pool state changed
- data - Data errors detected
zed enables automated responses to ZFS events like sending email notifications on errors or running custom maintenance scripts.

PARAMETERS

-c conffile

Read configuration from specified file
-d confdir
Read enabled scripts from directory (default: /etc/zfs/zed.d)
-F
Run in foreground, don't daemonize
-h
Display help message
-I idle
Idle timeout in seconds for script execution
-M
Ignore missing state file
-p pidfile
Write process ID to file
-P path
Set PATH for script execution
-s statefile
Write state to file
-v
Verbose mode, log events to stderr
-V
Display version

CAVEATS

zed must run as root to receive kernel events and access pool information.
Script execution is serialized by default. Long-running scripts can delay processing of subsequent events.
Poorly written event scripts can cause system issues. Test scripts thoroughly before enabling.
On systemd systems, zed typically runs as a systemd service (zfs-zed.service).

SEE ALSO

zfs(8), zpool(8), zpool-events(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community