Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Server disk space, df not accurate [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 5191

PostPosted: Wed Oct 10, 2012 4:52 pm    Post subject: Server disk space, df not accurate [SOLVED] Reply with quote

I recently removed a large file from my server. After doing that, not only did df not show more free space, it showed LESS free space than before I deleted the file.

I don't believe df is showing me anything accurate. What can I do, other than restarting my server, to fix this? I'm open to using something other than df as long as I can get accurate disk space reports.

EDIT:

I just tried df --total. How can rootfs take up 59% and the total be 58%? Does tmpfs (1% here) get subtracted from rootfs for the "total"?

EDIT 2:

df -i shows what I expect: around 25% usage. Why would df -h show me 59% usage? What is df --sync supposed to do (because it appears to do nothing for me)?
_________________
Gentoo Studio: http://gentoostudio.org
Facebook: http://www.facebook.com/gentoostudio
G+: https://plus.google.com/113947758237122861689/posts
Pappy's Kernel Seeds: http://kernel-seeds.gentoostudio.org


Last edited by audiodef on Thu Oct 11, 2012 1:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2424
Location: Germany

PostPosted: Wed Oct 10, 2012 5:35 pm    Post subject: Reply with quote

df -i is something else entirely, not about space, but inodes.

df is usually accurate. some things to consider are root reserves (ext* takes 5% of available space by default), hard links (space won't be freed until you deleted all hardlinks to the file), files still in use (space won't be freed until all processes that still use this file end), as well as files hidden by mounting - if you have a big file in /home/bigfile, and then mount another filesystem to /home, then /home/bigfile is hidden but still consumes space.

The only way for df to show a "wrong" value is if the filesystem is inconsistent somehow. Only in this case you need to umount and fsck. In all other cases you'll simply have to figure out what is using the space. Mount it exclusively (mount /dev/yourdevice /mnt/somewhere) so you won't have anything hidden by other mounts there, then check it out with du or whatever.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 5191

PostPosted: Thu Oct 11, 2012 1:39 pm    Post subject: Reply with quote

Thanks for the explanation, frostschutz. :)

I used du -chs to poke around, and found that /var/log had gotten out of control. I thought I had handled that with logrotate. I manually cleaned it up, and now disk usage is where it should be.
_________________
Gentoo Studio: http://gentoostudio.org
Facebook: http://www.facebook.com/gentoostudio
G+: https://plus.google.com/113947758237122861689/posts
Pappy's Kernel Seeds: http://kernel-seeds.gentoostudio.org
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum