Disk Quota for linux disk Management 2

Source: Internet
Author: User

Stat/etc/passwd to view the file information,

The field Access time (Access time) file data is updated after each read,

The field Chage time (Change time) file inode information is updated after each change

The field Modify time (modification time) file data is updated after each change.

Ls-l/etc/passwd

-Rwx ------. root 1704 January 10 08:44/etc/passwd

I:

. Point indicates that the file has a seliunx flag. Only a specific process with the same flag can use the file.

Ls-Z/etc/passwd to view hidden flag.

Linux uses device files to operate hardware. The device files/dev/sda1 have

Brwx ------ 1 root disk 8, January 11 08:01/dev/sda1

8 indicates the master device number and identifies the device type.

1 indicates the next device number, indicating the Partition Number

In linux, the primary and secondary device numbers are used to identify various hardware resources. You can run the mknod command to create device files.

Format: mknod/mydisk B 8 3

2. Run the blkid command to view the UUID and signature of all partitions.

Run the lsblk command to view information about each partition.

Run the tune2fs-L label/dev/sda1 command to modify the partition label name.


Iii. Disk Quota

Use the quota command to implement disk quotas,

Step 1: Add quota support, usrquota, and kgquota to the Mount Option bar of/etc/fstab.

Step 2: quotacheck-avug/dev/sdb2-a indicates that all-v indicates that the displayed details-u indicates that user-g is the group. After execution, two data files are automatically generated in the quota partition, one for the quota of a single user and the other for the group quota.

Step 3: Use quotaon-ugv/mail to enable user and group quotas. Quotaoff-ugv/mail disable the quota function.

Edit the quota color settings for users and group accounts

Edquota-u username: edit user quota

Edquota-g groupname: quota of the editing group.

Quota table fields

Filesystem blocks soft hard inode soft hard

/Dev/sdb1 0 10 80 0 23 29

The disk quota can be limited in two aspects: the block size and the number of files.

The soft field indicates the soft limit. If the limit is exceeded, a warning is issued.

Hard field indicates a hard limit, which cannot be exceeded

The blocks field only specifies the number of blocks currently used. inode indicates the number of blocks currently used,

We only need to modify the soft and hard values to limit the quota. The unit of block is k,

Quota directly using commands

Setquota-u username (blocks) soft (blocks) hard/dev/sdb2

Replication quota: new user of the edquota-p template. Implement automatic quota.





















Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.