Error: "no space available" on XFS filesystem

  • 7014318
  • 18-Dec-2013
  • 18-Dec-2013

Environment

Novell Open Enterprise Server 2 (OES 2) Linux
Novell Open Enterprise Server 11 (OES 11) Linux
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 11

Situation

When trying to add a new file to an XFS mounted filesystem, the error "no space available" is returned.  This is despite there being over 15% disk space available (as reported by df).  The methods tried for creating a file was touch filename and vi filename.

If a file or two were removed, a new file (or two) could be created.

Resolution

Here are some possible resolutions:

a) change to inode64 structure on the XFS filesystem
    For more information on inode64, see the XFS.org site at http://xfs.org/index.php/XFS_FAQ#Q:_What_is_the_inode64_mount_option_for.3F

b) create significant free space on the filesystem either by adding space or removing files.

Additional Information

By default, XFS filesystems are created with inode32 structure meaning that all of the inodes for a given filesystem need too be created in the first 1TB (or imaxpct %) of the filesystem.  If the filesystem contains a large number of small files, it is easy to run out of inodes and run into this problem.  Switching to inode64 can help as more Allocation Groups (AGs) can be utilized to store inodes.

In the case of a filesystem already running inode64, this error can be encountered if the filesystem does run low/out of disk space -- or if it cannot allocate 4 contiguous blocks for additional inodes.  So if the filesystem is severely fragmented -- meaning only 1-3 blocks are together -- you will not be able to create new files but can write additional data to older files.

For further information on identifying how fragmented the free space is, please see TID 7014320 - How to tell how fragmented the free space on an XFS filesystem

If your filesystem is severely fragmented, you can either:
  • add a significant amount of free space (i.e. 20% or more)
  • move the data to a different filesystem and then copy it back.
    this will remove the free blocks between files and make it contiguous.  You will find this most helpful for filesystems that store files that are <= 4,096 bytes.