After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559311 - Incorrect filesystem used space
Incorrect filesystem used space
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on: 625751
Blocks:
 
 
Reported: 2008-11-04 17:58 UTC by Laurent Bigonville
Modified: 2012-09-17 21:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Improve readability by adding comments for #ifs and #ifdefs (3.17 KB, patch)
2010-07-31 23:30 UTC, Marcus Carlson
none Details | Review
Adds G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space from fs (2.35 KB, patch)
2010-07-31 23:31 UTC, Marcus Carlson
rejected Details | Review
Display reported used space when available (7.38 KB, patch)
2012-09-17 20:39 UTC, William Jon McCann
committed Details | Review
Balance the alignment of the legend (6.71 KB, patch)
2012-09-17 20:39 UTC, William Jon McCann
committed Details | Review
Use jimmac approved colors (1.29 KB, patch)
2012-09-17 20:39 UTC, William Jon McCann
committed Details | Review
Paint the used space on top of the others (2.15 KB, patch)
2012-09-17 20:39 UTC, William Jon McCann
committed Details | Review

Description Laurent Bigonville 2008-11-04 17:58:00 UTC
I'm not sure if this bug is due to the use of ext4 or to the fact that the partition is 1Tb large.

The used space reported in the Properties dialog is wrong.

df -h reports:
/dev/sdb1             917G   11G  860G   2% /media/MaxiHD

but 

nautilus reports: 57,4Gb
Comment 1 Cosimo Cecchi 2010-04-27 13:15:09 UTC
Is this still an issue for you? I can see free space for my 1TB disk here just fine.
Comment 2 Phillip Susi 2010-04-29 01:42:49 UTC
Wow, this bug has been here for a while.  Just noticed this myself and filed a bug in Ubuntu (#571510), which I will link to this one.  Copying my description and probable cause from there:

When viewing the properties of a disk, it reports total size, free space, and used space. The used space appears to be wrong. I have an empty disk that df -h reports as:

size used avail
746G 197M 708G

But the properties window says the capacity is 745.4 GB, with 707.4 GB free, which agrees so far, but for used space, it says 38.1 GB.

My guess as to what is going on is that nautilus is ignoring the values returned by statfs() which df reports for the used space, and calculating what it thinks the used space is by subtracting free from total. The kernel normally reserves 5% of the disk for root, so statfs() reports a smaller avail size to normal users. Quotas also will cause avail to be less than size - used. Nautilus should report the used space according to statfs().
Comment 3 Tobias Mueller 2010-06-14 23:28:07 UTC
Apparently, this is still an issue. Here's the link to the downstream report: https://bugs.launchpad.net/ubuntu/+bug/571510
Comment 4 Phillip Susi 2010-06-16 18:02:19 UTC
The status should probably be changed to new.
Comment 5 Marcus Carlson 2010-07-31 23:10:23 UTC
Phillip, I think your 5% guess is correct. But nautilus cannot get the right information because glib/gio doesn't report it. So the first thing todo is to open a bugreport against glib to expose something like G_FILE_ATTRIBUTE_FILESYSTEM_USED that nautilus can use.
Comment 6 Marcus Carlson 2010-07-31 23:30:52 UTC
Created attachment 166903 [details] [review]
Improve readability by adding comments for #ifs and #ifdefs
Comment 7 Marcus Carlson 2010-07-31 23:31:39 UTC
Created attachment 166904 [details] [review]
Adds G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space from fs

Something like this should do it (untested)
Comment 8 Marcus Carlson 2010-07-31 23:33:59 UTC
We should probably add a "system" pie to the chart as well, otherwise the user will be confused when the calculations doesn't end up even.
Comment 9 Cosimo Cecchi 2010-08-01 10:19:39 UTC
Marcus, please file a separate bug for GLib, attach these patches there, so they could be reviewed by a GLib maintainer, and set this bug as blocked by the GLib one.

I'm marking the patches here as rejected for this bug report, but keep this open.
Comment 10 Marcus Carlson 2010-08-01 10:29:51 UTC
Cosimo, done. Created bug 625751 that we're depending on.
Comment 11 Cosimo Cecchi 2012-07-20 16:06:34 UTC
Mass component change due to BZ cleanup, sorry for the noise.
Comment 12 William Jon McCann 2012-09-17 20:39:06 UTC
Created attachment 224549 [details] [review]
Display reported used space when available
Comment 13 William Jon McCann 2012-09-17 20:39:10 UTC
Created attachment 224550 [details] [review]
Balance the alignment of the legend
Comment 14 William Jon McCann 2012-09-17 20:39:13 UTC
Created attachment 224551 [details] [review]
Use jimmac approved colors
Comment 15 William Jon McCann 2012-09-17 20:39:17 UTC
Created attachment 224552 [details] [review]
Paint the used space on top of the others

Looks better to have those strokes be on top.
Comment 16 Cosimo Cecchi 2012-09-17 20:57:07 UTC
Review of attachment 224549 [details] [review]:

Looks good, with the following fix.

::: src/nautilus-properties-window.c
@@ +2971,3 @@
 	style = gtk_widget_get_style_context (GTK_WIDGET (grid));
 
+	if (!gtk_style_context_lookup_color (style, "chart_rgba_0", &window->details->free_color)) {

Should be &window->details->unknown_color
Comment 17 Cosimo Cecchi 2012-09-17 20:59:58 UTC
Review of attachment 224550 [details] [review]:

Looks good to me.
Comment 18 Cosimo Cecchi 2012-09-17 21:04:17 UTC
Review of attachment 224551 [details] [review]:

Looks good.
Comment 19 Cosimo Cecchi 2012-09-17 21:06:25 UTC
Review of attachment 224552 [details] [review]:

++
Comment 20 William Jon McCann 2012-09-17 21:48:42 UTC
Attachment 224549 [details] pushed as e0e069f - Display reported used space when available
Attachment 224550 [details] pushed as 0435044 - Balance the alignment of the legend
Attachment 224551 [details] pushed as 2657112 - Use jimmac approved colors
Attachment 224552 [details] pushed as b5d1b84 - Paint the used space on top of the others