What are inodes and why are they important?
What are inodes and why are they important?
Inodes are the number of files that can be present in your Unix-based file system.
Inodes are short for index nodes. They are used as an identifier for metadata on a file system, this means they store permissions, file type & size, etc.
The inodes are stored on a common table and are independent from other drives so they will share a number, but a modifier will be added depending on the drive to make them unique.
How many will your system have?
The ratio generally is 1:16KB of the drive’s capacity.
How many inodes would there be on a 30/60/80/100GB drive?
- 30GB = 1,875,000
- 60GB = 3,932,160
- 80GB = 5,242,880
- 100GB = 6,553,600
What if you don’t wish to count?
Well, let me help you then!
Pull out your command line and type:
- df -i
This will list all the File Systems and the number of inodes that are:
- Present
- Used
- Free
Where do they come from?
Inodes are allocated by the system during the creation of a partition.
The more storage you assign, the more inodes you will have.
This can create issues down the line where you potentially could run out of inodes.
Other file systems would solve the “limited amount” problem by creating the equivalent to inodes dynamically as they are needed.
What do the maths say?
Theoretically, the max number of inodes is 2^32 which amounts to 4.3 billion.
Can I see what inode corresponds to a specific file?
Why yes, you can!
Try this:
- ls -i
For more information on these commands always remember the help command!
Has anyone ever run out of inodes?
Before reading this article, you might have never had to worry about their existence.
However, there are cases where you might have only used 65% of your disk space on your storage but are unable to create any new files.
An example of this happening is caching software creating over one million files.
What does running out of inodes entail?
This can create difficult situations where:
- Processes might refuse to start because a file is needed to store variables
- Data could be lost since no temporary files or output files cannot be created
- Programs could crash since new variables can’t be stored
- Scheduled tasks might not run.
- The computer might restart to delete temporary files
This is why it is important to always bear in mind what you have saved on your computer!
How do we free up some inodes?
We delete files we don’t need of course!
Here is a selection of files you can delete:
- Cache files
- Old email files
- Temporary files
If you have any more questions contact our our friendly support team!
Updated about 2 months ago