FreeKB - Linux Commands quotaon (enable quota)
Linux Commands - quotaon (enable quota)

This assumes you have installed quota using apt-get or yum.

yum install quota

 

Edit the /etc/fstab, adding usrquota and grpquota to the directories you want to apply quota to. In this example, user quota and group quota are applied to the /var directory.

/dev/mapper/centos-root   /var    ext4    defaults,usrquota,grpquota    1   2

 

You can either reboot the system for this change to take effect.

reboot

 

Or, you can unmount and then remount the filesystem for the quota to be activated on the filesystem.

umount /var
mount /dev/mapper/centos-root /var

 

Use the quotaon command to turn on quotas.

quotaon /var

 

Use the ls command to verify that quotas have been created. There should be two new files; aquota.user and aquota.group.

ls /var
. . .
aquota.user aquota.group

 

To verify the quota limit will function properly, switch to another user account, and attempt to create a new file.  

[john.doe@server1 ~]# su - jane.doe
[jane.doe@server1 ~]# echo "Hello World" > example.file
Error writing filename: Disk quota exceeded


Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 225e7 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |