Hongqi 3.0Server service configuration tutorial quota (Disk quota)

Source: Internet
Author: User
Article Title: Hongqi 3.0Server service configuration tutorial quota (Disk quota ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Rpm-qi quota; run this command to check whether quota has been installed.
The ext2 file system must be used to support quota. Other file systems such as Raiserfs do not support quota. However, on ext3, I have not tried to support the ext3 File System on Hongqi 3.0.
  
Okay. Let's get started!
1. edit/etc/fstab
Before Modification
/Dev/hda4/ext2 defaults 1 1
/Dev/hda1/boot ext2 defaults 1 2
/Dev/hda3/home ext2 defaults 1 2
We want to enable the quota support on/home to make the following modifications:
/Dev/hda4/ext2 defaults 1 1
/Dev/hda1/boot ext2 defaults 1 2
/Dev/hda3/home ext2 defaults, usrquota 1 2
Note that in the above section, we add usrquota after ults instead of userquota, which is used to quota the file system, if you want to enable the support for user groups in the file system, you can modify it to either Either either by using the or following it. For details, see
/Dev/hda3/home ext2 defaults, MAID 1 2
Or both.
/Dev/hda3/home ext2 defaults, usrquota, kgquota 1 2
This is the first step. This is the foundation. Only the support of the file system can enable quota.
After modification, you 'd better restart the file system and make the corresponding updates.
  
2. Create aquota. user and aquota. group
These two file names are different from previous versions. We can use
Quotacheck-avug; scans the file system directories supported by quota and automatically creates
Two files, aquota. user or aquota. group, can be found in the/home directory.
3. the user's use of the disk's edquota tool is actually calling the vi editor.
Edquota-u guest; you can modify the space that can be used by the guest user.
You can see the following information:
Edit block and inode quota for user guest:
Device/dev/hda3 (/home ):
Used 36KB, limits: soft = 0 hard = 0 # The total number of blocks Used is limited in the unit of data blocks.
Used 4 inodes, limits: soft = 0 hard = 0 # limit the total number of files owned by the user
  
Appendix
Data block calculation method: for example, if a partition starts from block 1 to block 505 and the size of each block is 1024 bytes, 505*1024 = 524916 blocks can be calculated, for a total of 512 KB, that is, 505 MB, we can write in soft or hard. Users can only use MB space!
Soft limit: indicates the size of the space that the user has in the partition.
Hard limit: indicates the absolute limit on the hard disk space. It runs only when the buffer is set.
My settings are as follows:
Edit block and inode quota for user guest:
Device/dev/hda3 (/home ):
Used 36KB, limits: soft = 505 hard = 505 # The total number of blocks Used is measured in data blocks.
Used 4 inodes, limits: soft = 365 hard = 365 # limits the total number of files owned by users
  
After editing
Use: wq to save and exit
  
Good! Done! This restricts the hard disk space that the user guest can use on the server!
  
4. Some useful commands with quota
Quota
Root can use repquota-a to view the usage of all users in the current system
  
  

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.