Disk 100% full, but still multiple GB left on device

DennisMidjord

Well-Known Member
Sep 27, 2016
280
43
78
Denmark
cPanel Access Level
Root Administrator
Hi,

We have this odd problem where df reports the disk as 100% full, but we could still have 20GB free on that disk. When the disk is 100% full, we can no longer write anything to the disk.
Any idea why this happens?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Hi @DennisMidjord

There was a point I was going to make with that. This is a common concern and the best example is shown If you use df and du you'll a lot of times encounter a situation where they show differing amounts. This is due to the way that they each calculate disk space and would account for why you are seeing available disk space when df is telling you there's nothing available.

df measures disk space in 512-byte disk sectors and on some file systems like zFS df is sometimes inaccurate in providing enough information to determine if the file system is running out of space. df is measuring File System usage

The great comparison is du which a lot of times can take a lot longer because it shows File Space usage

Another thing to keep in mind as well is that df adds deleted items still held in memory to the calculation as they are by all purposes still present until they're no longer held in memory. You can see this usage by running something like:

Code:
lsof |grep '(deleted)'
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
du -h shows this: 614G ./home
df -h shows this: /dev/mapper/cloudlinux-home 676G 614G 29G 96% /home
So that difference there is what I was referring to. The difference between File Space usage and File System usage. DF Is calculating File System usage in blocks as well as counting deleted items held in memory where DU isn't. Sometimes this will lead to potentially showing more disk space used.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Oh! I misread it without the bar present:

Code:
Filesystem      Size  Used Avail Use% Mounted on
In this case then, it does show you have available space, but I'm assuming this isn't an example where it's reporting the server is out of space?
 

DennisMidjord

Well-Known Member
Sep 27, 2016
280
43
78
Denmark
cPanel Access Level
Root Administrator
No - we were only seeing the error message with FTP (apparently). I had understood that it was an issue with writing anything, but it seems like it was just FTP.
Writing anything to the disk from cPanel or uploading a database didn't cause any issues which led me to investigate whether it was actually just the FTP server.
 
  • Like
Reactions: cPanelLauren