1832590 Members
3197 Online
110043 Solutions
New Discussion

Re: disk quotas

 
manu_5
Frequent Advisor

disk quotas

Hi,
i want to restrict the space usage by different users on a particular filesystem ...and thought of disk quotas...can u tell me how to implement disk quotas on hp
6 REPLIES 6
Yogeeraj_1
Honored Contributor

Re: disk quotas

hi,

You follow these steps to enable quota. Suppose You want to enable quota in /home file system.. then

#cpset /dev/null /home/quotas 600 root bin

Here /dev/null is for make size to 0 bytes
600 is the mode of the file
root is the owner and bin is the group

Now suppose you want to enable quota for user boota..Then

#edquota boota

Now you will get an editor which will have one line like this

fs /home blocks (soft=0, hard=0) inode (soft=0,hard=0)

Here you can edit the soft and hard limits of blocks and inodes. Then save and come out. Now for enabling quota there three ways available. You can use which is suitable for you.

Way 1: Turn on quota while rebooting

Modify the line fstab like this
/dev/vg00/lvol8 /home hfs rw, suid, quota 0 2

Way 2: Turn on quota by mounting fs
Unmount /home
mount -o quota /dev/vg00/lvol8 /home
Way 3: Turn on by command

#quotaon -v /home


Hope this helps!

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
manu_5
Frequent Advisor

Re: disk quotas

Thanks for the explaination, i have following doubts
1)for 3 gb limit what should be the hard and soft limit for the block and inode
2)what is differnce between hard and soft limit.
Ravi_8
Honored Contributor

Re: disk quotas

Hi,

This may help you.
http://www.cites.uiuc.edu/cluster/quota/
never give up
Ravi_8
Honored Contributor

Re: disk quotas

Once you have configured your system to enable quotas, verify that they really are enabled. An easy way to do this is to run quota -v. You should see a one line summary of disk usage and current quota limits for each file system that quotas are enabled on.

You are now ready to start assigning quota limits with the edquota command.

You have several options on how to enforce limits on the amount of disk space a user or group may allocate, and how many files they may create. You may limit allocations based on disk space (block quotas) or number of files (inode quotas) or a combination of both. Each of these limits are further broken down into two categories: hard and soft limits.

A hard limit may not be exceeded. Once a user reaches their hard limit they may not make any further allocations on the file system in question. For example, if the user has a hard limit of 500 blocks on a file system and is currently using 490 blocks, the user can only allocate an additional 10 blocks. Attempting to allocate an additional 11 blocks will fail.

Soft limits on the other hand can be exceeded for a limited amount of time. This period of time is known as the grace period, which is one week by default. If a user stays over his or her soft limit longer than their grace period, the soft limit will turn into a hard limit and no further allocations will be allowed. When the user drops back below the soft limit, the grace period will be reset.

never give up
Yogeeraj_1
Honored Contributor

Re: disk quotas

hi again,

Soft limits are limits that can be exceeded for a specified time. A hard limit can never be exceeded. If users reach a hard limit or fail to reduce usage below soft limits before a specified time, they will be unable to create files or increase the size of existing files.

NB. A user can bypass the limits by using the chown command to change the ownership of files. For example, a user can use the chown command to make root the owner of his file. This file, now owned by root, will not be considered in the file system usage computed for the user - (we might have to limit this command to only a few privileged users). Also, note that to prevent users from using /tmp or /var/tmp as storage, the soft limits and the time limits can be set short.

Hope this helps!
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)