Bug 202721 - System monitor "Disk Space" doesn't update partition list
Summary: System monitor "Disk Space" doesn't update partition list
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-systemmonitor (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-06 00:06 UTC by Michael Reiher
Modified: 2010-02-05 19:49 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
before mounting (73.21 KB, image/png)
2010-02-05 19:47 UTC, sudhendu kumar
Details
after mounting (104.51 KB, image/png)
2010-02-05 19:49 UTC, sudhendu kumar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Reiher 2009-08-06 00:06:53 UTC
Version:            (using KDE 4.3.0)
Installed from:    Ubuntu Packages

The hard disc system monitor seems to keep an inital partition list persistent forever. I shuffled around my hard discs, meaning I swapped two (sda and sdb) and added a third (sdc). However the applet doesn't reflect that. It still shows the old partition list i.e. it has those that used to be sda still as sda even though they are sdb by now, and the new ones from sdc don't show up at all.
Comment 1 FiNeX 2009-08-07 14:23:16 UTC

*** This bug has been marked as a duplicate of bug 200861 ***
Comment 2 FiNeX 2009-08-10 18:16:51 UTC
Ok, I'll reopen the bug, I've found this bug already reported but, like you've wrote on bug #202721, it wasn't that, probably I've had pasted the wrong bug id... now the problem is to find again the other bug :-)
Comment 3 Petri Damstén 2009-09-08 14:10:13 UTC
Plugged in memory stick and it shows in hard disk configuration dialog.
Comment 4 Michael Reiher 2009-09-08 14:37:46 UTC
I disagree with marking this as resolved... Pluggin in USB sticks and having it show up in the config has never been a problem for me, too! The problem seems rather when the partitions of a disc change. Then the old data is kept and not properly updated. 

What makes it more confusing is that this doesn't happen always when partitions on the disc change. As I wrote, I shuffled around and reformatted my discs. And somewhere in between I noticed this problem. However, by now everything seems fine i.e. the list in the config dialog reflects reality. 

Well, except for one partition (I'm not sure if this is the same problem. I wouldn't be surprised though): My windows partition on /dev/sda1. It's labeled "WindowsXP". And the config of the hard disk monitor used to show that label. At some point, when shuffling around the discs, a different partition on a different disc became sda1 and the entry changed to "/dev/sda1" (it was an ext3 partition with no label IIRC). Now the original disc with the "WindowsXP" labeled partition is sda1 again. However: the entry is still "/dev/sda1". It has not been updated.
Comment 5 Petri Damstén 2009-09-08 15:03:30 UTC
Since hard disk monitor seems to update in partition changes (USB etc.) I'm not sure if this is a bug is in hdd monitor or somewhere deeper, but it's now reopened.
Comment 6 Michael Reiher 2009-09-08 16:37:42 UTC
I'd even try it out again, the problem is, I don't have a spare SATA disc atm. ...

I also wondered, whether the problem might actually be on a lower level. But I still think there might be something wrong, how the applet handles the partition list. I never saw any problems with the device list in Dolphin for example (IIRC).

As for the sda1 problem for instance, I just noticed these two entries in plasma-desktop-appletrc:

/org/freedesktop/Hal/devices/volume_uuid_1CF4_2041=/dev/sda1 (not accessible) [...]
/org/freedesktop/Hal/devices/volume_uuid_1CF4_2041_0=WindowsXP (not accessible) [...]

When I remove these entries and restart plasma I get:

/org/freedesktop/Hal/devices/volume_uuid_1CF4_2041=WindowsXP

(No idea where this _0 one comes from) But at some point this "/dev/sda" slipped in for 1CF4_2041, and now it's there forever (or until I removed it).

No idea how this uuid list is handled internally... But what happens if a partition has disappeared after reboot (i.e. there is no live event plasma or whoever could pick up), but is still referenced in the plasma config? Is is checked and removed? As for a while I had ghost partitions in the hard disk config partition list, which didn't exists in reality anymore. So somehow there haven't been removed from the list...

Also what happens when a different partition with a different uuid appears, but with the same name e.g. /dev/sdb1?
Comment 7 Petri Damstén 2009-09-08 18:09:43 UTC
Yes, I think I know whats goes wrong here. Applet has user editable name for partition. If uuid has not name yet, it tries to guess it from device label, mount path and device name. If same uuid is seen as another device label stays the same (but user can edit it in config dialog). Maybe if label starts with "/dev/" it should try to guess it again...
Comment 8 Petri Damstén 2009-09-08 18:13:35 UTC
SVN commit 1021241 by pdamsten:

If label is a device name check it again.
BUG:202721

 M  +1 -1      hdd.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1021241
Comment 9 Michael Reiher 2009-09-08 19:11:04 UTC
I can manually edit the label??... Indeed! :) I think that should be made a bit more discoverable... ;)

Anyway, what about the following case? Applet reads in a label from the device, in my case "WindowsXP". Then the label is changed (not in the applet config dialog, but with some file system tool). Then I'd expect the applet (config) to reflect that and automatically show the changed label, as long as I haven't changed the label in the config by hand. So IMHO the manually set/changed label should be saved separately. If empty, the applet shows the label extracted from the device. On every system start the extracted label is checked, whether it has changed or not. Or maybe don't save them at all, and on every startup read all the labels from the devices and show them. And in the config only save the uuid and a possible manually set label.

Anyway, this seems indeed to be a different problem than the original one of the report, and thus the original problem is still not fixed... I'd say ;) I'll see if I get a disc to reproduce it... 

Oh, and thanks for working on this non the less! :)
Comment 10 Michael Reiher 2009-09-08 19:15:19 UTC
(In reply to comment #9)
> Or maybe don't save them at all, and on every startup read
> all the labels from the devices and show them. And in the config only save the
> uuid and a possible manually set label.
> 
Ok, that wouldn't doesn't work when the device isn't present at startup... So you'd have to save them both, the extracted and the manually set label.
Comment 11 Petri Damstén 2009-09-09 09:05:35 UTC
SVN commit 1021425 by pdamsten:

Only save uuid string if user edited it.
CCBUG: 202721

 M  +22 -14    hdd.cpp  
 M  +1 -0      hdd.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1021425
Comment 12 sudhendu kumar 2010-02-05 19:47:56 UTC
Created attachment 40552 [details]
before mounting
Comment 13 sudhendu kumar 2010-02-05 19:49:00 UTC
Created attachment 40553 [details]
after mounting
Comment 14 sudhendu kumar 2010-02-05 19:49:26 UTC
This bug has been marked RESOLVED but I am still facing problem with system monitor-hard disk widget. I am not sure if it is a problem with the widget or with solid, but the same problem I found with my fiend running KDE trunk. I have attached snapshots before and after mounting my USB drive.
What happens is, when I first insert the USB drive (not mounted), system monitor-hard disk settings shows the device inaccessible.
But when I mount the device, the same system monitor-hard disk settings does not show any option for my USB drive.
What might be wrong?