LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is this possible: df showing disk space full, but it isn't? (https://www.linuxquestions.org/questions/linux-newbie-8/is-this-possible-df-showing-disk-space-full-but-it-isnt-4175504934/)

suDoh! 05-14-2014 02:07 AM

Is this possible: df showing disk space full, but it isn't?
 
Hi LQ,

I was recently asked whether a scenario is genuine and if so what's the issue, here it is:

df -h shows a partition is 100% full but actually there is still space left on it, does this happens and if yes, explain what would be the reason for the same?

It was in a interview that I came across this. :P

Cheers

acid_kewpie 05-14-2014 03:30 AM

open file handles on a deleted file? Very possible to remove a huge file and becuase somethign is still writing to that part of the disk, the space is still not available.

Shadow_7 05-14-2014 05:13 AM

Yes it's possible. Depending on the filesystem deployed. You can have a limited number of blocks and files can use partial blocks. When you run out of blocks (nodes) you run out of drive space. The default for ext2,ext3,ext4 tends to be 4k blocks. So if you have all 1k files, you'll be full at 25% usage.

eklavya 05-14-2014 05:19 AM

Yes it can happen.
http://perplexed.co.uk/546_df_falsel...disk_usage.htm

Sometimes df and du does not show matched data. You can take a look at here,
http://linuxaria.com/pills/linux-she...fferent-values

rknichols 05-14-2014 08:43 AM

Sounds to me like the exact opposite of the situation the other responders have mentioned. The ext2/3/4 filesystems (and probably some others) by default reserve 5% of the total space for the root user. The "100%" reported by df is 100% of the space available to ordinary users. If you look at the actual block counts, df will report 100% usage whenever the number of used blocks is at or above 95% of the total number of blocks.

I guess it boils down to what you mean by, "but it isn't." If you mean that df is reporting more usage than what you can account for from du, then the responses about deleted files apply. If you mean that there really is still some space available, then that would be the 5% reserved space.

suDoh! 05-14-2014 10:47 AM

Thanks a lot all you folks for explaining, got it now :D

Cheers!


All times are GMT -5. The time now is 12:05 AM.