Thursday, August 27, 2009

Quota Check in Linux

The idea behind the Quota check is that the users are forced to stay under the disk consumption limit taking away their ability to consume unlimited disk space on a system.

Step 1) vi /etc/fstab

Partitions that you have not yet enabled quota normally look something like:

/dev/hda1 / ext2 defaults 1 1
/dev/hda2 /home ext2 defaults 1 1

To enable user quota support on a file system, add "usrquota" to the fourth field containing the word

/dev/hda1 / ext2 defaults 1 1
/dev/hda2 /home ext2 defaults,usrquota 1 1
Replace "usrquota" with "grpquota", should you need group quota support on a file system.

Step 2) Remount the File System to Enable Quota Support
# mount -o remount /home

Step 3)Initialize the new Quota Data Base
# quotacheck -c /home
Then a file named aquota.usr is created in the home directory

Step 4)
Start the assigned quota by
#quotaon /home
To off the Quota--- #quotaoff /home

Step 5)
The user policies can be implemented by editing the Quota File
#edquota -u username
/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
inodes in use: 356, limits (soft = 1000, hard = 1500)

Block in use-Used Space
Soft-Get Warning(The size reaches a particular point it shows warning)
Hard-Maximum Limit(Quota Exceeding Size)
inode-No of Files

For Checking the status of user Quota
# repquota −a

For Checking the Quota

Step 1)Switch to that user
# su - username

Step2)Create files in this home directory
#dd if=/dev/zero of=filename bs=1024 count=50
{Here 50 Kb is allocated to that directory...By giving more size you can check this}

Tags:-Quota ,Quota check in Linux,Quota users,how to do quota in Linux,How to Check Quota in Linux,Quota Commands,Quota commands in Linux,Quota informations in Linux,Methods to do Quota,Methods to do Quota in Linux,Steps to do Quota Check in Linux