Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Adding users & XFS disk quotas
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Tue Jul 20, 2004 4:43 am    Post subject: Adding users & XFS disk quotas Reply with quote

Hi,
1) Well firstly I'd like to know if it is possible to activate multiple users for diskquotas with edquota command, lets say all people in /etc/passwd with UID > 1000. Any other ways? I only need to add non-root users (about 40 of them). I also have machine names in /etc/passwd and theres no need to enable quotas for them. Another idea, how to enable every user that has home dir in /home/users ?

2) How do disable disk quotas for some users after enabling them?

3) quotacheck -avug always spits out:

Code:

quotacheck: Skipping /dev/md2 [/home/users]
quotacheck: Can't find filesystem to check or filesystem not mounted with quota option.


and quotacheck -avug -F xfs gives
Code:

root@a216server instructor # quotacheck -avug -F xfs
XFS quota format needs no checking.

How to go around that?
_________________
There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta
Back to top
View user's profile Send private message
mrness
Retired Dev
Retired Dev


Joined: 17 Feb 2004
Posts: 375
Location: bucharest.ro

PostPosted: Tue Jul 20, 2004 5:32 am    Post subject: Re: Adding users & XFS disk quotas Reply with quote

In order to activate quota on xfs (or on any fs for that matter) you must mount the partition with quota/usrquota/grpquota option.
XFS do not need quotacheck so don't use it.
All users have by default unlimited access (no quota).
For giving back unlimited access to a user you should set quotas to 0:
Code:
setquota -u $luser 0 0 0 0

The easy way to set a quota is to write your own script that refreshes quotas for users:
Code:
#!/bin/sh

function set_quota() {
    setquota -u $1 $2 $[ $2 * 11 / 10] $3 $[ $3 * 11 / 10 ] -a
}

# users (gid = 100)
awk -F: '$3 >= 500 && ( $4 == 100 || $4 == 1000 ) { print $1; }' /etc/passwd | \
(
    while read LUSER; do
        case $LUSER in
            *.support)
                BLOCK=$[3000 * 1024]
                INODE=0
            ;;
            *)
                BLOCK=$[1000 * 1024]
                INODE=20000
            ;;
        esac
        set_quota $LUSER $BLOCK $INODE
    done
)

set_quota ftp $[2000 * 1024] 10000

repquota -a

You should run this script whenever you add a new user and want to limit its disk quota.
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Sun Jul 17, 2005 9:40 pm    Post subject: Reply with quote

I really don't get it with quotas. How do I set a quota of 50 Mb (hard) with your script ? No soft quota and no file limit. ?



EDIT: I also had another question.. If i set a quota for the group "hebb" of 50 mb, will it set max 50 mb. by user in this group, or a single quota for all these users ?


Thanks, Phil
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
makenoob
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 272
Location: /Germany/Düsseldorf

PostPosted: Thu Sep 01, 2005 10:07 am    Post subject: Reply with quote

geforce wrote:
I really don't get it with quotas. How do I set a quota of 50 Mb (hard) with your script ? No soft quota and no file limit. ?



EDIT: I also had another question.. If i set a quota for the group "hebb" of 50 mb, will it set max 50 mb. by user in this group, or a single quota for all these users ?


Thanks, Phil


if i got it right, you set quotas with the setquota-command. for the group hebb:
Code:

setquota -g hebb 49000 50000 0 0

this means, that the group, the whole group includes all users in this group, has a block limit (soft) of 49 mb (it's a bit less in fact, because i didn't multiplicate with 1024) and a hard limit of 50 mb.
if you want quotas for users, you have to use the "-u" switch with setquota. the latter two numbers means a file limit. you can see how much auf a quota is used with the repquota-command.

HTH
marc
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 654
Location: Canada

PostPosted: Thu Sep 01, 2005 12:17 pm    Post subject: Reply with quote

Cool thx :D
_________________
http://tilde.club/~geforce/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum