ZFS-ZONE(8)
π ZFS-ZONE π
okay bestie, so this is zfs-zone from the System Manager's Manual β it's a zfs subcommand situation, and honestly? it's giving β¨delegationβ¨. sit down, grab a strawberry, let's talk about attaching and detaching ZFS filesystems to user namespaces π¦
πΈ NAME πΈ
zfs-zone, zfs-unzone β attach and detach ZFS filesystems to user namespaces π
β¨ SYNOPSIS β¨
zfs zone nsfile filesystem
zfs unzone nsfile filesystem
like. that's it. two little lines. iconic.
π DESCRIPTION π
π zfs zone nsfile filesystem
Attach the filesystem you named to the user namespace that nsfile is pointing at. from now on, that filesystem tree can be managed from inside a user namespace β but only if the zoned property has been set. no zoned, no vibes.
π¨ okay so here's the part where you need to actually pay attention, bestie: - You cannot attach a zoned dataset's children to another user namespace. like, that's just not a thing that happens. - You also cannot attach the root file system of the user namespace, or any dataset which needs to be mounted before the zfs service is run inside the user namespace. why? because it would be attached unmounted until it gets mounted from the service inside the user namespace. it's giving "waiting in the group chat for someone to show up" π
To allow management of the dataset from within a user namespace, two things need to be true:
- the
zonedproperty has to be set β - the user namespace needs access to the
/dev/zfsdevice β
π and heads up β the quota property cannot be changed from within a user namespace. periodt.
And one more thing, because apparently this command loves plot twists: after a dataset is attached to a user namespace and the zoned property is set, a zoned file system cannot be mounted outside the user namespace. the reason is lowkey valid though β the user namespace administrator might have set the mount point to an unacceptable value. so yeah. that door closes. πͺ
π¦ zfs unzone nsfile filesystem
Detach the specified filesystem from the user namespace identified by nsfile. that's the whole thing. it's the breakup arc. clean, simple, no notes π
π EXAMPLES π
Example 1: Delegating a Dataset to a User Namespace
so the following example delegates the tank/users dataset to a user namespace identified by user namespace file /proc/1234/ns/user. watch:
# zfs zone /proc/1234/ns/user tank/users
slay. that's it. that's the delegation. π«Ά
β SEE ALSO β
and that's the whole page, bestie!! no cap, you now know more about user namespace zoning than 99% of the group chat π
this was brought to you by OpenZFS, dated July 11, 2022 β go forth and zone responsibly πβ¨
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- 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>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms