Tips&Tricks

How To Fix “No Space Left On Device” When Disk Is Not Full?

We faced the problem mentioned in the title, and we found out the solution. We are more than glad to share it here with you. Enjoy the reading, check the rest of our blog posts, and may the power of our solutions be with you.

Error?

Do you know the feeling when your server starts to behave in a strange way, don’t you? So, you spend hours debugging, as we did some time ago, just to find out the “No Space Left On Device” error? It doesn’t matter what you do; the error keeps to pop out. If your disk is really full, then it is an easy problem to solve. Just clean it up. But, if your disk is not full the issue becomes a little bit more complicated… but still easy solvable. It’s possible that you have run out of inodes.

What are inodes?

Wikipedia says:

The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object’s data. File-system object attributes may include metadata (times of last change, access, modification), as well as owner and permission data.

What does it mean in real life?
Files are not only using up your disk space, but they are also using disk inodes which hold information about them. In practice, if you keep a lot of big files most likely, you will run out of space. But, if you have a lot of very small files most likely, you will run out of inodes. Even though, there will be still potential free space on your drive.

How to check the number of inodes used?

Long story short, to check drive space we always use:

df -h

 

 

 

 

Thus, to check the number of inodes just put:

df --inodes

 

 

 

 

Do you know what happened?
The output is a little bit different. We use only 38% of the disk space but already 62% of the disk inodes available.

How to identify files and folder consuming your inodes?

The last key question to be answered is how you can identify where those files that consume your inodes are hiding. We use a very simple command for it:

find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n

As an output, you will receive a list of folders and the number of inodes that are being used by them.

 

 

 

 

 

 

 

 

 

Now you just have to navigate to the right place and clean it up 🙂

How about trying hosting services with unlimited disk space?

In case of any questions or problems, contact us.

View Comments

Share
Published by
Kamil

Recent Posts

SEO content: Keyword Selection for Content Marketing Success

SEO content, keyword selection... you probably hear these words everywhere in digital marketing. Everyone wants… Read More

5 years ago

A/B testing and conversion rate – what they are; with examples

If you own an online shop, you will certainly hear a lot about conversion and… Read More

5 years ago

How to track sales and automate order to cash processes in your online shop

You're starting to run an online shop with a few, several orders per day. You… Read More

6 years ago

How to promote your business if you don’t have a website?

Chances are that by now you have heard about the Coronavirus, also known as COVID-19.… Read More

6 years ago

How to get a SSL certificate for a website

Do you remember the little padlock that appears next to the website address? Look at… Read More

6 years ago

Real challenges of e-commerce – Part 3: Billing statements

So your packages are on the way! Or maybe even delivered! Amazing. Now it is… Read More

6 years ago

This website uses cookies.