Operating System - Linux
1752323 Members
5453 Online
108786 Solutions
New Discussion юеВ

Re: File System inode 100%, not able to create directory

 
SOLVED
Go to solution
Indrajit Bhagat
Regular Advisor

File System inode 100%, not able to create directory

Hi Team.

One of our root file system inode get 100%
[root@ljcqs117 ~]# df -ki .
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 3653632 3653632 0 100% /


we are not able to create any directory on this file system, Please suggest what next can be done.

The file system size is still 92%

[root@ljcqs117 ~]# df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 28755548 25021300 2273540 92% /


Thanks to all in advance.. Will give 10 points for each reply.
9 REPLIES 9
Chhaya_Z
Valued Contributor
Solution

Re: File System inode 100%, not able to create directory

Hi,

whats the output of #df -h?
And how large is /var/log ?
Regards,
Chhaya

I am an HP employee.
Was this post useful? - You may click the KUDOS! star to say thank you.
Indrajit Bhagat
Regular Advisor

Re: File System inode 100%, not able to create directory

[root@ljcqs117 ~]# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 24G 2.2G 92% /


[root@ljcqs117 /]# du -h /var/log
8.0K /var/log/samba
24K /var/log/cups
8.0K /var/log/ppp
4.0K /var/log/sa
8.0K /var/log/audit
8.0K /var/log/squid
16K /var/log/mail
8.0K /var/log/vbox
13M /var/log/httpd
86M /var/log
Indrajit Bhagat
Regular Advisor

Re: File System inode 100%, not able to create directory

Please help me out..
Chhaya_Z
Valued Contributor

Re: File System inode 100%, not able to create directory

Hi Indrajit,

The below Redhat KB article has the information about inode usage reaches 100%

https://access.redhat.com/kb/docs/DOC-1928

As per the above article:

To increase the total number of inodes, here are two suggestions:


1.If the file system is built on LVM, so increasing the size of the Logical Volume increases the total number of inodes without changing the inodes-per-bytes ratio.

2.BACKUP the files and recreate the file system with a different bytes-per-inode ratio (and block size if necessary). For example, the following command can create a file system with the number of inodes 2 times the default

WARNING : IT WILL DESTROY DATA ON /DEV/XXX PARTITION

# mke2fs -b 2048 -i 4096 /dev/xxx
Regards,
Chhaya

I am an HP employee.
Was this post useful? - You may click the KUDOS! star to say thank you.
Chhaya_Z
Valued Contributor

Re: File System inode 100%, not able to create directory

This Article has more information on inodes

https://access.redhat.com/kb/docs/DOC-34635

This article has information on how to calculate the inode ratio and how to increase the number of inode on file system.
Regards,
Chhaya

I am an HP employee.
Was this post useful? - You may click the KUDOS! star to say thank you.
Tim Nelson
Honored Contributor

Re: File System inode 100%, not able to create directory

or move stuff out of your root partion into a separate filesystem.

Matti_Kurkela
Honored Contributor

Re: File System inode 100%, not able to create directory

The root filesystem is on /dev/sda1, and is 28 gigabytes in size. Do you have any other filesystems at all?

Does /dev/sda2 exist? Is it your swap partition, or something else? Is there any unallocated space on /dev/sda? (Please show the output of "fdisk -l /dev/sda".)

When the inodes on a filesystem are 100% used, no new files or directories can be created. For the ext2/ext3/ext4 filesystems, the ratio of inodes per unit of disk space is chosen at filesystem creation time and cannot be changed afterwards without completely reinitializing the filesystem. (And since that's your root filesystem, it might be easier to backup everything, reinstall the OS with a better-planned filesystem layout, then restore.)

Because the inode ratio is fixed, extending the filesystem will also create new inodes. (But because you aren't using LVM and this is the first filesystem on the disk, extending the filesystem might be difficult.)

The default inode ratio is one inode per 16 Kbytes of disk space. The fact that you've run out of inodes while still having some disk space indicates your average file size is less than 16 Kbytes, i.e. you have a *lot* of tiny files lying around somewhere. This is probably a symptom of an application malfunction or some other problem.

This command will list 20 largest directories on the root filesystem:

du -kx / | sort -rn | head -20

If you run it, what does it say? (Can you even run it with the current situation?)

If the largest directories contain application data files, find someone who understands how the application works. Have him/her examine if the accumulated files are normal and necessary. Clean up if possible.

Your /var/log seems fairly normal in size.

Look into /var/mail and sub-directories of /var/spool: these might be common trouble spots.

If you find a huge number of small files in /var/spool/mqueue, it means you may have a problem with your Mail Transfer Agent (= usually sendmail in RHEL 5 and older, other distributions may use other software). Most likely it's a mis-configuration, perhaps made worse by a spammer attack. It could also be an often-repeating cron job that is trying to send an error message by email to and address that no longer exists. Identify the root cause, clean up the queue, then fix the root cause.

For the future, start planning a better filesystem configuration for this system.

If the application tends to produce an unlimited number of small files, you should plan for creating a separate filesystem for it: it can still fill to 100%, but it will no longer paralyze the rest of the system, and a separate filesystem will be easier to expand.

MK
MK
Viktor Balogh
Honored Contributor

Re: File System inode 100%, not able to create directory

Hi Indrajit,

As the filesystem space usage is also almost at 100%, I would suggest to extend the filesystem.

But before extending, take a look at the files what you are storing in the root filesystem. This place is meant only for system files, and not application data. For an application you should create a separate filesystem to keep things clean and separate.

So if you found some application which uses the root filesystem, you can ask for downtime, order some new disks/luns and migrate that app offline to a new filesystem. This way you don't need to extend your root filesystem.

Regards,
Viktor
****
Unix operates with beer.
Dennis Handly
Acclaimed Contributor

Re: File System inode 100%, not able to create directory

If you find lots of small files that you want to keep, you can tar them up into one big file.