xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-jail.8 (revision bb2d13b686e3ccf6c3ccb36209dfb7dcc108b182)
1eda14cbcSMatt Macy.\"
2eda14cbcSMatt Macy.\" CDDL HEADER START
3eda14cbcSMatt Macy.\"
4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11eda14cbcSMatt Macy.\" and limitations under the License.
12eda14cbcSMatt Macy.\"
13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy.\"
19eda14cbcSMatt Macy.\" CDDL HEADER END
20eda14cbcSMatt Macy.\"
21eda14cbcSMatt Macy.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
22eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
23eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24eda14cbcSMatt Macy.\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
25eda14cbcSMatt Macy.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
26eda14cbcSMatt Macy.\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
27eda14cbcSMatt Macy.\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
28eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
29eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
30eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
31eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com]
32eda14cbcSMatt Macy.\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
33eda14cbcSMatt Macy.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
34eda14cbcSMatt Macy.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
35eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved.
36eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc.
37eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc.
38eda14cbcSMatt Macy.\"
3916038816SMartin Matuska.Dd May 27, 2021
40eda14cbcSMatt Macy.Dt ZFS-JAIL 8
4116038816SMartin Matuska.Os
4216038816SMartin Matuska.
43eda14cbcSMatt Macy.Sh NAME
447877fdebSMatt Macy.Nm zfs-jail
4516038816SMartin Matuska.Nd attach or detach ZFS filesystem from FreeBSD jail
46eda14cbcSMatt Macy.Sh SYNOPSIS
4716038816SMartin Matuska.Nm zfs Cm jail
4816038816SMartin Matuska.Ar jailid Ns | Ns Ar jailname
4916038816SMartin Matuska.Ar filesystem
5016038816SMartin Matuska.Nm zfs Cm unjail
5116038816SMartin Matuska.Ar jailid Ns | Ns Ar jailname
5216038816SMartin Matuska.Ar filesystem
5316038816SMartin Matuska.
54eda14cbcSMatt Macy.Sh DESCRIPTION
55eda14cbcSMatt Macy.Bl -tag -width ""
56eda14cbcSMatt Macy.It Xo
577877fdebSMatt Macy.Nm zfs
58eda14cbcSMatt Macy.Cm jail
5916038816SMartin Matuska.Ar jailid Ns | Ns Ar jailname
6016038816SMartin Matuska.Ar filesystem
61eda14cbcSMatt Macy.Xc
6216038816SMartin MatuskaAttach the specified
63eda14cbcSMatt Macy.Ar filesystem
64eda14cbcSMatt Macyto the jail identified by JID
6516038816SMartin Matuska.Ar jailid
6616038816SMartin Matuskaor name
6716038816SMartin Matuska.Ar jailname .
68eda14cbcSMatt MacyFrom now on this file system tree can be managed from within a jail if the
69eda14cbcSMatt Macy.Sy jailed
7016038816SMartin Matuskaproperty has been set.
7116038816SMartin MatuskaTo use this functionality, the jail needs the
7216038816SMartin Matuska.Sy allow.mount
73eda14cbcSMatt Macyand
7416038816SMartin Matuska.Sy allow.mount.zfs
7516038816SMartin Matuskaparameters set to
7616038816SMartin Matuska.Sy 1
7716038816SMartin Matuskaand the
7816038816SMartin Matuska.Sy enforce_statfs
7916038816SMartin Matuskaparameter set to a value lower than
8016038816SMartin Matuska.Sy 2 .
8116038816SMartin Matuska.Pp
8216038816SMartin MatuskaYou cannot attach a jailed dataset's children to another jail.
8316038816SMartin MatuskaYou can also not attach the root file system
8416038816SMartin Matuskaof the jail or any dataset which needs to be mounted before the zfs rc script
8516038816SMartin Matuskais run inside the jail, as it would be attached unmounted until it is
8616038816SMartin Matuskamounted from the rc script inside the jail.
8716038816SMartin Matuska.Pp
8816038816SMartin MatuskaTo allow management of the dataset from within a jail, the
8916038816SMartin Matuska.Sy jailed
9016038816SMartin Matuskaproperty has to be set and the jail needs access to the
9116038816SMartin Matuska.Pa /dev/zfs
9216038816SMartin Matuskadevice.
9316038816SMartin MatuskaThe
9416038816SMartin Matuska.Sy quota
9516038816SMartin Matuskaproperty cannot be changed from within a jail.
9616038816SMartin Matuska.Pp
9716038816SMartin MatuskaAfter a dataset is attached to a jail and the
9816038816SMartin Matuska.Sy jailed
9916038816SMartin Matuskaproperty is set, a jailed file system cannot be mounted outside the jail,
100*bb2d13b6SMartin Matuskasince the jail administrator might have set the mount point to an unacceptable
101*bb2d13b6SMartin Matuskavalue.
102eda14cbcSMatt Macy.Pp
103eda14cbcSMatt MacySee
104eda14cbcSMatt Macy.Xr jail 8
10516038816SMartin Matuskafor more information on managing jails.
10616038816SMartin MatuskaJails are a
10716038816SMartin Matuska.Fx
10816038816SMartin Matuskafeature and are not relevant on other platforms.
109eda14cbcSMatt Macy.It Xo
1107877fdebSMatt Macy.Nm zfs
111eda14cbcSMatt Macy.Cm unjail
11216038816SMartin Matuska.Ar jailid Ns | Ns Ar jailname
11316038816SMartin Matuska.Ar filesystem
114eda14cbcSMatt Macy.Xc
115eda14cbcSMatt MacyDetaches the specified
116eda14cbcSMatt Macy.Ar filesystem
117eda14cbcSMatt Macyfrom the jail identified by JID
11816038816SMartin Matuska.Ar jailid
11916038816SMartin Matuskaor name
12016038816SMartin Matuska.Ar jailname .
121eda14cbcSMatt Macy.El
122eda14cbcSMatt Macy.Sh SEE ALSO
1233ff01b23SMartin Matuska.Xr zfsprops 7 ,
1243ff01b23SMartin Matuska.Xr jail 8
125