I want to create a zpool with ZFS on Linux (7.13) on Debian Buster. The problem is that the pool will be created based on LUKS encrypted drives (not root, only external). These drives are decrypted and loaded during boot by a script which i created since they are pulling a key file from an external source.
To avoid any issues with timing where the system wants to mount the zpool before the drives are decrypted and loaded I would like to mount the pool also manually as part of the script.
Now I ask myself which option I should choose for the mountpoint at creating the pool: none or legacy
The man page does not really help what the real difference is:
If a file system's mount point is set to legacy ZFS makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system. Because pools must be imported before a legacy mount can succeed, administrators should ensure that legacy mounts are only attempted after the zpool import process finishes at boot time. For example, on machines using systemd, the mount option
Does anybody know the real differences and how to achieve a manual mounting later by script the best way?
Best Answer
I've been using ZFS pools on LUKS encrypted volumes for the better part of a decade. It works fine.
There is no reason to mount the pool manually to attempt to defeat nonexistent timing problems. Just create your pool normally and enjoy.
To avoid any problems in the future, when creating and managing the pool, use the names beginning with
luks-
in the/dev/mapper
directory to refer to the devices. For example, the devices:correspond to:
This pool is created with: