Note: this is a deeply technical note for ZFS users, in the hope that somebody somewhere researching the problem that’s stopping their machine from booting after an upgrade will see it. If this doesn’t apply to you, look away now …
I’ve recently been using ZFS on my RPi5 servers and been having no problems at all, everything is very smooth. Today I’ve come back to my PC (amd64) to “de-Ubuntu” it to find that Debian ZFS seems to be a mess.
The issue seems to revolve around the boot-up sequence, essentially it won’t automatically mount your pools / volumes as it should.
This seems to stem from a file, /etc/zfs/zpool.cache, which it would appear is something some of the developers are trying to remove. Not saying this is bad thing, but given it’s key to the current boot process and the mounting of ZFS filesystems, they could really do with getting it right rather than half-in half-out.
Problems
- This file is cleared on reboot
- Required options / parameters like “mountpoint” do not seem to be persisted in the filesystem (as they should be!)
- It looks like there is a race-condition in the startup sequence somewhere
User fix
- Configure your system, set up a pool, in this example we’ll call it “pool”
- Copy your (hopefully populated) /etc/zfs/zpool.cache to /etc/zfs/zpool.cache.persist
- Edit; /lib/systemd/system/zfs-import-cache.service
- Remove the “Condition” for zpool.cache not existing
- Remove ExecStart line and replace it with;
ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache.persist -aN $ZPOOL_IMPORT_OPTS
ExecStartPost=/usr/bin/sleep 5
ExecStartPost=/usr/sbin/zfs set mountpoint=/pool pool
ExecStartPost=/usr/sbin/zfs inherit -r mountpoint pool
Again, assuming your pool is called “pool” and you want it mounted on “/pool”
Reboot and all being well it should import and auto-mount as expected.
Summary
This should never have been left in this state and I don’t understand how it’s working fine on the Debian ARM version when it looks so broken on AMD. (and I’m referencing lots of other comments, threads etc elsewhere from many other people with the same problem.)
1 post - 1 participant