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

Rewrite mount.zfs(8) and touch up zfsprops(8) WRT nbmand and temp options #12111

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
182 changes: 65 additions & 117 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,126 +18,75 @@
.\"
.\" CDDL HEADER END
.\"
.\"
.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
.\"
.TH MOUNT.ZFS 8 "Aug 24, 2020" OpenZFS

.SH NAME
mount.zfs \- mount a ZFS filesystem
.SH SYNOPSIS
.LP
.BI "mount.zfs [\-sfnvh] [\-o " options "]" " dataset mountpoint

.SH DESCRIPTION
.BR mount.zfs
is part of the zfsutils package for Linux. It is a helper program that
is usually invoked by the
.BR mount (8)
or
.BR zfs (8)
commands to mount a ZFS dataset.

All
.I options
are handled according to the FILESYSTEM INDEPENDENT MOUNT OPTIONS
section in the
.BR mount (8)
manual, except for those described below.

The
.I dataset
parameter is a ZFS filesystem name, as output by the
.B "zfs list -H -o name
command. This parameter never has a leading slash character and is
not a device name.

.Dd May 24, 2021
.Dt MOUNT.ZFS 8
.Os
.
.Sh NAME
.Nm mount.zfs
.Nd mount a ZFS filesystem
.Sh SYNOPSIS
.Nm
.Op Fl sfnvh
.Op Fl o Ar options
.Ar dataset
.Ar mountpoint
.
.Sh DESCRIPTION
The
.I mountpoint
parameter is the path name of a directory.


.SH OPTIONS
.TP
.BI "\-s"
Ignore bad or sloppy mount options.
.TP
.BI "\-f"
Do a fake mount; do not perform the mount operation.
.TP
.BI "\-n"
Do not update the /etc/mtab file.
.TP
.BI "\-v"
Increase verbosity.
.TP
.BI "\-h"
.Nm
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
in most cases.
.Pp
.Ar options
are handled according to the
.Em Temporary Mount Point Properties
section in
.Xr zfsprops 8 ,
except for those described below.
.Pp
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 unknown (sloppy) mount options.
.It Fl f
Do everything except actually executing the system call.
.It Fl n
Never update
.Pa /etc/mtab .
.It Fl v
Print resolved mount options and parser state.
.It Fl h
Print the usage message.
.TP
.BI "\-o context"
This flag sets the SELinux context for all files in the filesystem
under that mountpoint.
.TP
.BI "\-o fscontext"
This flag sets the SELinux context for the filesystem being mounted.
.TP
.BI "\-o defcontext"
This flag sets the SELinux context for unlabeled files.
.TP
.BI "\-o rootcontext"
This flag sets the SELinux context for the root inode of the filesystem.
.TP
.BI "\-o legacy"
This private flag indicates that the
.I dataset
has an entry in the /etc/fstab file.
.TP
.BI "\-o noxattr"
This private flag disables extended attributes.
.TP
.BI "\-o xattr
This private flag enables directory-based extended attributes and, if
appropriate, adds a ZFS context to the selinux system policy.
.TP
.BI "\-o saxattr
This private flag enables system attributed-based extended attributes and, if
appropriate, adds a ZFS context to the selinux system policy.
.TP
.BI "\-o dirxattr
Equivalent to
.BR xattr .
.TP
.BI "\-o zfsutil"
.It Fl o Ar zfsutil
This private flag indicates that
.BR mount (8)
.Xr mount 8
is being called by the
.BR zfs (8)
.Xr zfs 8
command.

.SH NOTES
ZFS conventionally requires that the
.I mountpoint
be an empty directory, but the Linux implementation inconsistently
enforces the requirement.

The
.BR mount.zfs
helper does not mount the contents of zvols.

.SH FILES
.TP 18n
.I /etc/fstab
The static filesystem table.
.TP
.I /etc/mtab
The mounted filesystem table.
.SH "AUTHORS"
The primary author of
.BR mount.zfs
is Brian Behlendorf <behlendorf1@llnl.gov>.

This man page was written by Darik Horn <dajhorn@vanadac.com>.
.SH "SEE ALSO"
.BR fstab (5),
.BR mount (8),
.BR zfs (8)
.El
.
.Sh SEE ALSO
.Xr fstab 5 ,
.Xr mount 8 ,
.Xr zfs-mount 8
16 changes: 8 additions & 8 deletions man/man8/zfsprops.8
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
.\" Copyright 2019 Joyent, Inc.
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing
.\"
.Dd May 5, 2021
.Dd May 24, 2021
.Dt ZFSPROPS 8
.Os
.Sh NAME
Expand Down Expand Up @@ -1212,15 +1212,10 @@ location.
.It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
Controls whether the file system should be mounted with
.Sy nbmand
.Pq Non Blocking mandatory locks .
.Pq Non-blocking mandatory locks .
This is used for SMB clients.
Changes to this property only take effect when the file system is umounted and
remounted.
See
.Xr mount 8
for more information on
.Sy nbmand
mounts. This property is not used on Linux.
remounted. Support for these locks is scarce and not described by POSIX.
.It Sy overlay Ns = Ns Sy on Ns | Ns Sy off
Allow mounting on a busy directory or a directory which already contains
files or directories.
Expand Down Expand Up @@ -1952,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