Bug 152846 - Hard drive free space in main-menu is wrong
Summary: Hard drive free space in main-menu is wrong
Status: RESOLVED FIXED
: 203610 241361 328867 363692 (view as bug list)
Alias: None
Product: openSUSE 10.3
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Final
Hardware: Other SLED 10
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Scott Reeves
QA Contact: E-mail List
URL:
Whiteboard: gnome-wrong-out-of-the-box, opensuse-...
Keywords:
Depends on:
Blocks: main-menu-behavior
  Show dependency treegraph
 
Reported: 2006-02-22 17:01 UTC by Federico Mena Quintero
Modified: 2008-03-08 00:58 UTC (History)
5 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
free-space.png (92.25 KB, image/png)
2006-02-22 17:02 UTC, Federico Mena Quintero
Details
Output of df and hal-device (8.64 KB, text/plain)
2006-04-19 18:01 UTC, Federico Mena Quintero
Details
gnome-main-menu-152846-hard-drive-free-space.diff (5.09 KB, patch)
2007-10-01 20:15 UTC, Federico Mena Quintero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Mena Quintero 2006-02-22 17:01:56 UTC
See the attached screenshot.  I have about 70 GB free in my /home partition, but main-menu reports that I have only 15 GB free.

[In another machine, it reports that I have 124 GB *used*, while my /home is a 50 GB partition, and the whole hard drive is 60 GB :) ]
Comment 1 Federico Mena Quintero 2006-02-22 17:02:59 UTC
Created attachment 69830 [details]
free-space.png
Comment 2 James Krehl 2006-04-19 17:21:16 UTC
I suspect that hal is not correctly identifying your /dev/mapper/system-home device as the disk space reporting appears correct if that mount is not included in the statistics.

can you do this:

for udi in `hal-find-by-capability --capability volume` ; do
     hal-device $udi
done
Comment 3 Federico Mena Quintero 2006-04-19 18:01:41 UTC
Created attachment 79091 [details]
Output of df and hal-device
Comment 4 James Krehl 2006-04-19 18:46:43 UTC
Yeah, as I suspected hal is not reporting that partition.  Reassigning ...
Comment 5 Federico Mena Quintero 2006-04-19 19:09:40 UTC
Some more info:

champignon$ cat /etc/fstab
/dev/hda1            /                    ext3       acl,user_xattr        1 1
/dev/system/home     /home                ext3       defaults              1 2
/dev/hda2            swap                 swap       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/hda5            /data1               auto       noauto,user           0 0


Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Partition table:
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1305    10482381   83  Linux
/dev/hda2            1306        1436     1052257+  82  Linux swap / Solaris
/dev/hda3            1437       14946   108519075    f  W95 Ext'd (LBA)
/dev/hda5            1437        2742    10490413+  83  Linux
/dev/hda6            2743       14946    98028598+  8e  Linux LVM

As Jimmy says, in the attachment in comment #3 there's no HAL volume for the LVM volume that got mounted on /home.  
Comment 6 Danny Al-Gaaf 2006-04-19 19:33:50 UTC
Thats not right as you can see in the attachment HAL reports this partition (as all partitions from the partition table) as udi = '/org/freedesktop/Hal/devices/volume_part6_size_100381284864' for /dev/hda6 or which partition you mean?
Comment 7 James Krehl 2006-04-19 19:43:06 UTC
I'm speaking of the /dev/system/home partition reported by df, which is reported to be mounted.  According to HAL, /dev/hda6 is not mounted.  Is there a way to determine if and what the relationship is between /dev/hda6 and /dev/system/home with HAL?
Comment 8 Danny Al-Gaaf 2006-05-01 16:20:10 UTC
No, because IMO hal currently doesn't handle lvm mounts.

