ZFS-USERSPACE(8)

🌸 ZFS-USERSPACE(8) 🌸

okay bestie, welcome to the system manager's manual section, we're talking zfs-userspace today and it's honestly so useful it's giving main character energy πŸ’…


✨ NAME ✨

zfs-userspace β€” display space and quotas of ZFS dataset 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

zfs userspace [-Hinp] [-o field[,field]…] [-s field]… [-S field]… [-t
    type[,type]…] filesystem|snapshot|path
zfs groupspace [-Hinp] [-o field[,field]…] [-s field]… [-S field]… [-t
    type[,type]…] filesystem|snapshot|path
zfs projectspace [-Hp] [-o field[,field]…] [-s field]… [-S field]…
    filesystem|snapshot|path

like… three whole subcommands, each one a lil icon, no cap ✨


πŸ’– DESCRIPTION πŸ’–

🌈 zfs userspace

zfs userspace [-Hinp] [-o field[,field]…] [-s field]… [-S field]… [-t
  type[,type]…] filesystem|snapshot|path

this one shows you the space each user is eating up, plus their quotas, inside whatever filesystem, snapshot, or path you hand it. and if you give it a path? it's smart enough to figure out which filesystem contains that path and use that one. obsessed.

this maps to the userused@user, userobjused@user, userquota@user, and userobjquota@user properties πŸŽ€

  • -H β€” don't print headers, bestie, just give me tab-delimited output.
  • -S field β€” sort by this field but in reverse. peek at -s for the details.
  • -i β€” translate SID to POSIX ID. heads up though: the POSIX ID might be ephemeral if there's no mapping for it. normal POSIX stuff (like stat(2) and ls -l) does this translation too, so -i lets you line up zfs userspace output right next to those utilities, which is so handy. but β€” and this is the messy part β€” -i can get confusing if some files were made by an SMB user before an SMB-to-POSIX name mapping existed. in that case some files end up owned by the SMB entity and some by the POSIX entity, and -i will just report that the POSIX entity has the total usage and quota for both of them. 😭 yeah. it do be like that.
  • -n β€” print the numeric ID instead of the user/group name.
  • -o field[,field]… β€” only show the fields you pick from this set: type, name, used, quota. default is all of them, because more is more πŸ’…
  • -p β€” exact (parsable) numeric output. for when you're piping things, iykyk.
  • -s field β€” sort the output by this field. and yes, -s and -S can be given multiple times, so you sort by one field first, then by another, like the layered queen you are. the default is -s type -s name.
  • -t type[,type]… β€” only print the types you name from this set: all, posixuser, smbuser, posixgroup, smbgroup. the default is -t posixuser,smbuser, and that default can be changed to include group types.

🌸 zfs groupspace

zfs groupspace [-Hinp] [-o field[,field]…] [-s field]… [-S field]… [-t
  type[,type]…] filesystem|snapshot

same energy, different crowd: this shows the space consumed by, and quotas on, each group in the filesystem or snapshot you point at. it's literally identical to userspace except the default types it displays are -t posixgroup,smbgroup. that's it, that's the diff πŸ’œ

πŸŽ€ zfs projectspace

zfs projectspace [-Hp] [-o field[,field]…] [-s field]… [-S field]…
  filesystem|snapshot|path

and this one does the space-and-quotas thing for each project in the given filesystem or snapshot. again identical to userspace, except the project identifier is a numeral, not a name. so you don't need -i for SID to POSIX ID, you don't need -n for numeric ID, and you don't need -t for types. none of them. not invited. πŸ™ˆ (also notice there's no -i or -n in the synopsis up there β€” that's not me being lazy, that's just facts ✨)

heads up for real: with -i, the POSIX ID you see may be ephemeral if no mapping exists, and mixed SMB/POSIX ownership makes the reported total usage and quota belong to the POSIX entity for both. read that bit twice, bestie. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, periodt 🌈 go forth and check your quotas, you gorgeous data-wrangling legend πŸ§šπŸ’–

this lil manual page came from OpenZFS and is dated July 11, 2022 β€” stay slay, stay snapshot-safe, mwah πŸ’…

πŸ“¦ where this page comes from