The Xfs_quota of RHEL7

Source: Internet
Author: User

XFS is a highly scalable, high-performance file system. is also the default file system for RHEL7/CENTOS7.

XFS supports metadata journaling, which allows it to recover more quickly from the crash.

It also supports defragmentation and scaling in a state of mount and activity.

By delaying allocation, XFS has won many opportunities to optimize write performance.

The XFS file system can be backed up and restored through tools Xfsdump and Xfsrestore,

Xfsdump can use the dump level to complete incremental backups, and can also exclude files by Size,subtree,inode flags.

User, group, project quotas are also supported.


Mount the XFS system partition to the specified directory and open the file system quota via the parameter Uquota,gquota.


* 1, do not need to manually perform Quotacheck to the XFS file system to check, it will be automatically executed at Mount

* 2, do not need to generate Quato files under the root of the XFS file system

* 3, quota limit cannot be set before quota is enabled



[Email protected] ~]# Mkdir/lvquota

[Email protected] ~]# Mount-o usrquota,gquota/dev/vg/lv_quota/lvquota/

[Email protected] ~]# chmod 777/lvquota/

[Email protected] ~]# chmod o+t/lvquota/

[email protected] ~]# Mount | grep lv_quo

/dev/mapper/vg-lv_quota On/lvquota type XFS (Rw,relatime,seclabel,attr2,inode64,usrquota,grpquota)


###############################################################################

Use the Xfs_quota command to view quota information and to assign quotas to users and directories, and to verify that the quota limit is in effect.


-X Expert Mode

-C admin Command (Info xfs_quota-->> "ADMINISTRATOR COMMANDS with all instructions")

[[email protected] ~]# Xfs_quota-x-C ' report '/lvquota/

User Quota On/lvquota (/dev/mapper/vg-lv_quota)

Blocks

User ID used Soft hard Warn/grace

---------- --------------------------------------------------

Root 0 0 0 [--------]


Group Quota On/lvquota (/dev/mapper/vg-lv_quota)

Blocks

Group ID used Soft hard Warn/grace

---------- --------------------------------------------------

Root 0 0 0 [--------]

Davis 25600 0 0 xx [--------]



[[email protected] ~]# xfs_quota-x-C ' limit bsoft=20m bhard=25m Davis '/lvquota/

[[email protected] ~]# Xfs_quota-x-C ' report '/lvquota/

User Quota On/lvquota (/dev/mapper/vg-lv_quota)

Blocks

User ID used Soft hard Warn/grace

---------- --------------------------------------------------

Root 0 0 0 [--------]

Davis 25600 20480 25600 [6 days]


Group Quota On/lvquota (/dev/mapper/vg-lv_quota)

Blocks

Group ID used Soft hard Warn/grace

---------- --------------------------------------------------

Root 0 0 0 [--------]

Davis 25600 0 0 xx [--------]


[email protected] lvquota]$ LL

Total 15360

-rw-rw-r--. 1 Davis Davis 15728640 Jan 6 09:36 Davis.disk

[Email protected] lvquota]$ Du-sh Davis.disk

15M Davis.disk

[[email protected] lvquota]$ dd If=/dev/zero of=davis.disk1 bs=1m count=15

Dd:error writing ' Davis.disk1 ': Disk quota exceeded

11+0 Records in

10+0 Records out

10485760 bytes (Ten MB) copied, 0.0122207 s, 858 MB/s

[Email protected] lvquota]$ Du-sh Davis.disk1

10M Davis.disk1


[Email protected] lvquota]$ Xfs_quota

Xfs_quota> Help

DF [-bir] [-HN] [-f file]-show free and used counts for blocks and inodes

Help [command]--commands

Print--list known mount points and projects

Quit-Exit the program

quota [-bir] [-GPU] [-HNNV] [-f file] [Id|name] ...--show usage and limits


Use "Help CommandName" for extended help.

xfs_quota> Print

Filesystem Pathname

//dev/sda3

/xfs/dev/mapper/vg-lv_xfs

/boot/dev/sda1

/lvquota/dev/mapper/vg-lv_quota (Uquota, Gquota)

Xfs_quota> Quota-u Davis

Disk quotas for User Davis (3000)

Filesystem Blocks Quota Limit warn/time mounted on

/dev/mapper/vg-lv_quota

25600 20480 25600 [6 days]/lvquota

Xfs_quota>





To view Xfs_quota's Help file, you can see some relevant examples:




EXAMPLES

Enabling quota enforcement on an XFS filesystem (restrict a user to a

Set amount of space).


# Mount-o Uquota/dev/xvm/home/home

# xfs_quota-x-C ' limit bsoft=500m bhard=550m Tanya '/Home

# Xfs_quota-x-C Report/home


Enabling project quota on a XFS filesystem (restrict files in log file

directories to only using 1 gigabyte of space).


# Mount-o Prjquota/dev/xvm/var/var

# echo 42:/var/log >>/etc/projects

# echo logfiles:42 >>/etc/projid

# xfs_quota-x-C ' project-s logfiles '/var

# xfs_quota-x-C ' limit-p bhard=1g logfiles '/var


Same as above without a need for configuration files.


# rm-f/etc/projects/etc/projid

# Mount-o Prjquota/dev/xvm/var/var

# xfs_quota-x-C ' project-s-p/var/log '/var

# xfs_quota-x-C ' limit-p bhard=1g '/var


This article is from the "Sea of Boundless" blog, please be sure to keep this source http://plong.blog.51cto.com/3217127/1599557

The Xfs_quota of RHEL7

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.