XFS quota is showing incorrect space usage.

Solution Verified - Updated -

Issue

After the XFS quotas are defined for some directories, the command xfs_quota can be used to check the current status:

  # xfs_quota -x -c 'report -h'
  Project quota on /data (/dev/mapper/vg_rhel-lv_data)
                          Blocks              
  Project ID   Used   Soft   Hard Warn/Grace   
  ---------- --------------------------------- 
  dir_01          0      0   100G  00 [------]
  dir_02          0      0   500G  00 [------]
  dir_03          0      0   500G  00 [------]

As files are created on the directories it's possible to see the change on quota usage:

  # fallocate -l 50G /data/dir_01/file

  # fallocate -l 60G /data/dir_02/file

  # fallocate -l 70G /data/dir_03/file 


  # xfs_quota -x -c 'report -h'
  Project quota on /data (/dev/mapper/vg_rhel-lv_data)
                          Blocks              
  Project ID   Used   Soft   Hard Warn/Grace   
  ---------- --------------------------------- 
  dir_01        50G      0   100G  00 [------]
  dir_02        60G      0   500G  00 [------]
  dir_03        70G      0   500G  00 [------]

However if a new file is created directly on /data, the amount of data written is being shown as part of /data/dir_01:

  # fallocate -l 70G /data/otherfile

  # xfs_quota -x -c 'report -h'
  Project quota on /data (/dev/mapper/vg_rhel-lv_data)
                          Blocks              
  Project ID   Used   Soft   Hard Warn/Grace   
  ---------- --------------------------------- 
  dir_01     120.0G      0   100G  00 [-none-]  <---
  dir_02        60G      0   500G  00 [------]
  dir_03        70G      0   500G  00 [------]

Environment

  • Red Hat Enterprise Linux (RHEL) 6, 7
  • xfsprogs

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content