Race condition while booting systemd with zfs-root

I solved a long annoying boot-problem happened in the systemd-async-boot-process.

Adding a sleeptime in /lib/systemd/system/systemd-udev-settle.service by adding ExecStartPre=/usr/bin/sleep 5 to the [Service]-Section, gives the system 5 sec. more time to load the zfs-module and import the pool before it tries to remount root to the real directory on disk.

ZFS Access Snapshot

ZFS adds to every mountpoint a (hidden) subdir called .zfs. It presents in this directory the shares and snapshot. Through the later one you can gain access to the fixated data from every snapshot you made. E. g. for an atomic database-backup or restore of deleted files.


ZFS Swap disk

Creates a Swap-Partititon for Linux on a zfs-volume.

zfs create -V 8G -b $(getconf PAGESIZE) -o compression=zle -o logbias=throughput \
-o sync=always -o primarycache=metadata -o secondarycache=none \
-o com.sun:auto-snapshot=false tank/ROOT/swap

mkswap /dev/zvol/tank/ROOT/swap
swapon /dev/zvol/tank/ROOT/swap