Quota Installation

Quota of Linux is designed per user in one partition.
(Recommend: enable in ext3 partition)

Step 1

[root@local~]# yum install quota

Install quota rpm via yum.

Step 2

[root@local~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 22G 5.9G 15G 29% / tmpfs 128M 0 128M 0% /dev/shm /dev/sda3 48G 5.0G 41G 12% /home

Quota function limited to the whole partition only.
Example: We set the quota to /home , so we know it is /dev/sda3

[root@local~]# vi /etc/fstab LABEL=/1 / ext3 defaults 1 1 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs rw,size=128M 0 0 LABEL=/home1 /home ext3 defaults,usrquota,grpquota 1 2

In /etc/fstab, append 'usrquota,grpquota' to the line which partition is limited with quota

[root@local~]# mount -a


[root@local~]# mount -o remount /home

Remount /etc/fstab or reboot to enable the quota in filesystem

[root@local~]# touch /home/aquota.user
[root@local~]# touch /home/aquota.group

Create the quota bin file.

[root@local~]# /sbin/quotacheck -m -f /home


[root@local~]# quotacheck -vug /home

Quota check for the first time (require)

[root@local~]# quotaon -vug /home

Turn on the quota function on partition.

Step 3

[root@local~]# edquota -u alan Disk quotas for user alan (uid 501) Filesystem¡@¡@¡@blocks¡@¡@¡@soft¡@¡@¡@¡@hard¡@¡@¡@inodes¡@¡@¡@soft¡@¡@¡@hard /dev/sda3¡@¡@¡@¡@224¡@¡@¡@800000¡@¡@1024000¡@¡@¡@6¡@¡@¡@¡@ 0¡@¡@¡@¡@ 0 or setquota -u alan 800000 1024000 0 0 /home

We set the quota soft limit 800M, hard limit 1G to user alan
(First one is vi mode)

[root@local~]# repquota -u /home

View the quota status

Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.