10

Possible Duplicate:
ext4 partition size / free space discrepancies

The results from a df on my main drive on my server don't add up. I came close to running out of disk space, I freed 4 gigs a couple of days ago, but we're still getting weird results two days later.

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             78441416  73732352    724536 100% /

Now, by my calculation, 78,441,416 - 73,732,352 = 4,709,064, so there should be over 4 gigs left, not the 724,536K that df is reporting.

I don't see this could be a quota error - though quota -f apparently isn't an option for Ubuntu and I haven't yet found a command to recompute the quota.

I'm now going through the various directories doing a du -sk (glad the server seems to have light traffic for a Monday morning) but not sure what that will tell me.

Any hints?

2 Answers2

21

Linux filesystems routinely reserve between 1 and 10 percent of the filesystem for the root user. This is to ensure the root user can function when a non-root user "fills" the filesystem. The df command does not show this reserved space as available.

As root, run this command: /sbin/tune2fs -l /dev/sda1
Look for the line that reads "Reserved block count".

You can also use tune2fs to change the amount reserved.

0

OK, I think I finally worked it out, it's a combination of things.

I knew that about 1000000 blocks were reserved for "root" - but I hadn't realized that this machine had 4K blocks (I've been doing a lot of digital audio this year so for me a "block" is 1K :-D). So there's my 4 gig!

Now I have to figure out how to reduce somewhat the amount reserved for root, but that I can probably do quite easily...

Thanks for your attention!