Adding disk quota’s to FreeBSD

Recompile your kernel with the following option:

options        QUOTA
(For help on recompiling your kernel see diffrent entry in this database)

Add the below entry to your /etc/rc.conf file:


Finally you will need to edit /etc/fstab to enable disk quotas on a per-file system basis. This is where you can either enable user or group quotas or both for all of your file systems.

To enable per-user quotas on a file system, add the userquota option to the options field in the /etc/fstab entry for the file system you want to to enable quotas on.

For example:
/dev/da1s2g   /home    ufs rw,userquota 1 2

Similarly, to enable group quotas, use the groupquota option instead of the userquota keyword. To enable both user and group quotas, change the entry as follows:

/dev/da1s2g    /home    ufs rw,userquota,groupquota 1 2

Reboot your machine

Check if it work with

$ quota -v

Edit your quota’s like so:

# edquota -u test

Quotas for user test:

/usr: blocks in use: 65, limits (soft = 50, hard = 75)
inodes in use: 7, limits (soft = 50, hard = 60)
/usr/var: blocks in use: 0, limits (soft = 50, hard = 75)
inodes in use: 0, limits (soft = 50, hard = 60)

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.