Volume run out of space, even though there is loads left?
I'm getting errors about /mnt/websitehtml being out of space, even though it should have 148gb:
root@spider:~# sudo df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 7.9M 3.2G 1% /run
/dev/sda 630G 55G 544G 10% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdc 148G 81G 60G 58% /mnt/websitehtml
tmpfs 3.2G 0 3.2G 0% /run/user/0
Yet this shows:
root@spider:~# sudo df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 4109599 391 4109208 1% /dev
tmpfs 4117430 2370 4115060 1% /run
/dev/sda 40928000 182548 40745452 1% /
tmpfs 4117430 1 4117429 1% /dev/shm
tmpfs 4117430 4 4117426 1% /run/lock
tmpfs 4117430 18 4117412 1% /sys/fs/cgroup
/dev/sdc 9830400 9830399 1 100% /mnt/websitehtml
tmpfs 4117430 11 4117419 1% /run/user/0
I'm confused - why would this be? IUse shows 100% - yet it shows 58% use with just df -h ?
Thanks in advance!
Do you have an app/service that uses sparse files…like dbm/bdb (Berkeley database) or gdbm (GNU database) files? These files have "holes" in them that in some cases the file system sees as free space and in others sees as in use. OpenLDAP uses them a lot…so do some databases…
I ran into this recently also.
You have run out of inodes. Every ext3/4 filesystem stores metadata about files and directories in its index. This index has a finite number of entries which is defined at the point of creation.
These entries are known as inodes. Every file or directory takes up a space in this index.
If you’ve run out of inodes, you’ve likely got a large number of files being stored.
Check out this answer to find directories containing large numbers of files.
In my case, it was PHP sessions that weren’t being cleared down (each session is stored in a file.)
An i-node (the original spelling, btw) was an architectural feature of the original Unix™ filesystem (since at least Bell Labs Unix V6 -- circa 1975).
The first public reference to an i-node is in:
Bell System Technical Journal 57: 6. July-August 1978: "The UNIX Time-Sharing System"; Ritchie, D.M.; Thompson, K.
I know this because I looked at my first-edition copy of this from 1978 that's on the bookshelf behind my chair ;-)
The term appeared before that in the (slim amount of) documentation that came on the Unix release tape but that was only available to Unix licensees. I'm afraid most of that stuff has been lost to the ages…
PS, running out of inodes is usually the consequence of having zillions of inconsequential 4K temp files in the filesystem (which is most often a consequence lazy apps not cleaning up after themselves and/or not cleaning your /tmp and /var/tmp directories on a regular basis).
You can read here:
about how to increase the number of inodes in an ext4 filesystem but
DANGER WILL ROBINSON! DANGER! DANGER!
This is not for the faint of heart…and quadruple-redundant backups are going to be a necessity before you start.