xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-zone.8 (revision 271171e0d97b88ba2a7c3bf750c9672b484c1c13)
11f1e2261SMartin Matuska.\"
21f1e2261SMartin Matuska.\" CDDL HEADER START
31f1e2261SMartin Matuska.\"
41f1e2261SMartin Matuska.\" The contents of this file are subject to the terms of the
51f1e2261SMartin Matuska.\" Common Development and Distribution License (the "License").
61f1e2261SMartin Matuska.\" You may not use this file except in compliance with the License.
71f1e2261SMartin Matuska.\"
81f1e2261SMartin Matuska.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
101f1e2261SMartin Matuska.\" See the License for the specific language governing permissions
111f1e2261SMartin Matuska.\" and limitations under the License.
121f1e2261SMartin Matuska.\"
131f1e2261SMartin Matuska.\" When distributing Covered Code, include this CDDL HEADER in each
141f1e2261SMartin Matuska.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151f1e2261SMartin Matuska.\" If applicable, add the following below this CDDL HEADER, with the
161f1e2261SMartin Matuska.\" fields enclosed by brackets "[]" replaced with your own identifying
171f1e2261SMartin Matuska.\" information: Portions Copyright [yyyy] [name of copyright owner]
181f1e2261SMartin Matuska.\"
191f1e2261SMartin Matuska.\" CDDL HEADER END
201f1e2261SMartin Matuska.\"
211f1e2261SMartin Matuska.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
221f1e2261SMartin Matuska.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
231f1e2261SMartin Matuska.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
241f1e2261SMartin Matuska.\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
251f1e2261SMartin Matuska.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
261f1e2261SMartin Matuska.\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
271f1e2261SMartin Matuska.\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
281f1e2261SMartin Matuska.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
291f1e2261SMartin Matuska.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
301f1e2261SMartin Matuska.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
311f1e2261SMartin Matuska.\" Copyright (c) 2014 Integros [integros.com]
321f1e2261SMartin Matuska.\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
331f1e2261SMartin Matuska.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
341f1e2261SMartin Matuska.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
351f1e2261SMartin Matuska.\" Copyright 2019 Richard Laager. All rights reserved.
361f1e2261SMartin Matuska.\" Copyright 2018 Nexenta Systems, Inc.
371f1e2261SMartin Matuska.\" Copyright 2019 Joyent, Inc.
381f1e2261SMartin Matuska.\" Copyright 2021 Klara, Inc.
391f1e2261SMartin Matuska.\"
401f1e2261SMartin Matuska.Dd June 3, 2022
411f1e2261SMartin Matuska.Dt ZFS-ZONE 8
421f1e2261SMartin Matuska.Os
431f1e2261SMartin Matuska.
441f1e2261SMartin Matuska.Sh NAME
451f1e2261SMartin Matuska.Nm zfs-zone ,
461f1e2261SMartin Matuska.Nm zfs-unzone
471f1e2261SMartin Matuska.Nd attach and detach ZFS filesystems to user namespaces
481f1e2261SMartin Matuska.Sh SYNOPSIS
491f1e2261SMartin Matuska.Nm zfs Cm zone
501f1e2261SMartin Matuska.Ar nsfile
511f1e2261SMartin Matuska.Ar filesystem
521f1e2261SMartin Matuska.Nm zfs Cm unzone
531f1e2261SMartin Matuska.Ar nsfile
541f1e2261SMartin Matuska.Ar filesystem
551f1e2261SMartin Matuska.
561f1e2261SMartin Matuska.Sh DESCRIPTION
571f1e2261SMartin Matuska.Bl -tag -width ""
581f1e2261SMartin Matuska.It Xo
591f1e2261SMartin Matuska.Nm zfs
601f1e2261SMartin Matuska.Cm zone
611f1e2261SMartin Matuska.Ar nsfile
621f1e2261SMartin Matuska.Ar filesystem
631f1e2261SMartin Matuska.Xc
641f1e2261SMartin MatuskaAttach the specified
651f1e2261SMartin Matuska.Ar filesystem
661f1e2261SMartin Matuskato the user namespace identified by
671f1e2261SMartin Matuska.Ar nsfile .
681f1e2261SMartin MatuskaFrom now on this file system tree can be managed from within a user namespace
691f1e2261SMartin Matuskaif the
701f1e2261SMartin Matuska.Sy zoned
711f1e2261SMartin Matuskaproperty has been set.
721f1e2261SMartin Matuska.Pp
731f1e2261SMartin MatuskaYou cannot attach a zoned dataset's children to another user namespace.
741f1e2261SMartin MatuskaYou can also not attach the root file system
751f1e2261SMartin Matuskaof the user namespace or any dataset
761f1e2261SMartin Matuskawhich needs to be mounted before the zfs service
771f1e2261SMartin Matuskais run inside the user namespace,
781f1e2261SMartin Matuskaas it would be attached unmounted until it is
791f1e2261SMartin Matuskamounted from the service inside the user namespace.
801f1e2261SMartin Matuska.Pp
811f1e2261SMartin MatuskaTo allow management of the dataset from within a user namespace, the
821f1e2261SMartin Matuska.Sy zoned
831f1e2261SMartin Matuskaproperty has to be set and the user namespaces needs access to the
841f1e2261SMartin Matuska.Pa /dev/zfs
851f1e2261SMartin Matuskadevice.
861f1e2261SMartin MatuskaThe
871f1e2261SMartin Matuska.Sy quota
881f1e2261SMartin Matuskaproperty cannot be changed from within a user namespace.
891f1e2261SMartin Matuska.Pp
901f1e2261SMartin MatuskaAfter a dataset is attached to a user namespace and the
911f1e2261SMartin Matuska.Sy zoned
921f1e2261SMartin Matuskaproperty is set,
931f1e2261SMartin Matuskaa zoned file system cannot be mounted outside the user namespace,
941f1e2261SMartin Matuskasince the user namespace administrator might have set the mount point
951f1e2261SMartin Matuskato an unacceptable value.
961f1e2261SMartin Matuska.It Xo
971f1e2261SMartin Matuska.Nm zfs
981f1e2261SMartin Matuska.Cm unzone
991f1e2261SMartin Matuska.Ar nsfile
1001f1e2261SMartin Matuska.Ar filesystem
1011f1e2261SMartin Matuska.Xc
1021f1e2261SMartin MatuskaDetach the specified
1031f1e2261SMartin Matuska.Ar filesystem
1041f1e2261SMartin Matuskafrom the user namespace identified by
1051f1e2261SMartin Matuska.Ar nsfile .
1061f1e2261SMartin Matuska.El
1071f1e2261SMartin Matuska.Sh EXAMPLES
1081f1e2261SMartin Matuska.Ss Example 1 : No Delegating a Dataset to a User Namespace
1091f1e2261SMartin MatuskaThe following example delegates the
1101f1e2261SMartin Matuska.Ar tank/users
1111f1e2261SMartin Matuskadataset to a user namespace identified by user namespace file
1121f1e2261SMartin Matuska.Pa /proc/1234/ns/user .
1131f1e2261SMartin Matuska.Dl # Nm zfs Cm zone Ar /proc/1234/ns/user Ar tank/users
1141f1e2261SMartin Matuska.
1151f1e2261SMartin Matuska.Sh SEE ALSO
1161f1e2261SMartin Matuska.Xr zfsprops 7
117