ZFS: Set or create a filesystem quota

Contributor Icon Contributed by qmchenry Date Icon June 3, 2006  
Tag Icon Tagged: Solaris system administration

Quotas limit the amount of disk space a filesystem can use. The traditional model of filesystems has changed with ZFS because of the introduction of pools. Each pool (which can be made up of a disk slice, a whole disk, or several disks) can have a jaw-dropping big number of filesystems created in a hierarchial manner. This recipe describes the use of quotas with ZFS.


Filesystems within a ZFS pool are hierarchially arranged and the characteristics of a filesystem are carried on to filesystems created under them. This is important to keep in mind when working with qutoas and other ZFS characteristics.

Given a user home directory structure in the techrx pool:

techrx/home
techrx/home/davak
techrx/home/qmchenry
techrx/home/MickeyMouse

To limit the space available to all home directories to 100GB (so that the sum of all home directories must be less than this), use the command:

zfs set quota=100G techrx/home

The quota of a descendent filesystem (like techrx/home/qmchenry) can be additionally constrained. To set my home directory to be able to use no more than 10GB of disk space:

zfs set quota=10g techrx/home/qmchenry

Since davak is a sworn Windows guy, we can set his quota to 5MB (and we feel that’s being generous):

zfs set quota=5m techrx/home/davak

Since MickeyMouse has been writing some awesome recipes, we don’t want to limit his space. If his quota was previously set at 10GB, we can remove this quota with:

zfs set quota=none techrx/home/MickeyMouse

Note that the quota of the ancestor (techrx/home) still applies to MickeyMouse’s directory.

Previous recipe | Next recipe |
 
  • jflint0
    When you export /techrx/home using NFS the data inside the home directorys, techrx/home/davak, techrx/home/qmchenry, techrx/home/MickeyMouse, cannot be seen.
    I've been trying a solution for this a long long time. :\
blog comments powered by Disqus