[vox-tech] solved puzzle: free du and df disagree about free disk space

Henry House hajhouse at houseag.com
Tue Sep 21 08:25:20 PDT 2004


romana:/var$ sudo du -hcs *
2.6M    backups
24M     cache
12K     dhcp
4.0K    games
114M    lib
116K    list
4.0K    local
4.0K    lock
793M    log
0       mail
52M     public_html
104K    run
4.0K    scratch
33M     spool
16K     state
296K    tmp
1017M   total

romana:/var$ sudo df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             1.4G  1.3G   65M  96% /
/dev/sda5             2.4G  2.3G     0 100% /var

As you can see from these transcripts, 'du' told me that I had used less than 1
GB on this machine's /var, but according to 'df' there was still no free space.
I looked for invisible files (using "find -name '.?*'") but found less than
400K of those. The next likely possibility was: unliked files still open by
running processes, which the kernel therefore had not freed.

So, I stopped all daemons, including sysklogd. Bingo! The missing 1.3G of free
space appeared. It turned out to be the fault of some large deleted logfiles
that were still open.

Moral: run logrotate and restart daemons every few weeks to keep logfiles from
growing unreasonably large. I am curious how others (such as professional
sysadmins) keep machines from running out of disk space. How, for example, do
the K12LTSP users in Hawai'i keep logs from filling up their disks? Full
filesystems seem to be one of the most common causes of downtime for Linux
servers.

-- 
Henry House
Please don't send me HTML mail! My mail system will reject it.
The unintelligible text that may follow is a digital signature.
See <http://hajhouse.org/pgp> to find out how to use it.
My OpenPGP key: <http://hajhouse.org/hajhouse.asc>.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://ns1.livepenguin.com/pipermail/vox-tech/attachments/20040921/3cc8c2fc/attachment.bin


More information about the vox-tech mailing list