Category: Linux

If this issue appears even though you have available disk space on the system:

* #df -h

|Filesystem|Size|Used|Avail|Use%|Mounted on|
|/dev/mapper/lv_root|47G|37G|8.2G|82%|/|
|tmpfs|1004M|0|1004M|0%|/dev/shm|
|/dev/sda1|485M|52M|409M|12%|/boot|

We need to check available inodes on the server to see how many are available:

* #df -i

|Filesystem|Inodes|IUsed|IFree|IUse%|Mounted on|
|/dev/mapper/lv_root|3121152|3103813|17339|100%|/|
|tmpfs|256874|1|256873|1%|/dev/shm|
|/dev/sda1|128016|44|127972|1%|/boot|

If we see inodes are 100%, or nearly 100% used on the filesystem then this indicates there must be a large number of files on the server and we need to find them using the below command. If the below commands stuck at a folder then it will be better to run it using that absolute path.

for i in /*; do echo $i; find $i |wc -l; done

After finding the folder with large number of files delete them and this will make inodes available to the file system.

This could be php session files located in ‘/var/lib/php/session’ folder containing millions of files. To get rid of them use the following:

# Shutdown apache
---------------
service httpd stop

# Rename php session directory
---------------
mv /var/lib/php/session /var/lib/php/session.old

# Recreate php session directory and set permissions
---------------
mkdir /var/lib/php/session
chmod 1777 /var/lib/php/session

# Start Apache
---------------
service httpd start

# Delete session files
---------------
cd /var/lib/php/session.old
find |xargs rm

The above command might take a day to delete the files depending upon the number of files in that folder.

 

Tags:

Linux

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.