April 23, 2009

User and Quota

* Quota is used to restrict users on the basis of space limit/number of files.

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

*Quota is handled on a per user, per file system basis. If there is more than one file system which a user is expected to create files, then quota must be set for each file system separately.

* Always impliment on filesystem and folders

* Can't impliment of folder and directories

* Quota has two limits:--
---Soft limit
---Hard limit

Creating Quota

> Create a partition and mount it with /home
> Open the fstab and put following entry like:--


/dev/sda4 /home ext3 defaults,usrquota 0 0

> save and exit the file
>mount the directory

# mount -a <-- To update fstab

# mount -0 remount /home <--Quota perameter will pass to kernel,to update user quota

# df -Th

> Create database of the quota

# quotacheck /home

# ll /home <-- To see the database

> Activate quota

# quotaon /home

# quotaon -P /home <-- To see whether the quota is on or off

# repquota -a <-- To see all quotas

> Now i m going to set quota on vinod,he should have only access to minimum of 512 kb and maximum to 1024 kb

# setquota -u vinod 512 1024 0 0 /home

Note: 512 & 1024 are blocks and they always will be in kb,next both zero's are inodes mean files

> Now to check whether quota is working or not, login by user vinod and create data more then 512 kb. After reaching 512 kb, it should give you warning and you will not be able to create data more then 1024 kb.

No comments:

Post a Comment