Disk Quota under LIUNX

Source: Internet
Author: User
Disk Quota under LIUNX-general Linux technology-Linux technology and application information. The following is a detailed description. Mkfs. ext3/dev/sda1 Format this partition.

1 mount/dev/sda1/mnt/d1-o usrquota, kgquota

/Dev/sda2 on/type ext3 (rw) will appear in 2mount)
None on/proc type proc (rw)
Usbdevfs on/proc/bus/usb type usbdevfs (rw)
None on/dev/pts type devpts (rw, gid = 5, mode = 620)
None on/dev/shm type tmpfs (rw)
/Dev/sda1 on/mnt/d1 type ext3 (rw, usrquota, kgquota)

3 more/etc/mtab

None/proc rw 0 0
Usbdevfs/proc/bus/usb usbdevfs rw 0 0
None/dev/pts devpts rw, gid = 5, mode = 620 0 0
None/dev/shm tmpfs rw 0 0
/Dev/sda1/mnt/d1 ext3 rw, usrquota, kgquota 0 0

4 quotacheck-cvuga a can also replace c with/dev/sda1 to create a database. v to create a database.
Detailed procedures of the database u all partitions of user g Group
Will appear
Quotacheck: Scanning/dev/sda1 [/mnt/d1] done
Quotacheck: Checked 2 directories and 0 files
Quotacheck: Old file not found.
Quotacheck: Old file not found.

5 ls/mnt/d1 are there any of the two files aquota. group aquota. user

6. Restart or quotaon-a indicates that all partitions can be activated./dev/sda1 can be used to replace-.

7 edquota-u zuan (User)
Appears:
Disk quotas for user bdyd (uid 504 ):
Filesystem blocks soft hard inodes soft hard
/Dev/sda1 0 0 0 0 0 0

The number of blocks currently used by blocks. Soft (soft limit) indicates how many "MB" to be reached, and how many days to be passed
If it is lower than soft limit, hard cannot write data if it exceeds this limit.

Inodes (node) is equivalent to the number of files that can be keys currently. Soft refers to how many files are created and how many days are required
The folder cannot be created if the hard limit is lower than the soft limit. Wq!

8 mkdir/mnt/d1/zuan

9 chown zuan/mnt/d1/zuan

Test:

10su-bdyd

11 quota viewing
Appears
Filesystem blocks quota limit grace files quota limit grace
/Dev/sda1 1 1024 4096 1 2 4


12 ls-ld
Drwx ------ 2 bdyd root 4096 Dec 29.

13 dd if =/dev/zero of = file1 bs = 1 k count = 1024

14 dd if =/dev/zero of = file2 bs = 1 k count = 1024

15dd if =/dev/zero of = file3 bs = 1 k count = 1024

16dd if =/dev/zero of = file4 bs = 1 k count = 1024

The words exceeding the quota will appear.
We can change it to the Chinese LANG = zh_CN.utf.8

Make the size and quota the same, and then create this file. It is 0 bytes in size.

Exit to root

Quota-u bdyd to view the usage of the user's hard disk space.

Repquota-a prints the size of all users.

Edquota-t is used to modify the expiration time.

Quotaoff/mnt/d1 to remove the disk quota.

To delete a quota database, quotaoff/mnt/d1 and rm-rf/mnt/d1/aquota must be performed first .*

Quotaon-a activation

Write/etc/fstab

/Dev/sda1/mnt/d1 ext3 defaults, usrquota, kgquota 0 0
Related Article

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.