Quota Howto: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Debian
=Ext4=
apt-get install quotatool
 
In /etc/fstab add the following options to the mount line:
<pre>
usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0
</pre>
 
The 'j' tells it you're making a journaling quota
 
mount -o remount / (or whatever filesystem you've added quota support to)
 
run quotacheck -cvagum
 
quotaon -a
 
=Ext3=


Try http://www.debianhelp.co.uk/Webmin.htm
Try http://www.debianhelp.co.uk/Webmin.htm
Line 22: Line 38:
mount -o remount /
mount -o remount /


quotacheck -avugm
quotacheck -vagum


quotaon –avug
quotaon –vagu


= Useful commands =


HINT:  Create a "prototype" user, compile a list of users who will have
HINT:  Create a "prototype" user, compile a list of users who will have
the same quotas as the prototype, and do  
the same quotas as the prototype, and do  
   
   
edquota -p protouser `cat userlist`
or just to copy to one new user


edquota -p protouser `cat userlist`
edquota -p protouser newuser


To report a list of all the quota's


repquota /
repquota /


is used to report list all the quota's
quota -u $USER
 
quota -g $GROUP
 
quotastats
 
the following shows the status of the quota system (on | off)


quotaon -p -a


=NFS=
'''Quota's over NFS:'''
'''Quota's over NFS:'''


1) set up quota's on server fs.
* set up quota's on server fs.
2) make sure rpc.rquotad is running using rpcinfo -p on server (doesn't need to run on the client)
* make sure rpc.rquotad is running using rpcinfo -p on server (doesn't need to run on the client)
3) mount nfs mount on client as per usual
* on server make sure /etc/default/quota has -S as: RPCRQUOTADOPTS="-p 32769 -S"
4) all the tools (repquota, quotacheck, quotaon, etc) only work on the server
* mount nfs mount on client as per usual
5) to edit quota's from the client use '''edquota -r -u user''' or '''edquota -r -g group'''
* all the tools (repquota, quotacheck, quotaon, etc) only work on the server
* to edit quota's from the client use '''edquota -r -u user''' or '''edquota -r -g group'''


<pre>
<pre>
Line 75: Line 105:




----
=RaQ=


Cobalt products, manual Quota setting, semi-automatic ;)
Cobalt products, manual Quota setting, semi-automatic ;)


Prerequisites:
Prerequisites:
=============
QuotaTool : http://devel.duluoz.net/quotatool/
QuotaTool : http://devel.duluoz.net/quotatool/
Compile this and keep it in your path on the Cobalt product in question.
Compile this and keep it in your path on the Cobalt product in question.

Latest revision as of 08:45, 22 October 2014

Ext4

apt-get install quotatool

In /etc/fstab add the following options to the mount line:

usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0

The 'j' tells it you're making a journaling quota

mount -o remount / (or whatever filesystem you've added quota support to)

run quotacheck -cvagum

quotaon -a

Ext3

Try http://www.debianhelp.co.uk/Webmin.htm

In /etc/fstab change the mount line to add usrquota,grpquota options, eg:

/dev/sda1 / ext3 defaults,errors=remount-ro,usrquota,grpquota 0 1


Then run:

quotacheck -cav

(-c create -a all -v verbose)

or alternatively

touch /quota.user /quota.group

chmod 600 /quota.*

mount -o remount /

quotacheck -vagum

quotaon –vagu

Useful commands

HINT: Create a "prototype" user, compile a list of users who will have the same quotas as the prototype, and do

edquota -p protouser `cat userlist`

or just to copy to one new user

edquota -p protouser newuser

To report a list of all the quota's

repquota /

quota -u $USER

quota -g $GROUP

quotastats

the following shows the status of the quota system (on | off)

quotaon -p -a

NFS

Quota's over NFS:

  • set up quota's on server fs.
  • make sure rpc.rquotad is running using rpcinfo -p on server (doesn't need to run on the client)
  • on server make sure /etc/default/quota has -S as: RPCRQUOTADOPTS="-p 32769 -S"
  • mount nfs mount on client as per usual
  • all the tools (repquota, quotacheck, quotaon, etc) only work on the server
  • to edit quota's from the client use edquota -r -u user or edquota -r -g group
With NFS, quotas are set up on the server's underlying filesystem.  You
then run rpc.rquotad on the server (which the Fedora nfs init script
starts by default).

I just set up quotas on my home NFS server (which is still running F9).
I had to reboot to get them enabled on the filesystem (probably could
have unmounted/remounted and then restarted NFS services, but this box
reboots in under a minute anyway).  I can see them with the quota
command on the NFS client, and they are enforced.

If you want to edit quotas remotely, you have to use the -r option to
edquota.  This also requires adding the -S option to the rpc.rquotad
call (in /etc/sysconfig/nfs on Fedora), but only works in rpc.rquotad
was compiled with that support; the version in F9 and F10 was not, but
F11 includes this support.

None of the other quota commands (such as quotacheck, quotaon, etc.)
work on the NFS client, because those operate directly on the local
filesystem only.

All of this works fine for me between an F9 NFS server and an F11 NFS
client, except for the rpc.rquotad -S option (which should work when I
get the NFS server upgraded).

(source: http://www.mail-archive.com/fedora-list@redhat.com/msg50090.html)


RaQ

Cobalt products, manual Quota setting, semi-automatic ;)

Prerequisites: QuotaTool : http://devel.duluoz.net/quotatool/ Compile this and keep it in your path on the Cobalt product in question.

Getting into postgres:


cat /etc/cobalt/.meta.id <- Copy the alfanumeric output. It's the postgress PW. psql cobalt -u user: <admin> password: <middleclick> (Paste)

Export Quota information for Virtual Hosts:


\o /home/sites/home/users/admin/sites.res select name,quota from vsite;

Export Quota information for users:


\o /home/sites/home/users/admin/users.res select name,quota from users;

Using this information:


cd ~admin cat sites.res | sed -e s#name.*\$##g -e s#--.*\$##g -e s#\(.*\$## -e s#\ ##g > sites.quota cat users.res | sed -e s#name.*\$##g -e s#--.*\$##g -e s#\(.*\$## -e s#\ ##g > users.quota export sites=`cat sites.quota` export users=`cat users.quota` export PATH=.:$PATH for a in $sites ; do

 export group=`echo $a | cut -d\| -f1` ;
 export quota=`echo $a | cut -d\| -f2` ;
 quotatool -g "$group" -bq "$quota"M -l "$quota"M /home

done for a in $users ; do

 export name=`echo $a | cut -d\| -f1` ;
 export quota=`echo $a | cut -d\| -f2` ;
 quotatool -u "$name" -bq "$quota"M -l "$quota"M /home

done