Comment on Question about mounting ZFS pool
Max_P@lemmy.max-p.me 4 months ago
The trick for this one is mount -t zfs -o zfsutil internal /mnt/some/path
Assuming the root dataset is mountable. If you have a -o canmount=off
on the dataset it will refuse to mount.
If it’s -o mountpoint=legacy
then you don’t need -o zfsutil
, but still need to provide both the source and destination paths. Otherwise you’ll get the fstab error because mount can’t figure out what to mount or where to mount it.
hoxbug@lemmy.world 4 months ago
Thank you so much, where did you find this bit of information? I have been trying to solve this problem for the past week or so, but my google foo failed me on this one. Was about to give up on this one.
Max_P@lemmy.max-p.me 4 months ago
I learned it accidentally trying to get root on an encrypted dataset working with systemd init without sd-zfs. This turns out to be how the
zfs
utility works internally to signal the driver “hey it’s okay, I’m a ZFS utility the user isn’t using mount directly”, and how you deal with mounting your root dataset to the temporary/sysroot
while having its mountpoint set to/
while in initramfs before pivoting root.Obviously, don’t use that other than recovering your data, if you want to use this array you should figure out the mountpoints properly so ZFS does it automatically. It shouldn’t break anything but it’s gross, either set
mointpoint=legacy
and use fstab or set its mountpoint in ZFS and usezfs mount
.