---
name: "Q_QUOTAON"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Q_QUOTAON"
---

# Q\_QUOTAON(2const)

turn on quotas for a filesystem

## 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:

- **QFMT\_VFS\_OLD**

  The original quota format.

- **QFMT\_VFS\_V0**

  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.

- **QFMT\_VFS\_V1**

  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)](/quotacheck/8.md) 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)](/quotacheck/8.md). 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)](/Q_GETINFO/2const.md) 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)](/quotactl/2.md).

## ERRORS

See [**quotactl**(2)](/quotactl/2.md).

- **EACCES**

  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*.

- **EBUSY**

  Another **Q\_QUOTAON** had already been performed.

- **EINVAL**

  The specified quota file is corrupted.

- **ESRCH**

  The specified quota format was not found.

## STANDARDS

Linux.

## HISTORY

Linux.

## SEE ALSO

[**quotactl**(2)](/quotactl/2.md), [**quotactl\_fd**(2)](/quotactl_fd/2.md), [**Q\_QUOTAOFF**(2const)](/Q_QUOTAOFF/2const.md), [**quotacheck**(8)](/quotacheck/8.md)
