Set solaris quotas with nfs

Solaris 10 has many useful filesystem attributes in zfs that can allow you to share data via the network as well as control it in a very detailed fashion. Two of these file system attributes in solaris zfs are the quotas and sharing via nfs. It is a common practice to export a zfs share via nfs and assign a quota to it so that users don’t exceed their allocation. To export a share via nfs use the following:

zfs set sharenfs='on,anon=0' pool/share

This will set sharenfs to on, which will give rw privileges to the share. The parameter “anon=0” will set any anonymous uid’s to be root. This is helpful when dealing with multi operating system environment.

Now that the solaris zfs share is exported via nfs, it is now time to assign a quota. To do this use

root@computer:/etc# zfs set quota=100M pool/share
root@computer:/etc# df -h
Filesystem            Size  Used Avail Use% Mounted on
rpool/ROOT/solaris    6.8G  3.3G  3.5G  49% /
swap                  433M  372K  433M   1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
                      6.8G  3.3G  3.5G  49% /lib/libc.so.1
swap                  433M  4.0K  433M   1% /tmp
swap                  433M   48K  433M   1% /var/run
rpool/export          3.5G   32K  3.5G   1% /export
rpool/export/home     3.5G   32K  3.5G   1% /export/home
rpool/export/home/computer
                      3.5G   34K  3.5G   1% /export/home/computer
rpool                 3.5G   93K  3.5G   1% /rpool
/export/home/computer
                      3.5G   34K  3.5G   1% /home/computer
pool                  357M   42K  357M   1% /pool
pool/share            100M   40K  100M   1% /pool/share

As you can see the size of pool/share is now set to 100M, 100 Megabytes. You can use Gigabytes or Terabytes, or more.

Solaris 10 and zfs offers great flexibility with nfs and quota that can help data management easier.

Be the first to comment

Leave a Reply