View previous topic :: View next topic |
Author |
Message |
petrjanda Veteran


Joined: 05 Sep 2003 Posts: 1557 Location: Brno, Czech Republic
|
Posted: Tue Jul 20, 2004 4:43 am Post subject: Adding users & XFS disk quotas |
|
|
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 |
|
 |
mrness Retired Dev


Joined: 17 Feb 2004 Posts: 375 Location: bucharest.ro
|
Posted: Tue Jul 20, 2004 5:32 am Post subject: Re: Adding users & XFS disk quotas |
|
|
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 |
|
 |
geforce l33t


Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
Posted: Sun Jul 17, 2005 9:40 pm Post subject: |
|
|
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 |
|
 |
makenoob Apprentice

Joined: 19 Aug 2004 Posts: 272 Location: /Germany/Düsseldorf
|
Posted: Thu Sep 01, 2005 10:07 am Post subject: |
|
|
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 |
|
 |
geforce l33t


Joined: 29 Dec 2003 Posts: 654 Location: Canada
|
|
Back to top |
|
 |
|
|
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
|
|