How can I change the mount point for a ZFS pool/dataset that is currently in use? I don't mind if it doesn't change immediately and I need to reboot, but I can't work out how to do it:
$ zfs set mountpoint=/srv/oldpool pool umount: /srv/pool/dataset1: target is busy. cannot unmount '/srv/pool/dataset1': umount failed $ zfs get mountpoint pool NAME PROPERTY VALUE SOURCE pool mountpoint /srv/pool local It refuses to make the change unless it can unmount all the datasets successfully.
When the system boots, the ZFS volumes are immediately in use so it would be nice to be able to change the mount point for the next boot, but it doesn't look like that's possible?
I'd like to avoid having to boot into single-user mode if possible!
(The reason for asking is I've copied the pool off failing disks onto a new pool on different disks, and now I want to swap everything over to the new pool by mounting it in place of the old one.)
altrootinman zpool. e.g. when you create a new pool to replace and old one, you set the altroot so the whole new pool gets temporarily mounted at that point. then you zfs send the old pool to the new. then export the old pool and reboot. It's not as flexible as what you're asking for, but like i said shutdown anything with open files on a dataset and you'll be able to unmount it. same as any other mounted filesystem (you can't unmount an xfs or ext4 fs with open files on it either)./etc/fstabto set the new mount point and when you reboot it'll be applied :-)zfs set canmount=noauto.