Tutorial

How To Enable User Quotas

Published on February 11, 2013
How To Enable User Quotas

Status: Deprecated

This article is deprecated and no longer maintained.

Reason:

The information in this article is out of date and untested. More recent information about quotas is listed below.

See Instead:

How To Set Filesystem Quotas on Ubuntu 18.04 or Debian 9.

Quotas can be used on servers to set limits on how much diskspace an individual server user can take up on a server. They can be edited in the /etc/fstab file.

In order to enable quotas, first open the /etc/fstab file:

nano /etc/fstab

Within that file, edit the following line, adding in the word, “usrquota”:

LABEL=DOROOT	   /               ext4    errors=remount-ro,usrquota 0       1

Save and exit

The /etc/fstab file should now look like this:

LABEL=DOROOT       /               ext4    errors=remount-ro,usrquota 0       1
none             /dev/shm      tmpfs   defaults                    0 0

To finish up, remount the file system whose fstab entry has ben changed:

 mount -o remount /
By Etel Sverdlov

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us


About the authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
8 Comments


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Hi. I followed the guide here but I get this message. Is this cause for concern? I used it on a Centos7 machine.

quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Quota for users is enabled on mountpoint / so quotacheck might damage the file. Please turn quotas off or use -f to force checking.

My original fstab:

LABEL=DOROOT / ext4 defaults 1 1

Which I edited to

LABEL=DOROOT / ext4 errors=remount-ro,usrquota 0 1

Thanks in advance for the help.

You should run first the command: quotacheck -vagum -F vfsv0 this will create the quota files and then you can follow the following tutorial: http://serverfault.com/questions/37737/quotas-in-vsftpd

Any luck experts!

Any luck guys

For me

Output for fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes 16 heads, 63 sectors/track, 41610 cylinders, total 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

Disk /dev/vda doesn’t contain a valid partition table

Output for df -ah

Filesystem Size Used Avail Use% Mounted on /dev/vda 20G 1.8G 18G 10% / proc 0 0 0 - /proc sysfs 0 0 0 - /sys none 0 0 0 - /sys/fs/fuse/connections none 0 0 0 - /sys/kernel/debug none 0 0 0 - /sys/kernel/security udev 246M 4.0K 246M 1% /dev devpts 0 0 0 - /dev/pts tmpfs 100M 212K 99M 1% /run none 5.0M 0 5.0M 0% /run/lock none 248M 0 248M 0% /run/shm

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
October 12, 2013

@paul.cherepnin: What’s the output of <code>sudo fdisk -l</code> and <code>df -ah</code>?

Hi,

I’ve got the same problem…

Hi, I have followed he tutorial but I am facing issues. The following message comes if I run the command:

sudo quotacheck -vguma

quotacheck: Cannot guess format from filename on /dev/disk/by-label/DOROOT. Please specify format on commandline. quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

My fstab is here:

LABEL=DOROOT / ext3 defaults,errors=remount-ro,usrquota,grpquota,barrier=0 1 1 none /dev/shm tmpfs defaults 0 0 /swapfile none swap sw 0 0

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel