quotactl.2: Add some details about Q_QUOTAON

For Q_QUOTAON, on old kernel we can use quotacheck -ug to generate
quota files. But in current kernel, we can also hide them in
system inodes and indicate them by using "quota" or project
feature.

For user or group quota, we can do as below (etc ext4):

mkfs.ext4 -F -o quota /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

For project quota, we can do as below (etc ext4):

mkfs.ext4 -F -o quota,project /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

Reported-by: Jan Kara <jack@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Yang Xu 2019-10-25 14:06:25 +08:00 committed by Michael Kerrisk
parent 13a07cc485
commit ae848b1d80
1 changed files with 11 additions and 2 deletions

View File

@ -117,7 +117,15 @@ argument points to the pathname of a file containing the quotas for
the filesystem.
The quota file must exist; it is normally created with the
.BR quotacheck (8)
program.
program. Quota information can be also stored in hidden system inodes
for ext4, xfs and other filesystems if the filesystem is configured so.
In this case, there are no visible quota files and there is no need to
use
.BR quotacheck (8).
Quota information is always kept consistent by the filesystem and Q_QUOTAON
quotactl only enables enforcement of quota limits. The presence of hidden
system inodes with quota information is indicated by DQF_SYS_FILE flag in
Q_GETINFO output.
This operation requires privilege
.RB ( CAP_SYS_ADMIN ).
.TP 8
@ -638,7 +646,8 @@ The
.I id
argument is ignored.
.TP
.B Q_XQUOTARM
.B Q_XQUOTARM() " (since Linux 3.16)"
.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
Free the disk space taken by disk quotas. The
.I addr
argument should be a pointer to an