Set disk quota in Linux system
BRIMMER this site
〖
Back to〗 Forward〗
Set up the disk quota HTML and Word format in the Linux system. Please go to my homepage, you can also download. Www.linuxaid.com.cn/Engineer/brimmer Sets the disk quota overview in the Linux system (quota) is a system administrator used to monitor and limit the use of users or groups of disks. Quota can limit: one, limit the number of inode (file number) that can be owned by the user or group; it limits the number of disk blocks assigned to the user or group (in kilobytes). By using Quota, the system administrator can limit the user's freely using disk space. The quota program is for each user and each file system, so each file system is set separately. Compile Support Quota's kernel First, you have to make sure your Linux kernel is support quota. In the 2.2.14 version of the core, you must answer the following problem "Y" when compiling. FileSystems Quota Support (config_quota) [N / Y /?] Y modifies the "/ etc / fstab" file "/ etc / fstab" file contains information about a wide variety of file systems installed in the Linux system. Before using quota, you must now set it into force. Because QUOTA is set separately for each file system, and in the "fstab" file, each file system is represented separately, so in order to support the Quota must be set separately in each line of "FSTAB". Depending on your needs, you can set quota separately for users, groups, or groups and users. In the following example, we assume that "/ home" directory is in "/ dev / sda6" device, there are three possible situations. The first possible situation: Set the user quota on a specific file system, edit your "fstab" file (vi / etc / fstab), add "USRQUOTA after" defaults "or other settings made for the file system ".
For example: / dev / sda6 / home ext2 defaults 1 2 (AS An Example: The Word "Defaults") / DEV / SDA6 / HOME EXT2 NOSUID, NODEV 1 2 (AS An Example: Any Other Options You Have Set) Change to: / dev / sda6 / home ext2 defaults, usrquota 1 2 / dev / sda6 / home extra2 Nosuid, Nodev, USRQUOTA 1 2 second possible situation: Set group quota on the file system, edit your "fstab" file (vi / etc / fstab, add "GRPQUOTA", for example: / dev / sda6 / home ext2 defaults 1 2 (AS An Example: The Word "Defaults") / dev / DEV / DEV / DEFAULTS SDA6 / Home Ext2 Nosuid, Nodev 1 2 (AS An Example: Any Other Options You Have Set) Change to: / DEV / SDA6 / Home Ext2 Defaults, Grpquota 1 2 / DEV / SDA6 / HOME Ext2 Nosuid, Nodev, Grpquota 1 2 The third possible situation: Set the user and group quota on the file system, edit the "FSTAB" file (Vi / etc / fstab), add "USRQuota, Grpquota" after "defaults" or other settings made for the file system . For example: / dev / sda6 / home ext2 defaults 1 2 (AS An Example: The Word "Defaults") / DEV / SDA6 / HOME EXT2 NOSUID, NODEV 1 2 (AS An Example: Any Other Options You Have Set) Change to: / DEV / SDA6 / Home Ext2 Defaults, USRQUOTA, GRPQUOTA 1 2 / DEV / SDA6 / Home Ext2 Nosuid, Nodev, USRQUOTA, GRPQUOTA 1 2 Create "Quota.user" and "Quota.group" file in modification "/ etc / fstab "After the file, in order to establish Quota on the file system, there must be a" root "file with" root "in the root of the file system (" / home "): If you set the user quota, you must create" "Quota.user"; if set group quota, you must create "quota.group"; if you want to set up users and group quota, these two files are created. The first step is to set the root directory of the partition of Quota, create "quota.usr" or "quota.group" as "root": [root @ deep /] # Touch /Home/quota.user [root @Deep /] # Touch /Home/quota.group [root @ Deep /] # chmod 600 /Home/quota.user [root @ Deep /] # chmod 600 /Home/quota.group "touch" command in "/ home "Create an empty file in the directory. . The "chmod" command sets only the "root" user readable write to these files.