Comment 4 for bug 1571761

Revision history for this message
Richard Laager (rlaager) wrote :

@pitti: zfs-import-cache.service doesn't "load the ZFS cache". It imports zpools which are listed in the /etc/zfs/zpool.cache file. It is conditioned (ConditionPathExists) on the existence of /etc/zfs/zpool.cache. It seems to me that upstream ZoL is tending to deprecate the zpool.cache file.

In contrast is zfs-import-scan.service, which imports pools by device scanning. This is conditioned on /etc/zfs/zpool.cache NOT existing. So one or the other service runs, depending on whether you have a zpool.cache file.

Longer-term, I agree that we need some sort of solution that isn't "wait for all devices". Is there any prior art with btrfs or MD that's applicable here? (I know MD devices are assembled by the kernel in some circumstances. I think mdadm is involved in other cases.)

As a side note, zfs-import-scan.service hardcodes /dev/disk/by-id, which is probably not ideal. The reason for that is likely to work-around that `zpool import` is preferring /dev. See also: https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1571241/comments/8