ZFS-ZONE(8)

πŸ“¦
version 2.4.4 Β· 4 versions
, in alpine 3.23, alpine 3.24, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– 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:

  1. the zoned property has to be set βœ…
  2. the user namespace needs access to the /dev/zfs device βœ…
😭 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