2

I am using ZFSBootMenu for multi-zroot.

zpRoot/LINUX/Artix/System                 mountpoint                   /
zpRoot/LINUX/eos/SysClone1                mountpoint                   /                    
zpRoot/LINUX/eos/System                   mountpoint                   /

While boot into zpRoot/LINUX/eos/SysClone1, I want to read files from other dataset like zpRoot/LINUX/eos/System. The common way is to modify mountpoint and then mount, but I usually forget to restore mountpoint to /.

I tried zfs mount -o mountpoint=/mnt/1 zpRoot/LINUX/eos/System and zfs mount -o altroot=/mnt/1 zpRoot/LINUX/eos/System, but neither works.

How can I change mountpoint in memory without commit it to the disk ?

Galaxy
  • 237

1 Answers1

1

I run a lot of ZFS on FreeBSD, but very little on Linux. It looks like my Ubuntu system can't do this without setting mountpoint=legacy:

# zfs list -o name,canmount,mounted,mountpoint pool/test 
NAME       CANMOUNT  MOUNTED  MOUNTPOINT
pool/test        on       no  /home/research/test
# mount -t zfs pool/test /mnt
filesystem 'pool/test' cannot be mounted using 'mount'.
Use 'zfs set mountpoint=legacy' or 'zfs mount pool/test'.
See zfs(8) for more information.

On FreeBSD, it's easy to do, with mount -t zfs <dataset> <temp mountpoint>:

# zfs list -o name,canmount,mounted,mountpoint jimsdesk/home/test
NAME                CANMOUNT  MOUNTED  MOUNTPOINT
jimsdesk/home/test  on        no       /home/test
# mount -t zfs jimsdesk/home/test /mnt
# zfs mount | grep home
jimsdesk/home                   /home
jimsdesk/home/test              /mnt
Jim L.
  • 7,997
  • 1
  • 13
  • 27