Skip to content
Browse files
Workaround to avoid a race when /var/lib is a persistent dataset
If /var/lib is a dataset not under <pool>/ROOT/<root_dataset>, as
proposed in the ubuntu root on zfs upstream guide
we end up with a race where some services, like systemd-random-seed
are writing under /var/lib, while zfs-mount is called. zfs mount will
then potentially fail because of /var/lib isn't empty and so, can't be
Order those 2 units for now (more may be needed) as we can't declare
virtually a provide mount point to match
"RequiresMountsFor=/var/lib/systemd/random-seed" from
The optional generator for zfs 0.8 fixes it, but it's not enabled
by default nor necessarily required.

- rpool/ROOT/ubuntu (mountpoint = /)
- rpool/var/ (mountpoint = /var)
- rpool/var/lib  (mountpoint = /var/lib)

Both zfs-mount.service and systemd-random-seed.service are starting
After=systemd-remount-fs.service. zfs-mount.service should be done
before while systemd-random-seed.service should finish
before (which is a later target).
Ideally, we would have a way for zfs mount -a unit to declare all paths
or move systemd-random-seed after

Reviewed-by: Antonio Russo <>
Reviewed-by: Richard Laager <>
Reviewed-by: Brian Behlendorf <>
Signed-off-by: Didier Roche <>
Closes #9360
  • Loading branch information
didrocks authored and behlendorf committed Oct 2, 2019
1 parent d31277a commit 8ae8b2a1445bcccee1bb8ee7d4886f30050f6f53
Showing with 1 addition and 0 deletions.
  1. +1 −0 etc/systemd/system/
@@ -6,6 +6,7 @@ After=systemd-udev-settle.service


0 comments on commit 8ae8b2a

Please sign in to comment.