Difference between revisions of "Sysadmin/Quota"

From Sugar Labs
Jump to navigation Jump to search
(Created page with "== User quota == The /srv filesystem has usrquota enabled with the following per-user limits: soft hard /srv space: 10G 12G /srv files: 1M 1.2...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== User quota ==
 
== User quota ==
  
The /srv filesystem has usrquota enabled with the following per-user limits:
+
The /srv filesystem on [[Machine/sunjammer]] has usrquota enabled with the following per-user limits:
  
 
               soft    hard
 
               soft    hard
Line 27: Line 27:
 
* Q: Um, I said what I wanted was more space on my account, *please*
 
* Q: Um, I said what I wanted was more space on my account, *please*
 
* A: Sure, hang on. < clickety...clickety... rm -r /home/$USER > There, you've got *plenty* of space now!
 
* A: Sure, hang on. < clickety...clickety... rm -r /home/$USER > There, you've got *plenty* of space now!
 +
 +
(from [http://www.nyms.de/bofhoriginaleng.html BOFH, Part 3])
  
 
== Additional info for sysadmins ==
 
== Additional info for sysadmins ==
Line 35: Line 37:
  
 
=== Show quota summary for all users ===
 
=== Show quota summary for all users ===
{{{
+
repquota -vast
repquota -vast
 
}}}
 
  
 
=== Create quota from scratch ===
 
=== Create quota from scratch ===
{{{
+
quotacheck -m -c /home
quotacheck -m -c /home
+
quotacheck -m -c /mail
quotacheck -m -c /mail
+
quotaon -au
quotaon -au
 
}}}
 
  
 
=== Reset quota limits for all users ===
 
=== Reset quota limits for all users ===
{{{
+
cd /home
cd /home
+
for i in *; do
for i in *; do
 
 
         # 25G  30G 1M 1.2M
 
         # 25G  30G 1M 1.2M
 
         setquota -u $i 26214400 31457280 1024000 1200000 /home
 
         setquota -u $i 26214400 31457280 1024000 1200000 /home
 
         #  1G 1.2G 1M 1.2M
 
         #  1G 1.2G 1M 1.2M
 
         setquota -u $i 10485760 12582912 1024000 1200000 /mail
 
         setquota -u $i 10485760 12582912 1024000 1200000 /mail
done
+
done
}}}
 
  
 
=== Check quota limits in cron.daily ===
 
=== Check quota limits in cron.daily ===
 
See `/etc/warnquota.conf` and `/etc/quotatab`
 
See `/etc/warnquota.conf` and `/etc/quotatab`
{{{
+
warnquota -u -s
warnquota -u -s
 
}}}
 
  
 
=== Crash recovery ===
 
=== Crash recovery ===

Latest revision as of 14:52, 14 June 2011

User quota

The /srv filesystem on Machine/sunjammer has usrquota enabled with the following per-user limits:

              soft    hard
 /srv space:   10G     12G
 /srv files:    1M    1.2M

When users attempt to write beyond their hard-limit, the system call fails with a "Quota exceeded" error.

If the soft-limit is exceeded, a cronjob sends a daily notification email to the user and to systems-logs@. This continues for a grace period of 7 days. Aftet the grace period, offending users will be barred from allocating any additional space until they free up some space.

Requesting limit exensions

Additional space can be requested to the sysadmins, along with a motivation. For best service, follow the canonical BOFH space extension script:

  • Q: I need more space
  • A: Well, why not move to Texas?
  • Q: No, on my account, stupid.
  • A: I didn't quite catch that. What was it that you said?
  • Q: Um, I said what I wanted was more space on my account, *please*
  • A: Sure, hang on. < clickety...clickety... rm -r /home/$USER > There, you've got *plenty* of space now!

(from BOFH, Part 3)

Additional info for sysadmins

Essential documentation

man edquota
man setquota

Show quota summary for all users

repquota -vast

Create quota from scratch

quotacheck -m -c /home
quotacheck -m -c /mail
quotaon -au

Reset quota limits for all users

cd /home
for i in *; do
       # 25G  30G 1M 1.2M
       setquota -u $i 26214400 31457280 1024000 1200000 /home
       #  1G 1.2G 1M 1.2M
       setquota -u $i 10485760 12582912 1024000 1200000 /mail
done

Check quota limits in cron.daily

See `/etc/warnquota.conf` and `/etc/quotatab`

warnquota -u -s

Crash recovery

In case of crash, theoretically one should run quotacheck to scan the entire filesystem, recomputing the exact quota status of all users. In practice, nothing bad happens if the values are off by a few megabytes, so quotacheck is mostly just a waste of time.