Configuration of the AIX Disk Quota

Source: Internet
Author: User

Operating system version:

Testterm1:/# oslevel-r

5300-00


Disk quota system, which is based on the Berkeley disk quota system, provides an effective way to control the use of disk space. Defines the quota system for individual users or groups and maintains the quota system for each category of file systems.

The disk quota system creates a quota based on the following parameters. You can use the eduqota command to change these parameters:

. Soft quota of users or groups

. User or group hard quota

. Extended quota


1. Enable users and group quotas for a file system and use the chfs command. This document uses the/home file system as an example)

Testterm1:/# chfs-a "quota = userquota, groupquota"/home

The above command adds the quota field in the/etc/filesystems file/home file system definition section, as shown in the red section below:

/Home:

Dev =/dev/hd1

Vfs = jfs

Log =/dev/hd8

Mount = true

Check = true

Vol =/home

Free = false

Quota = userquota, groupquota


2. Specify the disk quota file name

The file names of quota. user and quota. group are default names and are located in the root directory of the mounted Disk quota file system.

Testterm1: // # chfs-a "userquota =/home/myquota. user"-a "groupquota =/home/myquota. group"/home

The above command adds the userquota and groupquota fields in the/etc/filesystems file/home file system definition section, as shown in the red section below:

/Home:

Dev =/dev/hd1

Vfs = jfs

Log =/dev/hd8

Mount = true

Check = true

Vol =/home

Free = false

Quota = userquota

Userquota =/home/myquota. user

Groupquota =/home/myquota. group


3. Generate Disk Quota files

Testterm1:/home # quotacheck-a-v

* ** Checking user and group quotas for/dev/hd1/home)

Creating quota file/home/myquota. user

/Home: root fixed: inodes 0-> 784 blocks 0-> 2100834

/Home: bin fixed: inodes 0-> 1 blocks 0-> 1

/Home: guest fixed: inodes 0-> 1 blocks 0-> 1

/Home: netinst fixed: inodes 0-> 20 blocks 0-> 57

/Home: hlrterm fixed: inodes 0-> 493 blocks 0-> 42386

/Home: quan fixed: inodes 0-> 2 blocks 0-> 2

/Home: 1000 fixed: inodes 0-> 111 blocks 0-> 1234

/Home: 4050-109 User id 4294967294 nobody) is too large, quotas are not maintained

Creating quota file/home/myquota. group

/Home: system fixed: inodes 0-> 787 blocks 0-> 2100853

/Home: staff fixed: inodes 0-> 22 blocks 0-> 58

/Home: bin fixed: inodes 0-> 1 blocks 0-> 1

/Home: usr fixed: inodes 0-> 1 blocks 0-> 1

/Home: hlrterm fixed: inodes 0-> 490 blocks 0-> 42368

/Home: 513 fixed: inodes 0-> 111 blocks 0-> 1234

/Home: 4050-109 User id 4294967294 nobody) is too large, quotas are not maintained

The myquota. user and myquota. group files are generated in the root directory of the/home file system:

Testterm1:/home # ls-l/home/myquota *

-Rw-r ----- 1 root system 16448 Aug 15/home/myquota. group

-Rw-r ----- 1 root system 32032 Aug 15/home/myquota. user

After each quota Configuration modification, you must run the quotacheck-a-v command.


4. Set the disk quota to take effect for a user. This document uses the quan user as an example)

Testterm1:/# edquota-u quan

Modify the corresponding value, save and exit.

Note: The-g parameter is available for the Group.


5. view the user's disk quota in a file system. This document uses the/home file system as an example)

Testterm1:/# repquota-u/home

Block limits File limits

User used soft hard grace

Root -- 2100834 0 0 784 0 0

Bin -- 1 0 0 1 0 0

Guest -- 1 0 0 1 0 0

Netinst -- 57 0 0 20 0 0

Hlrterm -- 42386 0 0 493 0 0

Quan -- 2 10240 10290 2 5 55

1000 -- 1234 0 0 111 0 0

The above results show that the disk quota of the quan user is KB (10 MB), and a maximum of five files can be created.

Note: The-g parameter is available for the Group.


6. Automatically detect and enable the disk quota after the system starts.

Modify the/etc/rc file and add the following lines at the end:

Echo "Starting Disk Quota Service... "

/Usr/sbin/quotacheck-

/Usr/sbin/quotaon-

Echo "Disk Quota started! "


7. Copy the user's disk quota Configuration

To create a quota for user test, use the quota already set for user quan as the prototype. You can enter:

Testterm1:/# edquota-u-p quan test

Check whether the replication is successful:

Testterm1:/# repquota-u/home

Block limits File limits

User used soft hard grace

Root -- 2100834 0 0 784 0 0

Bin -- 1 0 0 1 0 0

Guest -- 1 0 0 1 0 0

Netinst -- 57 0 0 20 0 0

Hlrterm -- 42386 0 0 493 0 0

Test -- 2 10240 10290 2 5 55

Quan -- 2 10240 10290 2 5 55

1000 -- 1234 0 0 111 0 0

The red part shows that the disk quota has been copied successfully.


8. make quota take effect

Quotaon/home


Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html


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.