Quota Disk Quota Experiment

Source: Internet
Author: User

I. Prepare partitions

/Dev/hda1 (ext2/ext3 format)

2. Prepare the user directory

Add User u1, U2

# Useradd u1

# Passwd u1

# Useradd U2

# Passwd U2

Iii. Mount

(1) manual mounting

Mount-O usrquota, maid/dev/hda1/mnt/hda1

(2) automatic mounting

# Vi/etc/fstab

Add

/Dev/hda5/mnt/hda5 ext3 defaults, usrquota, kgquota 0 0

Iv. Directory preparation

# Mkdir/mnt/hda5/u1dir

# Mkdir/mnt/hda5/u2dir

# Chown u1.u1 u1dir

# Chown u2.u2 u2dir

5. Create a quota database file

(1) manually create

# Touch/mnt/hda5/aquota. USR

# Touch/mnt/hda5/aquota. Group

(2) Automatic Creation

# Quotacheck-cvuga

6. Edit the quota database file

# Edquota u1

# Edquota U2

Requirements: U1 space limit: soft limit 8 K, hard limit 12 K

U1 file limit: soft limit 3, hard limit 5

U2 space limit: 12 K soft limit and 24 k hard limit

U1 file limit: soft limit 6, hard limit 10

7. Enable quota

# Quotaon-

8. Verification

Log On With U1 and U2 respectively

U1 Logon

$ Quota view quota

$ CD/mnt/hda5/u1

$ Echo "hi"> file1

$ Echo "hi"> file2

$ Echo "hi"> file3

At this time, a message will be prompted, indicating that the U1 user's space usage restrictions start warning.

In addition, the content in file3 is empty because the hard space limit of 12 KB is used up.

$ Quota U1 check the latest status

$ Echo "hi"> file4 file4 content is blank

$ Echo "hi"> file5

An error occurred while creating the file5 file. The message "the disk quota is used up" is displayed"

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.