Linux command
zed 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Start zed in foreground mode
sudo zed -F
Start zed with verbose output
sudo zed -v
Run in foreground without state file
sudo zed -M
Specify alternative config directory
sudo zed -d [/etc/zfs/zed.d]
说明
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.
参数
- -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
FAQ
What is the zed command used for?
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.
How do I run a basic zed example?
Run `sudo zed -F` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c _conffile_ do in zed?
Read configuration from specified file