Set Quota on your Linux system
Overview
Quota is a system administration tools for monitoring and limiting users’ and/or groups’ disk usage, per file system. Two features of disk storage with “quota” are available to set limits: the first is the number of inodes (number of files) a user or a group of users may possess and the second is the number of disk blocks (amount of space in kilobytes) that may be allocated to a user or a group of users. With quota, the users are forced by the system administrator to not consume unlimited disk space on a system. This program is handled on per user, per file system basis and must be set for each file system separately.
Build a kernel with Quota support
The first thing you need to do is ensure that your kernel has been built with Quota support enabled. In the 2.2.14 kernel version you need ensure that you have answered Y to the following questions:
Filesystems
Quota support (CONFIG_QUOTA) [N/y/?] Y
NOTE: If you are followed the Linux Kernel chapter in this book and have recompiled your kernel, the option “Quota support” show above is already set.
Modify the “/etc/fstab” file
The 7etc/fstab” file contains information about the various file systems installed on your Linux server. Quota must be enabled in the fstab file before you can use it. Since Quota must be set for each file system separately, and because in the fstab file, each file system is described on a separate line, quota must be set on each of the separate lines in the fstab for which you want to enable quota support.
With the program quota, depending on your intentions, needs, etc, you can enable quota only for users, groups or both (users and groups). For all examples below, we’ll use the “/home” directory on the 7dev/sda6″ partition and shows you the three possibilities.
Possibility 1:
• To enable user quota support on a specific file system, edit your fstab file (vi /etc/fstab) and add the “usrquota” option to the fourth field after the word “defaults” or any other options you may have set for this specific file system.