There are no free file system inodes left

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 3
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • EXT3, EXT4 file systems

Issue

  • My file system has plenty of space left, but I'm getting errors about a lack of inodes. How do I detect and fix this?

Resolution

  • A new file system can be created with a higher inode to space ratio by using the -i* option in **mke2fs command:

    -i bytes-per-inode
        Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode bytes of space on the disk.  
        The larger the bytes-per-inode ratio, the fewer inodes will be created.  This value generally shouldn't be 
        smaller than the blocksize of the filesystem, since in that case  more inodes would be made than can ever be 
        used.  Be warned that it is not possible to expand the number of inodes on a filesystem after it is created,
        so be careful deciding the correct value for this parameter.
    
  • Determine what is creating all the small files, and delete them if that is practical.

  • Add additional space to the device. The ratio will stay the same, but additional inodes will be added to the file system.

Root Cause

  • Each file and folder uses an inode. When the file system is created, a specific block of inodes is created for that file system. If many small files are present, this can cause the pool of inodes to be consumed prematurely.
    The number of used/free inodes can be seen here:

    # df -i /dev/(device)
    
  • Additional information about inode size and pool can be seen by using dumpe2fs:

    # dumpe2fs /dev/(device) |grep ^Inode 
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

1 Comments

Hello folks

To collect information from XFS, you can use

# xfs_info <mount point>

Then we will be able to see something like below in order to collect some additional information:

# xfs_info /
meta-data=/dev/mapper/rhel_sat64-root isize=512    agcount=4, agsize=12664320 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=50657280, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=24735, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0