I have 3 machines on which I’m using ZFS, my favorite file system, under both Linux and FreeBSD.
One of them is used as a file server (over NFS), backup and media server. The last couple of days it started behaving badly:
When booting the machine the systemd service that imports zfs pools fails with a message on the line of “cannot import pool zzz”. I’m not using the zfs.service provided by the distribution which imports pools using cache, but a custom one in which each pool is imported with “zpool import -f pool”. This way worked perfectly for years.
If I delete /etc/zfs/zpool.cache and reboot the machine, everything gets back to normal.
This does not happen in FreeBSD, where I also import pools using zpool import -f.
All pools have the property “cachefile -” (null, default).
Two questions:
- Why is this happening lately and only in Linux?
- I think that /etc/zfs/zpool.cache gets corrupted somehow. Is there a way to avoid creating that file that seems to give so much trouble lately?