zgenhostid: accept hostid arguments equal to zero.
[zfs.git] / man / man8 / zfs-jail.8
blob4c439d53f0d6dc779f16aecdb8e80d7512e52c00
1 .\"
2 .\" CDDL HEADER START
3 .\"
4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
7 .\"
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
12 .\"
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\"
22 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25 .\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
26 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
27 .\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
28 .\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
29 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
30 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
31 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
32 .\" Copyright (c) 2014 Integros [integros.com]
33 .\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
34 .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
35 .\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
36 .\" Copyright 2019 Richard Laager. All rights reserved.
37 .\" Copyright 2018 Nexenta Systems, Inc.
38 .\" Copyright 2019 Joyent, Inc.
39 .\"
40 .Dd December 9, 2019
41 .Dt ZFS-JAIL 8
42 .Os FreeBSD
43 .Sh NAME
44 .Nm zfs-jail
45 .Nd Attaches and detaches ZFS filesystems from FreeBSD jails.
46 .No A Tn ZFS
47 dataset can be attached to a jail by using the
48 .Qq Nm Cm jail
49 subcommand. You cannot attach a dataset to one jail and the children of the
50 same dataset to another jail. You can also not attach the root file system
51 of the jail or any dataset which needs to be mounted before the zfs rc script
52 is run inside the jail, as it would be attached unmounted until it is
53 mounted from the rc script inside the jail. To allow management of the
54 dataset from within a jail, the
55 .Sy jailed
56 property has to be set and the jail needs access to the
57 .Pa /dev/zfs
58 device. The
59 .Sy quota
60 property cannot be changed from within a jail. See
61 .Xr jail 8
62 for information on how to allow mounting
63 .Tn ZFS
64 datasets from within a jail.
65 .Pp
66 .No A Tn ZFS
67 dataset can be detached from a jail using the
68 .Qq Nm Cm unjail
69 subcommand.
70 .Pp
71 After a dataset is attached to a jail and the jailed property is set, a jailed
72 file system cannot be mounted outside the jail, since the jail administrator
73 might have set the mount point to an unacceptable value.
74 .Sh SYNOPSIS
75 .Nm zfs
76 .Cm jail
77 .Ar jailid Ns | Ns Ar jailname filesystem
78 .Nm zfs
79 .Cm unjail
80 .Ar jailid Ns | Ns Ar jailname filesystem
81 .Sh DESCRIPTION
82 .Bl -tag -width ""
83 .It Xo
84 .Nm zfs
85 .Cm jail
86 .Ar jailid filesystem
87 .Xc
88 .Pp
89 Attaches the specified
90 .Ar filesystem
91 to the jail identified by JID
92 .Ar jailid .
93 From now on this file system tree can be managed from within a jail if the
94 .Sy jailed
95 property has been set. To use this functuinality, the jail needs the
96 .Va allow.mount
97 and
98 .Va allow.mount.zfs
99 parameters set to 1 and the
100 .Va enforce_statfs
101 parameter set to a value lower than 2.
104 .Xr jail 8
105 for more information on managing jails and configuring the parameters above.
106 .It Xo
107 .Nm zfs
108 .Cm unjail
109 .Ar jailid filesystem
112 Detaches the specified
113 .Ar filesystem
114 from the jail identified by JID
115 .Ar jailid .
117 .Sh SEE ALSO
118 .Xr jail 8 ,
119 .Xr zfsprops 8