Ask Your Question
1

Filesystem Quotas F20

asked 2014-07-24 10:28:21 -0500

Orestes910 gravatar image

All,

I'm struggling a great deal with what would seem like a simple (and common) problem.

I'm managing F20 desktops using LDAP as an authentication backend. I'm simply attempting to limit each user who logs into the system to 1GB of space in their home directory, but this doesn't seem to be possible with filesystem quotas as I understand them now. Currently, I've got a virtual filesystem mounted on /home with a 1GB quota set up for the users group. As I now realize, this will not limit each member to 1GB, but all all members combined. I can't really use user quotas, as all these systems will have a different and ever changing set of users.

Is there no way to do this?

edit retag flag offensive close merge delete

Comments

As I did this long ago, I don't remember the details (and so, I'm not adding an answer!), but certainly, it can be done! You can configure quota per user. I'm not sure but you might need some scripts to configure it for every new user though.

hedayat gravatar imagehedayat ( 2014-07-25 04:41:37 -0500 )edit

@hedayat - is it like how I did it?

abadrinath gravatar imageabadrinath ( 2014-07-27 04:37:12 -0500 )edit

@hello I think so. :)

hedayat gravatar imagehedayat ( 2014-07-27 09:47:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-07-27 04:36:46 -0500

abadrinath gravatar image

updated 2014-07-29 01:27:05 -0500

There is a very simple way of doing this with this tutorial. If you edit this bit in your /etc/fstab, you will have it up and running in no time.

...
/dev/sda2     /home   ext4    defaults,usrquota,grpquota             1    1
...

The key here is the usrquota and grpquota bit.

Next, reboot using

shutdown -r now

Turn on quotas:

quotaon -av 5

After reboot, check for the quota

quotacheck -vguma

Change the quota size using:

edquota -u user

To check quotas on every boot:

For those looking for a bit more information, I've found a way to use usrquota via the gdm init scripts. During login, these scripts, run by root, contain a $USER var that is the uid of the user logging in. I use this variable to create a quota for whoever has logged in of 1GB using the edquota command with a few args. Thanks everyone for the help.

Set 4MB hard block limit, 2MB soft block limit, 2048 inode hard limit, 1024 inode soft limit, 2 weeks and 3 days (or 17 days) block and inode grace time for the default quotas on file system /home:

edquota -h 4M/2k -s 2M/1k -t 2W3D/2W3D -f /home -u -d

echo "edquota -h 4M/2k -s 2M/1k -t 2W3D/2W3D -f /home -u -d" >> /etc/gdm/Init/Default

Check these tutorials for more info:

http://www.yolinux.com/TUTORIALS/LinuxTutorialQuotas.html

http://www.linuxforums.org/forum/programming-scripting/46726-disk-quota-shell-script.html (shell script)

http://www.linuxquestions.org/questions/linux-general-1/setting-maximum-folder-size-408682/

http://serverfault.com/questions/106078/how-to-set-a-home-directory-limit-for-all-users-in-ubuntu

EDIT: To make my answer better, I used @Orestes910's advice :). Thanks.

edit flag offensive delete link more

Comments

This is what I've settled on.

For those looking for a bit more information, I've found a way to use usrquota via the gdm init scripts. During login, these scripts, run by root, contain a $USER var that is the uid of the user logging in. I use this variable to create a quota for whoever has logged in of 1GB using the edquota command with a few args. Thanks everyone for the help.

Orestes910 gravatar imageOrestes910 ( 2014-07-28 16:56:45 -0500 )edit

@Orestes910 - thanks! added to my answer.

abadrinath gravatar imageabadrinath ( 2014-07-29 01:19:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-24 10:28:21 -0500

Seen: 473 times

Last updated: Jul 29 '14