GNOME Bugzilla – Bug 559311
Incorrect filesystem used space
Last modified: 2012-09-17 21:48:54 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
Is this still an issue for you? I can see free space for my 1TB disk here just fine.
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().
Apparently, this is still an issue. Here's the link to the downstream report: https://bugs.launchpad.net/ubuntu/+bug/571510
The status should probably be changed to new.
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.
Created attachment 166903 [details] [review] Improve readability by adding comments for #ifs and #ifdefs
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)
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.
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.
Cosimo, done. Created bug 625751 that we're depending on.
Mass component change due to BZ cleanup, sorry for the noise.
Created attachment 224549 [details] [review] Display reported used space when available
Created attachment 224550 [details] [review] Balance the alignment of the legend
Created attachment 224551 [details] [review] Use jimmac approved colors
Created attachment 224552 [details] [review] Paint the used space on top of the others Looks better to have those strokes be on top.
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
Review of attachment 224550 [details] [review]: Looks good to me.
Review of attachment 224551 [details] [review]: Looks good.
Review of attachment 224552 [details] [review]: ++
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