Skip to content

Commit

Permalink
mount.zfs.8: match to reality; zfsprops.8: add missing temporary options
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12111
  • Loading branch information
nabijaczleweli authored and behlendorf committed May 27, 2021
1 parent eae3598 commit 20bd864
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 77 deletions.
7 changes: 4 additions & 3 deletions cmd/mount_zfs/mount_zfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
102 changes: 28 additions & 74 deletions man/man8/mount.zfs.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'\" t
.\"
.\" CDDL HEADER START
.\"
Expand All @@ -19,7 +18,6 @@
.\"
.\" CDDL HEADER END
.\"
.\"
.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
.\"
.Dd May 24, 2021
Expand All @@ -37,68 +35,49 @@
.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
Expand All @@ -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
5 changes: 5 additions & 0 deletions man/man8/zfsprops.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20bd864

Please sign in to comment.