Differences between current version and previous revision of HowToQuota.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Sunday, November 28, 2004 1:04:09 am | by AristotlePagaltzis | |
Older page: | version 2 | Last edited on Friday, June 7, 2002 1:07:23 am | by perry | Revert |
@@ -1,550 +1 @@
-
-
-
-Quota mini-HOWTO
-
-
-
-----
-
-!!!Quota mini-HOWTO
-
-!!Ralf van Dooren r.vdooren@snow.nlv0.3, April 2002
-
-
-----
-''Preamble: This document is written by Ralf van Dooren (r.vdooren@snow.nl).
-Original text and setup of this document is copyleft-ed by Albert M.C. Tam, many thanks to him for this initial mini-HOWTO. This document is licensed under the GNU Free Documentation License.''
-----
-
-
-Permission to use, copy, distribute this document for non-commercial purposes
-is hereby granted, provided that the author's / editor's name and this notice
-appear in all copies and/or supporting documents; that this document is not
-modified. This document is distributed in hope that it will be useful, but
-WITHOUT ANY WARRANTY, either expressed or implied. While every effort has been
-taken to ensure the accuracy of the information documented herein, the author /
-editor / maintainer assumes NO RESPONSIBILITY for errors, or for damages results
-for the use of the information documented herein.
-
-
-This document describes how to enable file system quota on a Linux host,
-assigning quota for users and groups, as well as the usage of miscellaneous
-quota commands. It is intended for users running kernel 2.x (recently tested
-on kernel 2.4.17).
-
-
-Feel free to send feedbacks or comments to r.vdooren@snow.nl if you find an
-error, or if any information is missing. I appreciate it.
-
-
-
-
-!!1. What is Quota?
-
-
-
-
-!!2. Current Status of Quota on Linux
-
-
-
-
-!!3. Requirements for Using Quota on Linux
-
-
-*3.1 Kernel
-
-*3.2 Quota software
-
-
-
-
-
-!!4. Quota Setup on Linux - Part I: The Configuration
-
-
-*4.1 Patch the kernel
-
-*4.2 Reconfigure your kernel
-
-*4.3 Compile and install the quota softwares
-
-*4.4 Modify your system init script to check quota and turn quota on at boot
-
-*4.5 Modify /etc/fstab
-
-*4.6 Activate the quota system
-
-
-
-
-
-!!5. Quota Setup on Linux - Part II: Assigning Quota for Users and Groups
-
-
-*5.1 Assigning quota for a particular user
-
-*5.2 Assigning quota for a particular group
-
-*5.3 Assigning quota for a bunch of users with the same value
-
-*5.4 Soft Limit
-
-*5.5 Hard Limit
-
-*5.6 Grace Period
-
-
-
-
-
-!!6. Miscellaneous Quota Commands
-
-
-*6.1 Quotacheck
-
-*6.2 Repquota
-
-*6.3 Quotaon and Quotaoff
-
-----
-
-!!1. What is Quota?
-
-
-Quota allows you to specify limits on two aspects of disk storage: the
-number of inodes a user or a group of users may possess; and the number of
-disk blocks that may be allocated to a user or a group of users.
-
-
-The idea behind quota is that users are forced to stay under their disk
-consumption limit, taking away their ability to consume unlimited disk space
-on a system. Quota is handled on a per user, per file system basis. If there
-is more than one file system which a user is expected to create files, then
-quota must be set for each file system separately.
-----
-
-!!2. Current Status of Quota on Linux
-
-
-
-
-
-Currently, there are some major changes in the way quota works. There are two
-different setups. The tools works the same, but there's a difference in used files. This
-document describes the setup and operation of the _new_ quota setup. As the new setup
-of quota is not in the regular kernel source, this setup needs some patching. We will describe this
-patching and installation of the linuxquota package. If you already have the quota software installed
-on your system, you may or may not have to install this patch and package. You can email me if
-you have any questions about this. I'll try to include a overview of Linux distro's and it's implications
-in a later version of this document.
-
-
-
-----
-
-!!3. Requirements for Using Quota on Linux
-
-
-
-
-!!3.1 Kernel
-
-
-
-
-
-
-The 2.x kernel source is available from
-----
-
-http://www.kernel.org
-
-----
-. Please use an available mirror close to your location to save bandwidth.
-
-!!3.2 Quota software
-
-
-
-
-
-
-Depending on the Linux distribution you have, you may, or may not have
-the quota softwares installed on your system. The most recent version of quota
-is available through !SourceForge and is in active development. You can reach the
-homepage of the quota-development at
-
-
-
-----
-
-http://www.sourceforge.net/projects/linuxquota
-
-----
-
-
-
-----
-
-!!4. Quota Setup on Linux - Part I: The Configuration
-
-
-
-
-!!4.1 Patch the kernel
-
-
-
-Download the patch for your kernel at:
-
-
-
-----
-
-ftp://atrey.karlin.mff.cuni.cz/pub/local/jack/quota/
-
-----
-
-
-Choose your kernel version and download the patch. Patch your kernel with the 'patch' command.
-
-
-
-
-!!4.2 Reconfigure your kernel
-
-
-
-
-
-
-Reconfigure your kernel and add quota support by typing y to:
-----
-
-Quota support (CONFIG_QUOTA)
[[n
] y
-
-----
-
-
-
-
-
-Via `make menuconfig` of `make xconfig` you can find the option to support quota
-under the Filesystems-menu.
-
-
-Make sure the new kernel will be used when rebooting the system.
-
-
-
-
-!!4.3 Compile and install the quota softwares
-
-
-
-If the quota package is already in your Linux distribution, you don't have to install the quota
-software. If the quota package is not available in your Linux distribution, or if you wan't to
-install the most recent version, you can download the latest version of the quota software source from
-the location mentioned above.
-
-
-When downloaded do:
-----
-
-$ gzip -dc <downloaded file> | tar xvf
-$ cd quota-tools (or whatever directory the software is put in)
-$ ./configure
-$ make
-$ su
-# make install
-
-----
-
-
-
-
-!!4.4 Modify your system init script to check quota and turn quota on at boot
-time
-
-
-
-
-
-Here's an example:
-----
-
-# Check quota and then turn quota on.
-if [[ -x /usr/sbin/quotacheck ]
-then
-echo "Checking quotas. This may take some time."
-/usr/sbin/quotacheck -avug
-echo " Done."
-fi
-if [[ -x /usr/sbin/quotaon ]
-then
-echo "Turning on quota."
-/usr/sbin/quotaon -avug
-fi
-
-----
-
-
-The golden rule is that always turn quota on after your file systems in
-/etc/fstab have been mounted, otherwise quota will fail to work. I recommend
-turning quota on right after the part where file systems are mounted in your system init script.
-
-
-
-
-!!4.5 Modify /etc/fstab
-
-
-
-
-
-
-Partitions that you have not yet enabled quota normally look something
-like:
-----
-
-/dev/hda1 / ext2 defaults 1 1
-/dev/hda2 /usr ext2 defaults 1 1
-
-----
-
-
-To enable user quota support on a file system, add "usrquota" to the fourth
-field containing the word "defaults" (man fstab for details).
-----
-
-/dev/hda1 / ext2 defaults 1 1
-/dev/hda2 /usr ext2 defaults,usrquota 1 1
-
-----
-
-
-Replace "usrquota" with "grpquota", should you need group quota support
-on a file system.
-----
-
-/dev/hda1 / ext2 defaults 1 1
-/dev/hda2 /usr ext2 defaults,grpquota 1 1
-
-----
-
-
-Need both user quota and group quota support on a file system?
-----
-
-/dev/hda1 / ext2 defaults 1 1
-/dev/hda2 /usr ext2 defaults,usrquota,grpquota 1 1
-
-----
-
-
-
-
-!!4.6 Activate the quota system
-
-
-
-To activate the quota software you have to reboot the system for the changes you have made
-to take effect. The new kernel with quota support will be loaded and the startup scripts you've
-just created will be executed. At first run, quotacheck will generate the appropiate files to maintain
-the quota databases.
-
-
-Add quotacheck to crontab
-
-
-
-
-
-Although quota should work with periodical checks, it sometimes helps to run quotacheck periodically, e.g. weekly. Add the following line to your root's crontab:
-----
-
-0 3 * * 0 /sbin/quotacheck -avug
-
-----
-
-
-
-----
-
-!!5. Quota Setup on Linux - Part II: Assigning Quota for Users and Groups
-
-
-
-
-
-This operation is performed with the edquota command (`man edquota` for details).
-
-
-
-
-!!5.1 Assigning quota for a particular user
-
-
-
-
-
-
-Here's an example. I have a user with the login id bob on my system. The
-command "edquota -u bob" takes me into vi (or editor specified in my $EDITOR
-environment variable) to edit quota for user bob on each partition that has
-quota enabled:
-----
-
-Quotas for user bob:
-/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
-inodes in use: 356, limits (soft = 1000, hard = 1500)
-
-----
-
-
-"blocks in use" is the total number of blocks (in kilobytes) a user has
-consumed on a partition.
-
-
-"inodes in use" is the total number of inodes a user has consumed on a partition.
-
-!!5.2 Assigning quota for a particular group
-
-
-
-
-
-
-Now I have a group games on my system. "edquota -g games" takes me into
-the vi editor again to edit quota for the group games:
-----
-
-Quotas for group games:
-/dev/hda4: blocks in use: 5799, limits (soft = 8000, hard = 10000)
-inodes in use: 1454, limits (soft = 3000, hard = 4000)
-
-----
-
-!!5.3 Assigning quota for a bunch of users with the same value
-
-
-
-
-
-
-To rapidly set quotas for, say 100 users, on my system to the same value
-as my user bob, I would first edit bob's quota information by hand, then execute:
-----
-
-edquota -p bob `awk -F: '$3 > 499 {print $1}' /etc/passwd`
-
-----
-
-
-assuming that you are using csh, and that you assign your user UID's starting
-with 500.
-
-
-In addition to edquota, there are 3 terms which you should familiarize
-yourself with: Soft Limit, Hard Limit, and Grace Period.
-
-!!5.4 Soft Limit
-
-
-
-
-
-
-_Soft limit_ indicates the maximum amount of disk usage a quota user has
-on a partition. When combined with grace period, it acts as the border line,
-which a quota user is issued warnings about his impending quota violation when
-passed.
-
-!!5.5 Hard Limit
-
-
-
-
-
-
-Hard limit works only when grace period is set. It specifies the absolute
-limit on the disk usage, which a quota user can't go beyond his hard limit.
-
-!!5.6 Grace Period
-
-
-
-
-
-
-Executed with the command "edquota -t", grace period is a time limit before
-the soft limit is enforced for a file system with quota enabled. Time units
-of sec(onds), min(utes), hour(s), day(s), week(s), and month(s) can be used.
-This is what you'll see with the command "edquota -t":
-----
-
-Time units may be: days, hours, minutes, or seconds
-Grace period before enforcing soft limits for users:
-/dev/hda2: block grace period: 0 days, file grace period: 0 days
-
-----
-
-
-Change the 0 days part to any length of time you feel reasonable. I personally
-would choose 7 days (or 1 week).
-----
-
-!!6. Miscellaneous Quota Commands
-
-
-
-
-!!6.1 Quotacheck
-
-
-
-
-
-
-Quotacheck is used to scan a file system for disk usages, and updates the
-quota record file "aquota.user" to the most recent state. I recommend running
-quotacheck at system bootup, and via cronjob periodically (say, every week?).
-
-!!6.2 Repquota
-
-
-
-
-
-
-Repquota produces a summarized quota information for a file system. Here
-is a sample output repquota gives:
-----
-
-# repquota -a
-Block limits File limits
-User used soft hard grace used soft hard grace
-root -- 175419 0 0 14679 0
-bin -- 18000 0 0 735 0
-uucp -- 729 0 0 23 0
-man -- 57 0 0 10 0
-user1 -- 13046 15360 19200 806 1500 2250
-user2 -- 2838 5120 6400 377 1000 1500
-
-----
-
-!!6.3 Quotaon and Quotaoff
-
-
-
-
-
-
-Quotaon is used to turn on quota accounting; quotaoff to turn it off. Actually
-both files are similar. They are executed at system startup and shutdown
.
-
-
-
-----
+Describe
[HowToQuota
] here
.