quotause updates a Linux disk quota file according to current usage
$ 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
[-groupinfile=filename -groupoutfile=filename] [mountpoint]
Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options.
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:
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.
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.