I have a ZFS file system with over 35TB of data with an unknown number of people who have added data. How can I get a report of each user's usage like output from zfs get userused@{uid} without knowing all the users that have data in the zfs file system?
ZFS report of all user’s usage
zfs
Related Topic
- ZFS on FreeBSD – Recovery from Data Corruption
- Identifying the number of changed bytes between two ZFS snapshots of the same file
- ZFS on top of iSCSI
- How does quota usage for ZFS on Linux work
- ‘zfs get all’ returns properties for file systems with ‘%’ (percent sign) appended
- Debian – ZFS filesystem with iSCSI
- Ubuntu – zfs wrong space usage
Best Answer
You can do it with
zfs userspace
(andzfs groupspace
), which shows all users that either have files inside a filesystem (meaning they are the current owner of the file) or a quota inside a filesystem (set byzfs set userquota
) or both. Note that it is not recursive (similar tozfs list
, so you might have to call it for each child filesystem.Example shell script
Example output
Manpage details with available options