Fiber Hosting

Affordable Professional Dedicated and Co-Location Services

Documentation and Tutorials by Fiber-Hosting LLC

Created for the novice server administrator of unix and linux powered servers.

Posts Tagged ‘How to enable quota’

 

How to enable Quota

Thursday, February 7th, 2008
  • Configuration

Enable the following line in the kernel config

options QUOTA

You will need to enable disk quotas in /etc/rc.conf.

echo 'enable_quotas="YES" >> /etc/rc.conf

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

By default, the quota files are stored in the root directory of the file system with the names quota.user and quota.group for user and group quotas respectively. At this point you should reboot your system with your new kernel. /etc/rc will automatically run the appropriate commands to create the initial quota files for all of the quotas you enabled in /etc/fstab, so there is no need to manually create any zero length quota files.

Now ensure quotas are enabled

quota -v

You should see a one line summary of disk usage and current quota limits for each file system that quotas are enabled on.

The following is an example of what you might see when you run the edquota command. When the edquota command is invoked, you are placed into the editor specified by the EDITOR environment variable, or in the vi editor if the EDITOR variable is not set, to allow you to edit the quota limits.

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)

The new quota limits will be in place when you exit and save

We would like to thank bsdguides.org for part of this tutorial


Warning: include(/usr/home/admin/domains/fiber-hosting.com/public_html/includes/quotes.php) [function.include]: failed to open stream: No such file or directory in /home/fiber/public_html/docs/wp-content/themes/default/footer.php on line 3

Warning: include() [function.include]: Failed opening '/usr/home/admin/domains/fiber-hosting.com/public_html/includes/quotes.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fiber/public_html/docs/wp-content/themes/default/footer.php on line 3


Entries (RSS) and Comments (RSS).