df and actually remaining disk space

Hello,

My current root partition is only 11G (/home on another partition) and is currently almost full. In fact, out of 11G, 9.9 are used.

However (please be seated, this may sound very weird), here’s the exact line “df” shows:


Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda2               11G   9.9G   167M  99% /

If I recall correctly, 9.9G + 167M is NOT equal to 11G…

Another weird phenomenon is that earlier I deleted a couple megs of files and, instead of saying that I had more space left on my disk, it said I had less (it went from 171M available to 167M)… However I was not writing voluntarily any information on my disk.

Are there any programs known for writing a lot of information on the disk for no particular reason?

Any help would be greatly appreciated.

When you create a file system you allocate some space which is unusable.

Think of it as making the filing cabinet something has to make it. I think the default for ext3 is 5% you can use flags to modify this when you create the FS.

Try man mkfs.

Okay, thanks. I’ve heard of that before but though it was not included in the actual size of the partition.

tune2fs -l /dev/sda2 | fgrep ‘Reserved block count’

With -m or -r options of tune2fs you can change it without a reformat.

n0x wrote:
> However (please be seated, this may sound very weird), here’s the exact
> line “df” shows:
>
>
> Code:
> --------------------
>
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda2 11G 9.9G 167M 99% /
> --------------------
>
>
> If I recall correctly, 9.9G + 167M is NOT equal to 11G…

Run “dumpe2fs /dev/sda2” and find the “Reserved block count” line.
Multiply with the block size (often 4096) from the same screen and see
if it adds up then. This is the amount of space reserved for the root
user/group so the system remains functional even if a user fills it up.
Use tune2fs to adjust, but that is not recommended for the root file system.

Kind regards,
Andeas Stieger

If you add the apx 5% think you’ll find it adds up.

As for the other about deleting and usage root is constantly working log files being written, files in /tmp mail spools etc…

From the looks of things you may need to expand that slightly if you can or find some space. Perhaps you have some logs accumulating, tmp not being cleared etc… maybe an app you no longer use.

You could perhaps make another small partition and move something but you’ll need to know what to do with fstab/partioner. du will be your friend to find out exactly where the space is being used.

So 3 choices
Expand
clear out clutter
move something to a new partition

maybe a 4th if that is all you need
use less for the file system