ZFS: reserve space for filesystem

Home -> UNIX -> Solaris -> System administration

6416 views

From the computer of: qmchenry (337 recipes)
Created: Jun 05, 2006


Add a comment

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

Descendent (child) filesystems in ZFS take on the carachteristics of the parent filesystem (compression, quotas, and available disk space). The pool concept in ZFS is fitting - a hard drive (or several) becomes a pool. We no longer have to define the exact size of a filesystem when we create it. Each filesystem has access to the same pool of space. However, if is simple to reserve a minimum amount of space for a filesystem and its decendents.

Given the pool techrx and filesystems techrx/logs, techrx/logs/httpd, and techrx/mail, we may want to ensure that the httpd logs have at least 5GB of space available. Before making any changes, a zfs list command shows this output for these filesystems:

NAME                   USED  AVAIL  REFER  MOUNTPOINT
techrx/logs           77.5K  19.2G  28.5K  /techrx/logs
techrx/logs/httpd     24.5K  19.2G  24.5K  /techrx/logs/httpd
techrx/logs/mail      24.5K  19.2G  24.5K  /techrx/logs/mail


Note that the available space is the same for all filesystems. To reserve 5G of space for techrx/logs/httpd, the following command is used:

zfs set reservation=5g techrx/logs/httpd


The resulting output of the zfs list command shows some differences:

NAME                   USED  AVAIL  REFER  MOUNTPOINT
techrx/logs           5.00G  14.2G  28.5K  /techrx/logs
techrx/logs/httpd     24.5K  19.2G  24.5K  /techrx/logs/httpd
techrx/logs/mail      24.5K  14.2G  24.5K  /techrx/logs/mail


The used space in techrx/logs has increased to 5G and the available space for techrx/logs and techrx/logs/mail has decreased 5G to 14.2G. The available space for techrx/logs/httpd is still at 19.2G as it was before the reservation since that command sets only the minimum space available for the filesystem (and any filesystems created under it).

The command can be repeated to alter the reservation as needed, either up or down. To remove the reservation, use the command:

zfs set reservation=none techrx/logs/httpd

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: Create a new filesystem from an existing pool
  ZFS: Set or create a filesystem quota
  Solaris 10: Create multi-terabyte UFS filesystem
  ZFS: Create a raidz filesystem
  Solaris: Mount filesystem with UFS logging enabled
  ZFS: Grow or add more disk space to pool or filesystem
  ZFS: Create a snapshot of a filesystem
  Add swap space temporarily in Solaris
  ZFS: Create a basic filesystem or pool using zpool

 

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.