[Tuo original] set of disk limit: quota

zhaozj2021-02-16  128

System: Redhat Linux 8.0

Nuclear: 2.4.18-14

Quota version: 3.06-5

Step 1: Modify / etc / fstab,

Situation 1: If you want to use the / home as a quota partition, set one of the / home in / etc / fstab to:

/ dev / hda2 / home ext3 defaults, usrqouta, Grpquota 0 0

Situation 2: If you only have / and swap partitions, you can only use / to do quota (for all kinds of / partitioning to do quota), so you should do this in your / etc / fstab:

/ DEV / HDA2 / EXT3 Defaults.usrquota, Grpquota 1 1

Step 2: Generate /Home/aquota.user and /Home/aquota.group or /aquota.user and /aquota.group (7.3 do not need this step)

Touch /aquota.user /aquota.group

CHMOD 600 /AQUOTA.USER /AQUOTA.GROUP

Touch /Home/aquota.user /Home/aquota.group

CHMOD 600 /HOME/aquota.user /Home/aquota.group

Step 3: Remount you have to do, namely:

When it is a situation: use: mount -o reomunt / home can

If it is the case, you can only reboot your system. You can complete the Remount Your partition.

Step 4: Use Quotacheck to install Quotafiles to the directory of the MOUNT of your archive system, here is / home or /

Quotacheck -avug (case 1)

Quotacheck -m / then then: quotacheck -avugm (case 2)

Set the size of the disk limit for each user or group:

Edquota -u username

oral

Edquota -g Groupname

Example: Used on Server2 #: edquota -u zubin will appear as follows: The content is as follows:

Disk Quotas for User Zubin (UID 500):

FileSystem Blocks Soft Hard Inodes Soft Hard

/ DEV / HDA2 149180 0 0 39 0 0

Description:

FileSystem refers to the partition of Quota

Blocks User Zubin has used the space size, or more than 149MB, that is, the above number is in KB.

Soft Soft Limits, that is, if the user's data is in size to this value, it will warned that the user will not stop the user's own directory.

Hard hard limit size, that is, if the user's data is in size to this value, the system will not be written.

Inodes users' file limitations, including directory files, ordinary files, and more. As mentioned above, users Zubin have 39 files, including directory files, ordinary files, and more. Soft is the same, just the difference between space size and file size

HARD is the same as above

Report all current users quota:

Repquota -a

As for the definition of inodes, Henry said is as follows:

Every file in the UNIX (Linux) archive system has an inode number, inode has information about this file, such as User, Group, Access Mode, Type, etc., you can see each file with the LS -I instruction. Inode Number. How many files can you have in a file system? This depends on how many inode it can.

Everyone can be referred to by Henry and use the document or directory in your own user directory, and then use Edquota -u Username to slow down inodes.

转载请注明原文地址:https://www.9cbs.com/read-8559.html

New Post(0)