TIL zfs-userspace(8)

There are 141 tips in the FreeBSD tips file that is displayed by fortune every time you log into a FreeBSD system.

root@geonosis:~ #  grep -E '^%' /usr/share/games/fortune/freebsd-tips | wc -l
     141

Most of the time, I know the tips very well. Sometime, however, I do learn a new thing.

Today I Learned that

To set a quota of 10 GB for the user named foo on a ZFS dataset, run the
following command:

# zfs set userquota@foo=10G pool/home/foo

The zfs userspace command can display the quota and current space usage:

# zfs userspace pool/home/foo

To unset a quota, assign "none" as the value.
                -- Benedict Reuschling <bcr@FreeBSD.org>

This is actually two tips in one. First, is the userquota in a filesystem, and the second one is how to see these quotas, which I had no idea about.

So I tried running it on one of my larger systems

root@geonosis:~ # zfs list  genomic/abi/proj/cfdna
NAME                     USED  AVAIL  REFER  MOUNTPOINT
genomic/abi/proj/cfdna  39.9T  7.10T  39.9T  /mnt/proj/cfdna
root@geonosis:~ # zfs userspace -S used genomic/abi/proj/cfdna
TYPE        NAME    USED  QUOTA  OBJUSED  OBJQUOTA
POSIX User  10039  22.1T   none    78.6K      none
POSIX User  10017  6.64T   none     102K      none
POSIX User  10048  6.35T   none     110K      none
POSIX User  10052  4.51T   none    7.11K      none
POSIX User  10011   326G   none    1.34K      none
POSIX User  10065  1.42G   none    14.7K      none
POSIX User  10012  51.3M   none    1.77K      none
POSIX User  10001   125K   none       13      none
POSIX User  10018  38.1K   none        3      none
POSIX User  10031  1.50K   none        3      none
POSIX User  root    512B   none        1      none

I don’t integrate our storage systems with LDAP, instead we just use the UIDs in permissions, but I can check who that is on another system.

antranigv@ssh-02:~$ id -nu 10039
anahit

Time to inform anahit that she has the record for most used storage in our largest project 🙂

That’s all folks…

Likes

Reposts

Leave a Reply

Your email address will not be published. Required fields are marked *