Bug 273745 - Dolphin shows incorrect partition usage
Summary: Dolphin shows incorrect partition usage
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.45.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 19:10 UTC by t3ddy
Modified: 2020-06-03 22:03 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Image that shows the properties window (20.37 KB, image/jpeg)
2011-05-20 19:10 UTC, t3ddy
Details
Even worse today (47.34 KB, image/png)
2018-04-24 20:07 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description t3ddy 2011-05-20 19:10:25 UTC
Created attachment 60189 [details]
Image that shows the properties window

Version:           1.6.1 (using KDE 4.6.3) 
OS:                Linux

Dolphin's properties menu shows an incorrect partition usage.
The free space should be correct, since also filelight says the same, but used space is different between dolphin and filelight.
Dolphin's counts (or sources) are wrong.

Reproducible: Always

Steps to Reproduce:
Display the usage of a partition, using the properties menu.
Make the sum of free and used space.

Actual Results:  
The sum is different from the partition's size.

Expected Results:  
The sum should be equal to partition's size.
Comment 1 Peter Penz 2011-05-21 20:35:47 UTC
(internal note: must be fixed in the scope of KFilePropertiesDialog)
Comment 2 Frank Reininghaus 2011-05-27 15:10:35 UTC
(In reply to comment #0)
> Display the usage of a partition, using the properties menu.
> Make the sum of free and used space.
> 
> Expected Results:  
> The sum should be equal to partition's size.

This depends on what exactly 'used space' means. Every file occupies a multiple of the block size (which is often 4 KiB) on your hard drive. If you have a file that has a size of only a few bytes, it nevertheless takes away 4 KiB from the free space. This is probably the reason why the sizes reported by the Properties dialog don't match.

It seems that Filelight considers the multiple of 4 KiB which is used to store the files on the hard drive as the 'used space', such that the numbers add up.
Comment 3 t3ddy 2011-05-27 18:13:10 UTC
Ok, thanks for the explanation, although I think it's nicer to have the sizes matching.
Comment 4 Nate Graham 2018-04-24 20:07:16 UTC
Created attachment 112220 [details]
Even worse today

This is even worse today on my machine running KDE Frameworks 5.45. See attached screenshot.
Comment 5 Ahmad Samir 2020-05-29 10:50:31 UTC
I don't think this can/should be "fixed" per se. For example df will give numbers, different than du; the available space on an ext4 partition is going to be affected by how much reserved-blocks-percentage is set on the filesystem (check `man tune2fs`)... making the number add up isn't useful IMHO...
Comment 6 David Faure 2020-06-03 21:44:30 UTC
Nate: Isn't this summing up the sizes of everything in "/" including the stuff on other partitions like /home? Obviously that won't be comparable to the information at the bottom which is about a single partition. Apples and oranges.
This test only makes sense if there are no other partitions mounted as a subdirectory of the partition we're looking at.
Comment 7 David Faure 2020-06-03 21:48:41 UTC
Re the initial report...

I think it's actually useful to show "sum of file sizes" without rounding up each file to 4kB, because this allows comparing actual useful data between two partitions with a different filesystem.

One solution could be to show both the "sum of file sizes" and the "disk usage" numbers. But this sounds overkill.

BTW see also bug 406630.
Comment 8 Nate Graham 2020-06-03 22:03:35 UTC
(In reply to David Faure from comment #6)
> Nate: Isn't this summing up the sizes of everything in "/" including the
> stuff on other partitions like /home? Obviously that won't be comparable to
> the information at the bottom which is about a single partition. Apples and
> oranges.
> This test only makes sense if there are no other partitions mounted as a
> subdirectory of the partition we're looking at.
That attachment is two years old, and I can no longer reproduce the issue it shows, but FWIW The problem I was highlighting was that it calculated the size of / at 128 TiB. Obviously I do not have 128 TiB of storage on my system. :)

But again, I can no longer reproduce that particular issue.