Monday 18 November 2013

Linux Quota Management

Quota System allows an administrator to establish limits on the amount of disk resources user can consume.

The Quota is set in the /home partation. usrquota for user and grpquota for group.

If we want user quota first initialize quota in fstab

# vim /etc/fstab
/home /home ext3 defaults,usrquota 0 0
                         ,grpquota

# mount -o remount /home

# quotacheck -c /home  ------ which create a database file

             -cg /home                aquota.user in /home
            

# edquota -u username
          -g groupname


Start the assigned quota by

# quotaon /home
  quotaoff /home
 
block ----- used space by system
soft ----- get warning
hard ---- Max limit, quota exceeding size
inode ---- number of files


while giving soft and hard limits, add block size also with hard and soft, ie,if block size is 32, when you giving soft(100) and hard limit(200) it looks like 132 and 232

To checck quota first check as that user

# su - ctechz
Then create a file in his home dir with some limits exceeds

dd if=/dev/zero of=anyfileName bs=1024 count=5 (files generated which has that much size)

For checking the status of user quota

# repquota /home

To delete quota

# quotaoff /home
# vim /etc/fstab
/home /home ext3 defaults 0 0  ---- remove usrquota from here

# edquota -u ctechz
    and remove the Hard and Soft
   
# quotaoff /home

# mount -o remount /home

No comments:

Post a Comment