We need to be able to change the mountpoint of a ZFS dataset without having ZFS mount it for us. Also we need to be able to do this without setting canmount to off so that the dataset can still be mounted manually.
Could you just set canmount=off temporarily? Eg:
zfs set canmount=off pool/fs
zfs set mountpoint=/opt pool/fs
zfs inherit canmount pool/fs
(inheriting or setting canmount back to "on" won't cause it to be mounted)
The problem is you can't set canmount to off for the currently mounted root and still have it mounted. For LU this needs to be there in order to be able to set the ABE to boot on the next reboot without mounting the current set of datasets which belong to the currently booted BE. Because canmount can't be set to off for the currently active BE we have the problem on the next reboot of having more than one dataset attempting to mount at the same mount point (ie /opt).
OK, changed the synopsis to describe your problem (rather than a proposed solution).
Just clarifying what's really being requested here: This is just an RFE
calling out the need for the new "noauto" value for the "canmount"
property that was approved in PSARC/2006/370 (zfs boot project).