Fixing Quotas

If you encounter a system quota issue, please review the following steps to ensure proper configuration.

To begin, log into your system as the root user. You will need to check a few locations to see whether or not quotas are enabled on certain devices used by your system. Make sure to add quotas for any device that holds cPanel accounts.

Issue the mount command

You can use the mount command to obtain some basic information about currently mounted file systems. When this command is issued without any arguments, the system will print information concerning all of its mounted file systems.

The printed information will include whether or not quotas are enabled for mounted file systems.


Linux [+] [-]
root@host [~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/usr/tmpDSK on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

On a Linux system, any entry containing usrquota is quota-enabled.

The example above shows that the device known as /dev/mapper/VolGroup00-LogVol00 on uses quotas.


FreeBSD [+] [-]
docfbsd1# mount
/dev/ad0s1a on / (ufs, local, with quotas)
devfs on /dev (devfs, local)
/dev/ad0s1e on /tmp (ufs, local, soft-updates)
/dev/ad0s1f on /usr (ufs, local, soft-updates)
/dev/ad0s1d on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)

On a FreeBSD system, any entry containing with quotas is quote-enabled.

The example above shows that the device known as /dev/ad0s1a uses quotas.

To learn more about the mount command, please visit the mount man page.

Examine /etc/fstab

You can examine the contents of /etc/fstab. fstab (file systems table) is a system configuration file that maps devices to their respective mount points within a system. This description is accurate for both Linux and FreeBSD systems.

To display the contents of /etc/fstab, use the cat command:

cat /etc/fstab

This command will print the file output in the command line interface.


Linux [+] [-]
linux-quotas.png

On a Linux system, if usrquota is printed next to a particular entry in the fstab file, quotas are enabled for that particular device.

The example above shows that the device known as /dev/VolGroup00/LogVol00 uses quotas.


FreeBSD [+] [-]

freebsd-quotas.png

On a FreeBSD system, if userquotas is printed next to a particular entry in the fstab file, quotas are enabled for that particular device.

The example above shows that the device known as /dev/ab0s1b uses quotas.

How do I read the fstab file?

The fstab system configuration file is divided into 6 columns, as shown in the FreeBSD system example.

Each of these columns represents a configuration option that determines the purpose of each file system associated with your server and how it should mount.

Column Description
Device The physical device on which data is stored.
Mountpoint The path to the device's data storage location. The mount point is a physical location in the partition that functions as the root of the filesystem.
FStype The type of file system that is mounted. On Linux systems, ext3 is most often visible. On FreeBSD systems, ufs is most commonly seen.
Options The options with which the file system is mounted. These options include whether or not quotas are enabled and whether or not programs can be executed on the device. For the purpose of fixing quotas, this column is the most important. You should examine this column to ensure that quotas are enabled for the device with which you are working.
Dump

The dump option — dump is a backup utility used by *nix systems. For this article's purposes, this value is not important.

Pass

The fsck option — fsck is a file checking utility used by *nix systems. For this article's purposes, this value is not important.

To learn more about fstab, please visit the fstab man page.

How do I enable quotas?

Specify quotas in /etc/fstab

If you don't see quotas enabled in /etc/fstab, you can add the appropriate string to the options column.

  • On a Linux system, add usrquota.
  • On a FreeBSD system, add userquota.

You can edit /etc/fstab using your preferred text editor. You must only use spaces and tabs to create blank spaces between entries.

After making any changes to the fstab file, you should remount the file system using the following command:

mount -o remount mount point

In this command, mount point represents the mount point for the file system you wish to remount. The -o argument allows you to pass the mount utility an option. Here, the remount option is passed, causing the mount utility to immediately remount the file system.

Check quota files in /

After entering the appropriate lines into /etc/fstab, confirm that the quota files are located in the root directory ( /) and that each file is greater than 0 bytes. To proceed, you can use the ls command with a wildcard.

Linux:
root@host [/]# ls -l /*.user
-rwxr--r-- 1 root root 13312 Apr 26 16:39 /aquota.user*
-rwxr--r-- 1 root root    32 Apr 19 16:26 /quota.user*

FreeBSD:

root@host [/]# ls -l /*.user
-rwxr--r-- 1 root wheel 13312 Apr 26 16:39 /aquota.user*
-rwxr--r-- 1 root wheel   32 Apr 19 16:26 /quota.user*

The above example uses ls to list the contents of the root directory ( /). The -l flag gives ls' output in long listing format. This long listing format shows the file's permissions, which user owns the file, which group owns the file, the size of the file in bytes, and the date the file was last modified.

If these files do not exist, you can use the /scripts/initquotas utility to create them.

If these files exist and the size of each file is greater than 0 bytes, you can move on to the following step.

Ensure quotas are reporting on the system

After completing all of the steps above, you should have successfully enabled quotas on the system. You can use the following command to confirm:

repquota -a

This command, when paired with the -a argument, will print all of the file systems listed in /etc/mtab with read/write and quota options enabled.

What steps do I take if my quotas are still not functioning?

If you are still experiencing problems, examine /var/cpanel/cpanel.config to ensure that the disablequotacache parameter is set to 0. You can use the following command to do so:

grep 'disablequotacache' /var/cpanel/cpanel.config

The grep utility allows you to search for a string. In the command above, grep is used to search for diablequotacache in the /var/cpanel/cpanel.config file.

To learn more about the grep utility, please visit the die.net's grep manual page.

root@host [~]# grep 'disablequotacache' /var/cpanel/cpanel.config
disablequotacache=0

If the disablequotacache parameter is set to 1, open the cpanel.config file with your preferred text editor and change the value to 0. Don't forget to save the file.

If you are still experiencing problems with quotas, you can always use our ticket system to submit a ticket.

A note about Virtuozzo®

If you are using Virtuozzo, you will need to enable second-level (per-user) quotas in addition to first-level (per-container) quotas. You must enable second-level quotas from the parent node. For more information, visit our Virtuozzo quotas documentation.

Topic revision: r15 - 25 Jan 2013 - 16:44:31 - Main.LaurenceSimon
AllDocumentation/WHMDocs.HowToFixQuotas moved from Sandbox.HowToFixQuotas on 26 May 2011 - 18:59 by Main.JustinSchaefer - put it back