quotaon Command in Linux with Examples

This tutorial explains Linux “quotaon” command, options and its usage with examples.

quotaon – turn filesystem quotas on

Description :

quotaon announces to the system that disk quotas should be enabled on one or more filesystems. The filesystem quota files must be present in the root directory of the specified filesystem and be named either aquota.user (for version 2 user quota), quota.user (for version 1 user quota), aquota.group (for version 2 group quota), or quota.group (for version 1 group quota) and /etc/fstab for default filesystems.

An error (EPERM) will be returned if the quota.user and quota.group files are not owned by user root and group system. Ownership changes on these files are not permitted while quotas are active.

Usage :


quotaon [ -g ] [ -u ] [ -v ] { -a | FileSystem … }

Options :

Enables or disables all file systems that are read-write and have disk quotas, as indicated by the /etc/filesystems file. When used with the -g flag, only group quotas in the /etc/filesystems file are enabled or disabled; when used with the -u flag, only user quotas in the /etc/filesystems file are enabled or disabled.
Specifies that only group quotas are enabled or disabled.
Specifies that only user quotas are enabled or disabled.
Prints a message for each file system in which quotas are turned on or off.

Note :
By default, both user and group quotas are enabled. The -u flag enables only user quotas; the -g flag enables only group quotas. Specifying both -g and -u flags is equivalent to the default (no option specified).

Examples :

1. To enable user quotas for the /usr file system, enter:

# quotaon -u /usr

2. To enable user and group quotas and also print message for the same

# quotaon -vug /dev/sdb1
/dev/sdb1 [/home]: group quotas turned on
/dev/sdb1 [/home]: user quotas turned on

3. To enable user and group quotas for all file systems in the /etc/filesystems file

# quotaon -a

Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.

If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.