@kay: you wrote the current mount detection code. Any comments?
Comment 9 Kay Sievers 2006-05-01 16:28:23 UTC
It's not about mount detection code, HAL does not care about any "virtual" device like raid volumes at the moment and it's unlikely that that will change soon.
Comment 10 JP Rosevear 2006-05-01 16:52:21 UTC
Ok, but in this case there is no way to detect that the underlying hda6 is actually mounted in this case via hal (but df knows).
Comment 11 Kay Sievers 2006-05-01 17:46:20 UTC
Right, there isn't even a device object available in HAL for md, lvm, loopback, raid, network storage devices, ... - they are just completely ignored. Support for all this would need to be implemented to show up there.
Comment 12 JP Rosevear 2006-05-01 17:58:53 UTC
Moved to hal maintainer and resolving as LATER because we clearly won't get this in FCS>
Comment 13 Danny Al-Gaaf 2006-06-30 07:52:21 UTC
reopen
Comment 14 Danny Al-Gaaf 2006-06-30 07:53:56 UTC
@federico: please add a FATE request if you need LVM support in HAL
Comment 15 Federico Mena Quintero 2006-09-15 14:39:48 UTC
Alternatively, main-menu could simply use gnome_vfs_get_volume_free_space().
Comment 16 JP Rosevear 2006-09-15 14:54:27 UTC
*** Bug 203610 has been marked as a duplicate of this bug. ***
Comment 17 JP Rosevear 2006-09-15 14:56:54 UTC
I've filed this as Fate #301253.
Comment 18 Danny Al-Gaaf 2006-09-16 03:58:02 UTC
since it is in FATE I close this bug
Comment 19 James Krehl 2007-09-27 19:32:21 UTC
*** Bug 328867 has been marked as a duplicate of this bug. ***
Comment 20 Christian Jäger 2007-09-27 21:08:51 UTC
This bug has never been resolved and still duplicates of this bug-report get filed. Please re-open.
Comment 21 Federico Mena Quintero 2007-10-01 16:46:24 UTC
Reopening since the bug is not fixed.
Comment 22 Federico Mena Quintero 2007-10-01 20:15:01 UTC
Created attachment 175846 [details]
gnome-main-menu-152846-hard-drive-free-space.diff

Patch to make main-menu use a simple statvfs() to get the free space for the user's home.

Previously it tried to gather all the non-CDROM volumes and add up their free space, but I think this is not what the user wants to see.  What you want is the amount of space to which you can write, i.e. disk_free($HOME).

With this patch main-menu displays the correct free space and capacity for me (I have an LVM partition for /home).
Comment 23 Federico Mena Quintero 2007-10-01 20:15:38 UTC
Jimmy, could you please take a look at this patch?  It simplifies the code a lot, and produces correct results :)
Comment 25 Christian Jäger 2007-10-05 15:40:19 UTC
Thanks a lot for taking care of this bug so quickly!
Comment 26 Matej Horvath 2007-10-08 10:07:17 UTC
*** Bug 328864 has been marked as a duplicate of this bug. ***
Comment 28 Federico Mena Quintero 2007-12-17 16:49:34 UTC
Moving to 10.3.
Comment 29 Federico Mena Quintero 2007-12-17 20:09:38 UTC
*** Bug 241361 has been marked as a duplicate of this bug. ***
Comment 30 Federico Mena Quintero 2007-12-18 15:53:13 UTC
There's a test package here with the aforementioned patch:
http://download.opensuse.org/repositories/home:/federico-mena:/10.3/openSUSE_10.3

It fixes the problem for me.

I'll put this patch in our main package as soon as the Main Menu bug week is over:
http://en.opensuse.org/GNOME/Main_menu_bug_week
Comment 31 Federico Mena Quintero 2007-12-19 00:47:11 UTC
Note to self:  change the "Hard Drive" label to be "Home".  People are getting confused that the tile shows you the free space on all your partitions, while in fact it only considers the volume where your $HOME is.
Comment 32 Federico Mena Quintero 2007-12-21 00:51:16 UTC
Actually, bug #332418 has a patch to rename this, and good discussion about it.
Comment 33 Scott Reeves 2008-01-25 21:13:52 UTC
commited to svn.
Comment 34 Scott Reeves 2008-03-04 18:23:25 UTC
*** Bug 363692 has been marked as a duplicate of this bug. ***
Comment 35 Scott Reeves 2008-03-08 00:58:12 UTC
Fixed for 11.0. submitted to factory - v 0.9.9