| ZFS-MOUNT-GENERATOR(8) | System Manager's Manual | ZFS-MOUNT-GENERATOR(8) |
zfs-mount-generator —
generate systemd mount units for ZFS filesystems
/lib/systemd/system-generators/zfs-mount-generator
zfs-mount-generator is a
systemd.generator(7) that generates native
systemd.mount(5) units for configured ZFS datasets.
zfs
mount.Additionally, unless the pool the dataset resides on is imported at generation time, both units gain Wants=zfs-import.target and After=zfs-import.target.
Additionally, unless the logical noauto flag is set, the mount unit gains a reverse-dependency for local-fs.target of strength
Because ZFS pools may not be available very early in the boot process, information on ZFS mountpoints must be stored separately. The output of
zfs
list -Ho
name,⟨every property above in
order⟩The ZFS_DEBUG environment variable can either be 0 (default), 1 (print summary accounting information at the end), or at least 2 (print accounting information for each subprocess as it finishes). If not present, /proc/cmdline is additionally checked for "debug", in which case the debug level is set to 2.
To begin, enable tracking for the pool:
# touch
/etc/zfs/zfs-list.cache/poolname# ln
-s
/usr/lib/zfs-linux/zed.d/history_event-zfs-list-cacher.sh
/etc/zfs/zed.d# systemctl
enable
zfs-zed.service# systemctl
restart
zfs-zed.serviceIf no history event is in the queue, inject one to ensure the ZEDLET runs to refresh the cache file by setting a monitored property somewhere on the pool:
# zfs
set relatime=off
poolname/dset# zfs
inherit relatime
poolname/dsetTo test the generator output:
$ mkdir
/tmp/zfs-mount-generator$
/lib/systemd/system-generators/zfs-mount-generator
/tmp/zfs-mount-generatorsystemd to re-run all generators:
# systemctl
daemon-reloadsystemd.mount(5), systemd.target(5), zfs(5), systemd.generator(7), systemd.special(7), zed(8), zpool-events(8)
| May 31, 2021 | OpenZFS |