increase inodes in linux ext4 file system

inode

= data structure containing information about files.
= the inode number is an integer unique to the volume
= inodes point to blocks that make up a file and also contain the metadata of the file.

Warning: once the number is increased you can never reduce it
as new files are created, the file system consumes the additional disk space required to hold the inodes for the
additional files, there is no way for the storage system to release that disk space.

If you are keeping huge number of small files in your disks, this may one day cause running out of available inodes because of which even though you might have sufficient disk space, file system cannot create new files. Lets see how it works in my 1GB disk partition.

The parameter “-i” allows us to play with the number of inodes we can have in a partition. It is called “bytes-per-inode”. The bigger it is less number of inodes you will have. I have set a relatively big size “163840″ bytes per inode and the result is I have 6768 inodes. What this means indeed is I can’t create more than 6768 file.

In order to increase the number of inodes, format the partition again and specify the size.

#mkfs.ext3 -i 163840 /dev/sdb1

In order to check,use the command:
#df -i


The -i options specifies the size of the inode, not how many there are.
The -N option sets the number inodes

snapshots share inodes with live system files so snapshots shoud be deleted if present to free inodes

No comments:

Post a Comment