"Fossies" - the Fresh Open Source Software Archive

Member "quotactl-1.00/quotause/quotause.html" (9 Oct 2005, 4867 Bytes) of package /linux/privat/old/quotactl-1.00.tgz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the quotactl-1.00.tgz project site itself.

quotause updates a Linux disk quota file according to current usage

Examples


$ mount -r /dev/hda2 /home
$ quotactl /dev/hda2 quotaoff
$ quotause -userinfile=/home/userquota -useroutfile=/tmp/userquota.new /home
$ cp /tmp/userquota.new /home/userquota
$ quotactl /dev/hda2 quotaon -user -quotafile=/home/userquota
$ mount -oremount,rw /dev/hda2 /home

Overview

quotause [-userinfile=filename -useroutfile=filename]
[-groupinfile=filename -groupoutfile=filename] [mountpoint]

Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options.

General

quotause updates a Linux disk quota file to reflect the true current usages. In normal operation, the kernel keeps the disk quota file up to date with the current usage, by adjusting it as the kernel allocates and reclaims file space. But it is not a robust operation. A system crash or any of various administrative errors can cause the quota file to stop reflecting disk usage reality. Also, when you first start doing disk space accounting and create a new disk quota file, the file shows zero usage for everyone regardless of what the actual usage is.

quotause is a low-level program that performs one specific part of disk quota administration, and you use it together with other tools, procedures, and policies to manage disk quota. It is not like the programs of the popular quota-tools package, which implement a full, integrated quota administration system. What this means technically is:

Permission Needed

All the following permission requirements are imposed by the Linux kernel. quotause tries to do whatever you tell it to do.

You must have permission to read the input quota file and to write the output file.

You must have permission to read every directory in the subject filesystem and to get attributes of every filesystem object.

That's it. You do not need permissions to mess with kernel disk quotas or filesystem mounts.

Arguments

mountpoint identifies the filesystem to which the disk quotas apply. It is a mountpoint of that filesystem. So it must be mounted, and quotause must be able to access the filesystem objects via that mount.

You must ensure that your input quota file (-infile) goes with this filesystem. If it doesn't, you'll wind up with a weird hybrid output file.

You will note that with the program quotactl, you identify a filesystem by device special file name, which makes quotause seem inconsistent. But quotactl is actually wrong, and it's that way because it is a direct interface to the quotactl system call, which is also wrong. quotactl is wrong because a) not all filesystems are based on a single Linux block disk; and b) what you are really identifying to quotactl is a filesystem image, not a filesystem. The convential way to identify a filesystem image is with a mountpoint. I might point out that even that convention isn't perfect -- it's based on an older technology in which a filesystem image existing and a filesystem image being mounted were indistinguishable concepts.

Options

-userinfile=filename
The input file for user quotas. If you don't specify this, quotause does not generate an updated user quota file.
-outfile=filename
The output file for user quotas. This option is allowed only if you also specify -userinfile, and is required in that case.
-groupinfile=filename
-groupoutfile=filename
Analogous to -userinfile and -useroutfile, but for group quotas.

See Also