User Management / Disk Space Quotas
Setting quotas
- Setting quotas for user and group (in your favorite editor $EDITOR)
edquota -u USER_NAME
edquota -g GROUP_NAME
- Changing grace period (default is 7 days, it is quite ok)
edquota -t
- To rapidly set the same quotas for many users, you should first
edit quotas for one user by hand, and the rest might use him as a
template:
edquota -p TEMPLATE_USER USER_NAME
edquota -p TEMPLATE_USER ‘perl -F: -ane 'print "$F[0]\n" if ($F[2] > 499 && $F[2] < 10000)' /etc/passwd’
later command will set the quotas as have TEMPLATE_USER for all the
rest system users from /etc/passwd with UID more
or equal to 500 and less than 10000. FIXME: users' UID range is still
under consideration.
Note! Right after system installation
quotas should be switched on first, see below!
Monitoring quotas
- Watch quotas
repquota -v /export
repquota -v /export/grid
You should see all your users, something like:
[root@kvartsi etc]# repquota -v /export/
*** Report for user quotas on device /dev/cciss/c1d0p2
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 1310828 0 0 12559 0 0
cscadmin -- 5032 0 0 55 0 0
Statistics:
Total blocks: 8
Data blocks: 1
Entries: 3
Used average: 3.000000
Right after installation quotas are on, but all zero.
- Watch quota for particular user
quota -v -s USER_NAME
Enabling quotas at front-end
You need to perform this step only once, right after install.
The kernel should have support for quotas (version 2),
and rpc.rquotad server, to provide quotas over NFS,
should be running.
Before making changes, make sure that nobody is using the
filesystems (quotacheck will try to remount it read-only). Further
are instructions for /export and /export/grid at front-end:
- Add 'usrquota' and 'grpquota' options to /etc/fstab:
LABEL=/export /export ext3 defaults,usrquota,grpquota 1 2
LABEL=/export/grid /export/grid ext3 defaults,usrquota,grpquota 1 2
- Remount filesystems
mount -o remount /export
mount -o remount /export/grid
- Build a table of current disk usage (for current filesystem)
quotacheck -vicug /export
quotacheck -vicug /export/grid
After this step files aquota.user and aquota.group should be
located at filesystem root with quotas.
- Switch the quotas on:
quotaon -vug /export
quotaon -vug /export/grid
The only possible way to check that quotas work, try to exceed them,
set them for some user USER_NAME, let's say 200MB. Then try to fill it over.
su - USER_NAME -c 'dd if=/dev/zero of=~/output bs=4k count=100000'
You should get the error, about exceeding quotas. Try the same command on
some of compute nodes, to get the same result over NFS. Don't forget
to remove ~USER_NAME/output after you are done.
|