]> git.proxmox.com Git - mirror_zfs.git/commitdiff
mount.zfs.8: match to reality; zfsprops.8: add missing temporary options
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Mon, 24 May 2021 18:26:39 +0000 (20:26 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 27 May 2021 04:44:56 +0000 (21:44 -0700)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12111

cmd/mount_zfs/mount_zfs.c
man/man8/mount.zfs.8
man/man8/zfsprops.8

index 5196c3e5cb5f610acb2d83019d6e835edc7d99ab..b9be69d1fb0256bf30826eff8bde7d0d3d8b0198 100644 (file)
@@ -185,10 +185,11 @@ main(int argc, char **argv)
                        break;
                case 'h':
                case '?':
-                       (void) fprintf(stderr, gettext("Invalid option '%c'\n"),
-                           optopt);
+                       if (optopt)
+                               (void) fprintf(stderr,
+                                   gettext("Invalid option '%c'\n"), optopt);
                        (void) fprintf(stderr, gettext("Usage: mount.zfs "
-                           "[-sfnv] [-o options] <dataset> <mountpoint>\n"));
+                           "[-sfnvh] [-o options] <dataset> <mountpoint>\n"));
                        return (MOUNT_USAGE);
                }
        }
index 60baf2952c6b86115b320a42ecf9a3680ff1e78f..dd04b3109bfcd826edd8c05bd07b956564985554 100644 (file)
@@ -1,4 +1,3 @@
-'\" t
 .\"
 .\" CDDL HEADER START
 .\"
@@ -19,7 +18,6 @@
 .\"
 .\" CDDL HEADER END
 .\"
-.\"
 .\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
 .\"
 .Dd May 24, 2021
 .Ar mountpoint
 .
 .Sh DESCRIPTION
+The
 .Nm
-is part of the zfsutils package for Linux. It is a helper program that
-is usually invoked by the
+helper is used by
+.Xr mount 8
+to mount filesystem snapshots and
+.Sy mountpoint= Ns Ar legacy
+ZFS filesystems, as well as by
+.Xr zfs 8
+when the
+.Ev Em $ZFS_MOUNT_HELPER
+environment variable is not set.
+Users should should invoke either
 .Xr mount 8
 or
 .Xr zfs 8
-commands to mount a ZFS dataset.
+in most cases.
 .Pp
-All
 .Ar options
-are handled according to the FILESYSTEM INDEPENDENT MOUNT OPTIONS
-section in the
-.Xr mount 8
-manual, except for those described below.
+are handled according to the
+.Em Temporary Mount Point Properties
+section in
+.Xr zfsprops 8 ,
+except for those described below.
 .Pp
-The
-.Ar dataset
-parameter is a ZFS filesystem name, as output by the
-.Nm zfs Cm load-key Fl h Fl o Ar name
-command. This parameter never has a leading slash character and is
-not a device name.
-.Pp
-The
-.Ar mountpoint
-parameter is the path name of a directory.
+If
+.Pa /etc/mtab
+is a regular file and
+.Fl n
+was not specified, it will be updated via libmount.
 .
 .Sh OPTIONS
 .Bl -tag -width "-o xa"
 .It Fl s
-Ignore bad or sloppy mount options.
+Ignore unknown (sloppy) mount options.
 .It Fl f
-Do a fake mount; do not perform the mount operation.
+Do everything except actually executing the system call.
 .It Fl n
-Do not update the /etc/mtab file.
+Never update
+.Pa /etc/mtab .
 .It Fl v
-Increase verbosity.
+Print resolved mount options and parser state.
 .It Fl h
 Print the usage message.
-.It Fl o Ar context
-This flag sets the SELinux context for all files in the filesystem
-under that mountpoint.
-.It Fl o Ar fscontext
-This flag sets the SELinux context for the filesystem being mounted.
-.It Fl o Ar defcontext
-This flag sets the SELinux context for unlabeled files.
-.It Fl o Ar rootcontext
-This flag sets the SELinux context for the root inode of the filesystem.
-.It Fl o Ar legacy
-This private flag indicates that the
-.Ar dataset
-has an entry in the /etc/fstab file.
-.It Fl o Ar noxattr
-This private flag disables extended attributes.
-.It Fl o Ar xattr
-This private flag enables directory-based extended attributes and, if
-appropriate, adds a ZFS context to the selinux system policy.
-.It Fl o Ar saxattr
-This private flag enables system attributed-based extended attributes and, if
-appropriate, adds a ZFS context to the selinux system policy.
-.It Fl o Ar dirxattr
-Equivalent to
-.Ar xattr .
 .It Fl o Ar zfsutil
 This private flag indicates that
 .Xr mount 8
@@ -107,32 +86,7 @@ is being called by the
 command.
 .El
 .
-.Sh NOTES
-ZFS conventionally requires that the
-.Ar mountpoint
-be an empty directory, but the Linux implementation inconsistently
-enforces the requirement.
-.Pp
-The
-.Nm
-helper does not mount the contents of zvols.
-.
-.Sh FILES
-.Bl -tag -width "/etc/fstab"
-.It Pa /etc/fstab
-The static filesystem table.
-.It Pa /etc/mtab
-The mounted filesystem table.
-.El
-.
-.Sh AUTHORS
-The primary author of
-.Nm
-is Brian Behlendorf <behlendorf1@llnl.gov>.
-.Pp
-This man page was written by Darik Horn <dajhorn@vanadac.com>.
-.
 .Sh SEE ALSO
 .Xr fstab 5 ,
 .Xr mount 8 ,
-.Xr zfs 8
+.Xr zfs-mount 8
index a2f9afc19c8e79bfc25373dceee20bfa06565940..601c34cf86eba02b6fb984ba9e2660af5242dd36 100644 (file)
@@ -1947,6 +1947,11 @@ The correlation between properties and mount options is as follows:
     relatime                relatime/norelatime
     setuid                  suid/nosuid
     xattr                   xattr/noxattr
+    nbmand                  mand/nomand
+    context                 context=
+    fscontext               fscontext=
+    defcontext              defcontext=
+    rootcontext             rootcontext=
 .Ed
 .Pp
 In addition, these options can be set on a per-mount basis using the