Software Manager and df show different amount of available hard disk space

I seem to be a bit hardheaded to day. It is very hot here and we are still not used to it. I agree that that is a lame excuse.

Thus because:

boven:~ # mount | grep sda6
/dev/sda6 on /mnt/B/home type ext4 (rw,relatime,data=ordered)
boven:~ #

we need to use the device file with fuse2fs and the mount point (or further up into the file system) for df.

boven:~ # df /mnt/B/home
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda6      103079868 71263280  26557396  73% /mnt/B/home
boven:~ #

and

boven:~ # tune2fs -l /dev/sda6 | grep Reserved
Reserved block count:     1310702
Reserved GDT blocks:      1017
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
boven:~ #

And then we change

boven:~ # tune2fs -m 50 /dev/sda6
tune2fs 1.42.8 (20-Jun-2013)
Setting reserved blocks percentage to 50% (13107027 blocks)
boven:~ #

Then inspecting what changed:

boven:~ # tune2fs -l /dev/sda6 | grep Reserved
Reserved block count:     13107027
Reserved GDT blocks:      1017
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
boven:~ #

Which shows 10 times more reserved blocks.

boven:~ # df /mnt/B/home
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda6      103079868 71263280         0 100% /mnt/B/home
boven:~ #

Which shows that nrickert is correct, df adds first the reserved blocks to the used ones before it calculates the percentage, but it does not say so.

I added (as root) a large file to that file system:

boven:/mnt/B/home # df /mnt/B/home/
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda6      103079868 75844660         0 100% /mnt/B/home
boven:/mnt/B/home # 

As you can see the amount of Used is increased, but it is still at 100%. Thus, while a percentage of 104% displayed on Solaris is possible, the df on openSUSE has apparently implemented a maximum of 100% in it’s code.

BTW, tune2fs refuses to reserve for a percentage of more then 50%:

tune2fs 1.42.8 (20-Jun-2013)
tune2fs: bad reserved block ratio - 51

=================================

Thus IMHO the conclusion to the OP can be:

  • always be carefulll, som tools may use Ki/Mi/Gi/TiBytes and others may use K/M/G/TBytes and maybe even inaccurate mention this;
  • when there are reserved blocks (a default of 5% on ext2/3/4 file systems and most probably the same on others, though I do not know about Btrfs), that adds to the Used ones.

This thread’s original question:

First direct reply until now:

Your 5% theory sounds possible. I remember my partition size is not exactly 20 GiB, but I don’t remember if it’s a bit less or a bit more…
But then I’d expect a similar difference when running the df’s as root, and as I did mention, “df -h” and “df -H” give me the same result as user and as root. The only one that changed was “df” alone, as I showed.
By the way, I noticed “df -H” gives me 0.1 free Gb more than Nautilus (and Nautilus also handles powers of 1000 instead of 1024).
And, is that 5% a real fact or just a theory? Is this what the discussion was moved to?

5% is real

It is defined so a given user can not totally run the system out of space so root can still deal with things even though a user has tried to run the system out of disk space.

In a reall multi-user environment you can set limits for each user

You seemed to have skipped a lot of the posts above. Else you would know by know that those 5% is very real, at least in ext2/3/4 file systems, and that you can change that value with tune2fs. Not that you want to change it, but when you can change something, that proves IMHO that it is very real. Also shown is how you can read from the file system how much that is (not in %, but in blocks):

tune2fs -l /dev/sdX

(fill in the correct value for /dev/sdX). Or, when youu only want to see values connected to the reserved space:

tune2fs -l /dev/SDX | grep Reserved

Very real indeed.

And of course the man page for tune2fs, where it says:

-m reserved-blocks-percentage
Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.

Very real, and not difficult to find.

But then I’d expect a similar difference when running the df’s as root, and as I did mention, “df -h” and “df -H” give me the same result as user and as root. The only one that changed was “df” alone, as I showed.
By the way, I noticed “df -H” gives me 0.1 free Gb more than Nautilus (and Nautilus also handles powers of 1000 instead of 1024).
What about these 2 details?

Still some idea?

It does not work that way. There’s a portion of space that is reserved. The “df” output does not count that as available, regardless of whether “df” is run by root. But the root user can still write the disk when the standard space is used up but there is still free reserved space.