PDA

View Full Version : User Quota Management?



Vector
23rd June 2008, 03:13 PM
I just added a couple of accounts to my workstation so that two other people could use it to surf the net, and watch South Park (http://SouthParkStudios.com), and i cannot remember where i seen the option to limit how much disk space that a user is allowed to allocate.

Does anyone know the name of the package for this, or the menu option?

Thanx

notageek
23rd June 2008, 08:00 PM
There's no menu option for this. Quota in Linux is based on filesystem attribute. Quota in Linux is of two types 1. User quota 2. Group Quota. As the name suggests user quota is quota limit on specific users and group quota is quota limit on a specific group.

To enable quota on a specific mount point you'd have to enable either user quota or group quota by trying the following:

Edit /etc/fstab to look like this, note "usrquota" in options, which means I've decided to enable user quota on the partition.

/dev/sda10 /mnt/free10 ext3 defaults,usrquota 0 0
Now remount the partition to load this FS attribute

mount -o remount /mnt/free10
Once mounted check its correctly enabled.

mount |grep sda10
/dev/sda10 on /mnt/free10 type ext3 (rw,noexec,nosuid,nodev,usrquota)

Enable quota db on the partition

quotacheck -c /mnt/free10

Once that's done, assign quota to the user by trying the following:

edquota username

You'll see the following:


Disk quotas for user user (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/sda10 4 40960 51200 1 0 0

The first half of the values are for blocks, and the next half is for inodes. The size of blocks is defined in kb, in this example I've assigned a soft quota limit of 40 mb to the user and hard quota limit of 50 mb to the user. Once you finish editing this page save and exit like you'd do in vi. When a user crosses the soft quota limit he's only warned, when a user crosses hard quota limit the user is restricted from exceeding his quota

If you're past this then you've successfully set quota on a user check if what you've done is correct by running the following

repquota /mnt/free10
*** Report for user quotas on device /dev/sda10
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 176200 0 0 4 0 0
user -- 4 40960 51200 1 0 0
[/code]

Hope this micro tutorial helps.

slimx3m
15th October 2008, 03:24 PM
notageek,

thank you for this explanation. sure it helps. i don't bother doing this on the terminal, but is there any gui to do this that you are aware of?

notageek
15th October 2008, 03:45 PM
I'm afraid, I'm not aware of any GUI tool for quota management on Linux :(

slimx3m
15th October 2008, 05:22 PM
that's all right. thnx anyways. i could live without one :|