Martin Matuska bb2d13b686 zfs: merge openzfs/zfs@59493b63c (master)
Notable upstream pull request merges:
  #13782 Fix setting the large_block feature after receiving a snapshot
  #14157 FreeBSD: stop using buffer cache-only routines on sync
  #14172 zed: post a udev change event from spa_vdev_attach()
  #14181 zed: unclean disk attachment faults the vdev
  #14190 Bump checksum error counter before reporting to ZED
  #14196 Remove atomics from zh_refcount
  #14197 Don't leak packed recieved proprties
  #14198 Switch dnode stats to wmsums
  #14199 Remove few pointer dereferences in dbuf_read()
  #14200 Micro-optimize zrl_remove()
  #14204 Lua: Fix bad bitshift in lua_strx2number()
  #14212 Zstd fixes
  #14218 Avoid a null pointer dereference in zfs_mount() on FreeBSD
  #14235 nopwrites on dmu_sync-ed blocks can result in a panic
  #14236 zio can deadlock during device removal
  #14247 Micro-optimize fletcher4 calculations
  #14261 FreeBSD: zfs_register_callbacks() must implement error check
         correctly

Obtained from:	OpenZFS
OpenZFS commit:	59493b63c18ea223857066218d6a58b67eb88159
2022-12-07 14:10:46 +01:00

125 lines
3.6 KiB
Groff

.\"
.\" CDDL HEADER START
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or https://opensource.org/licenses/CDDL-1.0.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" CDDL HEADER END
.\"
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
.\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
.\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
.\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
.\" Copyright (c) 2014 Integros [integros.com]
.\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright 2019 Richard Laager. All rights reserved.
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
.Dd May 27, 2021
.Dt ZFS-JAIL 8
.Os
.
.Sh NAME
.Nm zfs-jail
.Nd attach or detach ZFS filesystem from FreeBSD jail
.Sh SYNOPSIS
.Nm zfs Cm jail
.Ar jailid Ns | Ns Ar jailname
.Ar filesystem
.Nm zfs Cm unjail
.Ar jailid Ns | Ns Ar jailname
.Ar filesystem
.
.Sh DESCRIPTION
.Bl -tag -width ""
.It Xo
.Nm zfs
.Cm jail
.Ar jailid Ns | Ns Ar jailname
.Ar filesystem
.Xc
Attach the specified
.Ar filesystem
to the jail identified by JID
.Ar jailid
or name
.Ar jailname .
From now on this file system tree can be managed from within a jail if the
.Sy jailed
property has been set.
To use this functionality, the jail needs the
.Sy allow.mount
and
.Sy allow.mount.zfs
parameters set to
.Sy 1
and the
.Sy enforce_statfs
parameter set to a value lower than
.Sy 2 .
.Pp
You cannot attach a jailed dataset's children to another jail.
You can also not attach the root file system
of the jail or any dataset which needs to be mounted before the zfs rc script
is run inside the jail, as it would be attached unmounted until it is
mounted from the rc script inside the jail.
.Pp
To allow management of the dataset from within a jail, the
.Sy jailed
property has to be set and the jail needs access to the
.Pa /dev/zfs
device.
The
.Sy quota
property cannot be changed from within a jail.
.Pp
After a dataset is attached to a jail and the
.Sy jailed
property is set, a jailed file system cannot be mounted outside the jail,
since the jail administrator might have set the mount point to an unacceptable
value.
.Pp
See
.Xr jail 8
for more information on managing jails.
Jails are a
.Fx
feature and are not relevant on other platforms.
.It Xo
.Nm zfs
.Cm unjail
.Ar jailid Ns | Ns Ar jailname
.Ar filesystem
.Xc
Detaches the specified
.Ar filesystem
from the jail identified by JID
.Ar jailid
or name
.Ar jailname .
.El
.Sh SEE ALSO
.Xr zfsprops 7 ,
.Xr jail 8