Scroll to navigation

Q_QUOTAON(2const) Q_QUOTAON(2const)

NAME

Q_QUOTAON - turn on quotas for a filesystem

LIBRARY

Standard C library (libc-lc)

SYNOPSIS

#include <sys/quota.h>
int quotactl(QCMD(Q_QUOTAON, type), const char *_Nullable special,
             int fmt, caddr_t quota_path);
#include <sys/quota.h>    /* Definition of Q_* constants */
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS_quotactl_fd, int fd, QCMD(Q_QUOTAON, type));

DESCRIPTION

Turn on quotas for a filesystem.

The fmt argument is the identification number of the quota format to be used. Currently, there are three supported quota formats:

The original quota format.
The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs and quota limits up to 2^42 bytes and 2^32 inodes.
A quota format that can handle 32-bit UIDs and GIDs and quota limits of 2^63 - 1 bytes and 2^63 - 1 inodes.

The quota_path 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 quotacheck(8) 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 quotacheck(8). Quota information is always kept consistent by the filesystem and the Q_QUOTAON operation serves only to enable enforcement of quota limits. The presence of hidden system inodes with quota information is indicated by the DQF_SYS_FILE flag in the dqi_flags field returned by the Q_GETINFO(2const) operation.

The quotactl_fd() variant of this system call doesn't have the quota_path and fmt arguments, so the Q_QUOTAON operation of quotactl_fd() is only suitable for work with hidden system inodes.

This operation requires privilege (CAP_SYS_ADMIN).

RETURN VALUE

See quotactl(2).

ERRORS

See quotactl(2).

The quota file pointed to by quota_path exists, but is not a regular file or is not on the filesystem pointed to by special.
Another Q_QUOTAON had already been performed.
The specified quota file is corrupted.
The specified quota format was not found.

STANDARDS

Linux.

HISTORY

Linux.

SEE ALSO

quotactl(2), quotactl_fd(2), Q_QUOTAOFF(2const), quotacheck(8)

2026-06-05 Linux man-pages 6.19