Disk space usage doesn’t add up with df & du
I’m trying to free up some disk space – if I do a df -h, I have a filesystem called /dev/mapper/vg00-var which says its 4G, 3.8G used, 205M left.
That corresponds to my /var directory.
If I descend into /var and do du -kscxh *, the total is 2.1G
2.1G + 200M free = 2.3G… So my question is, where is the remaining 1.7G ?
You probably have some deleted big log file, database file or something similar lying around, waiting for the process holding the file releasing it.
In Linux, a file deletion simply unlinks the file. It actually gets deleted when there’s no file handles connected to that file anymore. So, if you have a 2 GB log file which you delete manually with rm, the disk space will not be freed until you restart syslog daemon (or send HUP signal to it).
Try
lsof -n | grep -i deleted
and see if you have any deleted zombie files still floating around.
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
- SCP transfer only modified files
- How can I automate clearing and resetting a Linux user’s home directory to a default?
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?





