How to use Quota

xiaoxiao2021-03-06  58

Title: ◇ How to use quota

Sending station: South China University of Technology BBS Komatsu Station

Sender: "Chance" , WenUX

> ================================================================================================================================================================= ======================== <

What is quota?

Quota allows you to specify the storage restriction of the disk from two aspects: the number of index nodes (inodes) that users can dominate; and the number of disk blocks that users can take.

The meaning behind the quota is that the forces are kept under most of the time in their disk usage restrictions, canceling their ability to use the disk space in the system.

Quota is currently in Linux

Quota's support is known from the 1.3.8x version of the 1.3.8x version, and it is also in the center of version 2.0. If your system does not support quota, then I suggest you update.

So far, Quota can only operate on the EXT2 archive system.

The core 2.x version of the demand of Quota on Linux can be obtained from here

FTP: / /TSX-11.Mit.edu/pub/linux/sources/system/v2.0/

Quota software

End your Linux issued kit, may have been installed on your system or there may be no quota software. The original program code of the quota software can be obtained from here

ftp://ftp.funet.fi/pub/linux/people/linus/subsystems/quota/all.tar.gz.

-------------------------------------------------- ----------------

Set Quota on Linux - Part: Configuration

1. Configure your core

Reconfigure your core and answer Y Y to join the Quota support:

Quota Support (config_quota) [N] y

2. Compile and install quota software

The original program code of the quota software can be obtained from here

FTP: //ftp.funet.fi/pub/linux/people/linus/subsystems/quota/all.tar.gz

Although the Quota software suite mentioned above has been ported to Linux, and should be compiled on the system of executing the 2.X version; but you may encounter some troubles, the C compiler constantly complains about certain unseserive MNTOPTs. . If this problem occurs, you will have to copy its mntent.h file to /usr/include/metent.h to compile quota.

3. Modify your system's launch instruction manuscript to check Quota and open quota during startup

Here is a "example:

# Check quota and then turn quota on.

IF [-x / usr / sbin / quotacheck]

THEN

Echo "Checking Quotas. This May Take Some Time."

/ usr / sbin / quotacheck -avugecho "done."

Fi

IF [-x / usr / sbin / quotaon]

THEN

echo "Turning on Quota."

/ usr / sbin / quotaon -avug

Fi

The constant rule is * Always * I have to open the quota after you hang into your / etc / fstab * * Open quota, otherwise Quota will not work. I suggest that you open quota in your system's start-up instruction manuscript, or if you like it, open it in your system instruction manuscript to the archive system.

4. Modify / etc / fstab

Haven't enabled Quota's split area to look like:

/ DEV / HDA1 / EXT2 Defaults 1 1

/ DEV / HDA2 / USR EXT2 Defaults 1 1

To add quota on the archive system, add "USRQUOTA" in the fourth field containing the word "defaults".

/ DEV / HDA1 / EXT2 Defaults 1 1

/ DEV / HDA2 / USR EXT2 Defaults, USRQUOTA 1 1

5. Establish "quota.user" this quota record

This quota record file, quota.user, should be owned by root, and Root has read and write permissions and anyone else. Check in with root. Go to the top layer of the quota division area, and this to build quota.user:

Touch /Partition/quota.user

CHMOD 600 /PArtition/quota.user

6. Restart

Now restart the system so that the changes you make will take effect. At the same time, I only need to step 4, 5, and only step 4, 5,

And 6.

Set the quota - the second part in Linux: Specify the quota of the user to execute using the Edquota instruction. For example, the instruction of "Edquota Bob" will bring you into VI (or editor specified in your $ Editor environment variable) to edit the user "Bob" on each enabled quota split area Quota.

Quotas for User Bob:

/ DEV / HDA2: Blocks in Use: 2594, Limits (Soft = 5120, HARD = 6400)

Inodes in Use: 356, LIMITS (Soft = 1000, HARD = 1500)

"Blocks in use" is the total number of blocks that users who have used on a partial area (in kilometers)

"Inodes in use" is the total number of files owned by the user on a split area.

In addition to Edquota, there are three other special names you should be familiar with: soft restrictions, hard limits, and buffering periods.

Soft restriction

In general, the soft limitation indicates the total amount of disk used on the quota user in the divided area. However, when combined with the buffer, its action is like a critical line, and when the Quota user exceeds the warning about him is about to violate the Quota.

Hard limit

Hard limits are only operated when setting a buffer period. It pointed out the absolute limit of the amount of disk, Quota users can't surpass his hard limits. Buffer

Executed with "Edquota -t" instructions, the buffer period is a time limit before the Quota user implements soft limits. The time units that can be used are seconds, points, hours, days, weeks, and months. This is what you use "Edquota -t" instructions will be seen:

Time Units May Be: Days, Hours, Minutes, or Seconds

GRACE Period Before Enforcing Soft Limits for Users:

/ dev / hda2: Block Grace Period: 0 Days, File Grace Period: 0 days

Change the 0 days part to you feel reasonably any time limit. I personally choose 7 days

(Or 1 week).

-------------------------------------------------- ----------------

Other quota instructions

Quotacheck

Quotacheck is used to scan the file of the file system and update "quota.user" this quota record to the latest state. I recommend executing quotacheck during system starting or executing once every other period of CRonjob (like, one week?).

Repquota

Repquota generates a summary of archivesystem quota information. Here is the output of the repquota obtained here:

# repquota -a

BLOCK LIMITS FILE LIMITS

User Used Soft Hard Grace Used Soft Hard GRACE

root - 175419 0 0 14679 0 0

BIN - 18000 0 0 735 0 0

UUCP - 729 0 0 23 0 0

MAN - 57 0 0 10 0 0

User1 - 13046 15360 19200 806 1500 2250

User2 - 2838 5120 6400 377 1000 1500

Quotaon and Quotaoff

Quotaon is used to open the calculation of Quota; Quotaoff is turned off. In fact, both are very similar. They are executed when the system starts with the shutdown.

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

New Post(0)