How to set a disk quota in Linux

Source: Internet
Author: User
Article Title: how to set a disk quota in Linux. 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.
Purpose: to limit the number of disk space or files that a specified user (FTP user, Sambapcguest account, and Appletalk user) can own on your server.
By default, Redhat Linux has no restrictions.
Software Environment: Redhat Linux 5.2 Implementation method:
  
1. check your/etc/fstab. assume that the file without quota is not set as follows.
/Dev/hda1/ext2 defaults 1 1
/Dev/hda2/home ext2 defaults 1 2
/Home is a separate partition.
  
2. to set the disk space occupied by jephe in the/home/jephe Directory, first change/etc/fstab to the following:
/Dev/hda1/ext2 defaults 1 1
/Dev/hda2/home ext2 defaults, usrquota 1 2
  
3. log on as root and create the empty file quota. user # touch/home/quota. user # chmod 600/home/quota. user in the partition directory where quota needs to be set.
  
4. restart the server
  
5. allocate the disk quota and the maximum number of files to the specified user.
# Edquota-u jephe
Quota for user jephe
/Dev/hda2: blocks in use: 0, limits (soft = 5000, hard = 6500)
Inodes in use: 356, limits (soft = 1000, hard = 1500)
You only need to change the limits.
  
Note:
1. when editing/etc/fstab, note that it is usrquota, not userquota.
2. you can view a user's disk quota, such as # quota jephe
  

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.