Linux disk full errors but disk has space
Desktops, Filesystems, Linux, Servers, Slider September 9, 2014 , by Mark Walker No Comments on Linux disk full errors but disk has spaceToday I had a customer reporting a wordpress error when uploading images. "Missing a temporary folder"
Checked file permissions on /tmp – they were fine.
But is /tmp the location of the temporary folder for the site? Went to add a new file for a quick php_info(); and got a "disk space full error". Ahhh, that explains it.
Run "df -h" to check diskspace and the drives were between 0% – 18% full, loads of space.
But knowing the way that linux file systems work having encountered this issue before I know the problem and the solution.
Inodes
Inodes are a finite resource on most linux file systems which limit the total maximum number of files.
They work in a similar way to an index or table of contents at the start of a book.
Both the book and the index were created at the same time, completely empty but with a suitable number of index entries (inodes) for the pages (files) in the book.
On a normal system you run out of disk space well before you run out of inodes – this server had 38GB diskspace and 4.9 million inodes meaning an average file size of 7.7KB would fill disk and inodes perfectly.
But if you get a server with an unusually large number of extremely small files the inodes limit can be an issue.
Increasing inode limits will normally require reformatting the disk so not good for a production machine – so the fix is to delete files.
First I located the source of the majority of files (inodes).
cd /
for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10
This showed I had 4.7M inodes in /var
cd var
for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10
The files were all in /var/spool
cd spool
for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10
/var/spool/exim4 was the culprit with 95% of my available inodes in use.
I didn't use exim4 on this server, it got installed as a dependency of something else I was using, so fine to go ahead and clear them all.
rm -f exim4
Waiting, waiting and waiting. I probably would have got a "too many arguments" error but didn't wait that long.
cd exim4
find . -type f -print -delete
Using find worked more reliably and was less resource intensive when it comes to deleting a few million files.
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 4980736 217861 4762875 5% /
Problem solved!
- The Quintessence of Cybersecurity and Stellar IT Support - November 9, 2023
- Choosing the Right Payment Processor for Your Website - March 3, 2022
- Choosing a business management system - June 11, 2020
Related Articles
-
-
A Brief Analysis Of The Best Linux Operating Systems
December 19, 2014
-
Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
Top Trends Dominating The World Of SEO
December 10, 2014
-
Why Does Everybody Love Docker?
November 28, 2014
Latest Reports
-
1 Upgrading to WordPress 4.5
May 5, 2016 -
2 WordPress Plugins
January 26, 2016 -
3 What Are CMS Platforms And How Do You Choose The Right One?
November 19, 2014 -
4 How To Create A Successful Website On A Budget
November 18, 2014
-
1 Choosing the Right Payment Processor for Your Website
March 3, 2022 -
2 How To Write An Excellent Product Review
December 26, 2014 -
3 Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
4 Tips You Need To Know About Web Hosting
November 26, 2014 -
5 The Biggest Websites In The World Today
November 23, 2014
-
1 Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
2 A Review Of 3 Web Design Software Packages For Beginners
December 5, 2014 -
3 Four Fantastic Tips For Web Development
November 24, 2014 -
4 What Are CMS Platforms And How Do You Choose The Right One?
November 19, 2014 -
5 How To Create A Successful Website On A Budget
November 18, 2014
-
1 Why Does Everybody Love Docker?
November 28, 2014 -
2 Tips You Need To Know About Web Hosting
November 26, 2014 -
3 Clearing postfix mail queue by domain
September 9, 2014 -
4 Linux disk full errors but disk has space
September 9, 2014
Leave a comment
You must be logged in to post a comment.