[SOLVED] "No space left on device" or "ext4_dx_add_entry:155

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
WoAyumi
A regular
A regular
Posts: 52
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Apr 28, 2012 6:24 pm

[SOLVED] "No space left on device" or "ext4_dx_add_entry:155

Post by WoAyumi »

If you are running a server that creates thousands of files in a single directory (for example, in Minecraft it's done by the Essentials plugin), you might run into a problem one day where your Dedicated or Virtual server would start throwing errors like "No space left on device", or "ext4_dx_add_entry:1551: Directory index full!". What to do then?


First of all, check if you do really have space on the problematic disk:

Code: Select all

df -h
Explanation: this will give you a fine look on your partitions' total space and free space available.



If you have enough space left, but you still see the errors, do this command:

Code: Select all

touch /path/to/the/problematic/directory/testfile.txt
Explanation: this should create an empty file in the directory you have problems with. Don't forget to change the path in the example code above to the corresponding directory on your server. If it gives you an error "No space left on device", but you do have a space, then you have most likelly reached the file limit in that directory. Clean it up from the old files. Alternatively, if you are a developer of your server, or your plugin, you can make your server or a plugin to sort the files into sub-directories by their first character, or you might want to consider switching to MySQL.



Find all the rest potentially problematic directories:

Code: Select all

find / -type d | ( while read A; do B=`ls -l "$A" | wc -l`; echo $B $A; done) | sort -n
Explanation: it will sort all your server's directories by the number of files in them. You should look for the directories which have thousands of files in them. Keep cleaning them up, or alternatively switch to MySQL, or start sorting files into sub-directories if this is possible.



If nothing helps:
If you have cleaned your directory from old files, but still see this error then check your disk for errors:

Code: Select all

fsck /dev/yourdiskname
.
Post Reply