Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override 'mountpoint' when mounting a filesystem #4553

Closed
FransUrbo opened this issue Apr 23, 2016 · 6 comments
Closed

Can't override 'mountpoint' when mounting a filesystem #4553

FransUrbo opened this issue Apr 23, 2016 · 6 comments

Comments

@FransUrbo
Copy link
Contributor

# zfs get mountpoint share/home/ftp/zol
NAME                PROPERTY    VALUE                    SOURCE
share/home/ftp/zol  mountpoint  /mnt/share/home/ftp/zol  inherited from share/home
# zfs mount -o mountpoint=/mnt/celia share/home/ftp/zol
filesystem 'share/home/ftp/zol' cannot be mounted due to invalid option 'mountpoint=/mnt/celia'.
Use the '-s' option to ignore the bad mount option.
cannot mount 'share/home/ftp/zol': Invalid argument

PS. Pool imported with -N -R /mnt/share. Setting mountpoint to the desired value and then mounting it works.

This is v0.6.5.6.

@FransUrbo
Copy link
Contributor Author

# zfs mount -s -o mountpoint=/mnt/share share/home/ftp
invalid option 's'
usage:
        mount
        mount [-vO] [-o opts] <-a | filesystem>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow

@FransUrbo
Copy link
Contributor Author

Looking at the manpage, I see:

   Temporary Mount Point Properties
       When a file system is mounted, either through mount(8) for legacy mounts or the zfs mount command for normal file systems, its  mount  options  are
       set according to its properties. The correlation between properties and mount options is as follows:

             PROPERTY                MOUNT OPTION
              devices                 devices/nodevices
              exec                    exec/noexec
              readonly                ro/rw
              setuid                  setuid/nosetuid
              xattr                   xattr/noxattr
              atime                   atime/noatime
              relatime                relatime/norelatime
              nbmand                  nbmand/nonbmand

So mountpoint isn't in there. But I think it's quite reasonable that it SHOULD be possible to use it.

@jf
Copy link

jf commented Jun 10, 2017

same for 0.6.5.9, btw. And ditto - I'd like to have this.

@lucidBrot
Copy link

until this exists: It seems possible to use

mount -t zfs -o zfsutil rpool/dataset /mntpoint

to mount the rpool/dataset dataset at /mntpoint

@Haravikk
Copy link

Haravikk commented Feb 7, 2022

Is it still not possible to change mountpoint using the zfs mount -o mountpoint=/some/path command directly? I just tried this today but instead of returning any kind of error like the OP mentioned, it just silently mounted the dataset using the mount point property of the dataset, rather than the option I set.

Personally I'd prefer the error if for some reason this functionality cannot be implemented, as an option supplied by the user should either work, or produce some kind of feedback; silence is dangerous. In my case I was trying to mount a backup dataset so I could run zfs diff on its snapshots (to find out what was eating up a load of space between snapshots) but instead of mounting at a harmless test location like I expected, it was mounted over the live dataset the backups were created from! Fortunately it wasn't in active use, but I could see the current behaviour resulting in problems if it had been, as it would have suddenly become read-only (all my backup datasets have readonly=on to prevent accidental changes).

Really the provided mountpoint should either be used, or rejected with an error message, acting like it was accepted then doing the opposite isn't ideal!

@almereyda
Copy link

It appears reopening this alongside #985 would seem feasible for the case described in the original posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@jf @FransUrbo @almereyda @Haravikk @lucidBrot and others