ZFS: Set or create a filesystem quota

Home -> UNIX -> Solaris -> System administration

11214 views

From the computer of: qmchenry (338 recipes)
Created: Jun 03, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  ZFS: Create a writable clone of a filesystem
  ZFS: List or view filesystems
  ZFS: Create a new filesystem from an existing pool
  ZFS: Grow or add more disk space to pool or filesystem
  ZFS: Create a basic filesystem or pool using zpool
  ZFS: Set or change the mount point of a filesystem
  Solaris 10: Create multi-terabyte UFS filesystem
  Solaris: Mount filesystem with UFS logging enabled
  Solaris: unmounting a filesystem with umount
  ZFS: Create a mirrored storage pool

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.