Tuesday, March 8, 2016

linux - du vs. df difference





I have a fileserver where df reports 94% of / full. But according to du, much less is used:



# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 270G 240G 17G 94% /

# du -hxs /
124G /


I read that open but deleted files could be responsible for it but a reboot did not fix this.



This is Linux, ext3.



regards


Answer




Ok, found it.



I had a old backup on /mnt/Backup in the same filesystem and then an external drive mounted in that place. So du didn't see the files. So cleaning up this gave me back my disk space.



It probably happened this way: the external drive once was unmounted while the daily backup script run.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...