unmounting a usb stick gives a stupid error

Bug #222041 reported by Asraniel
76
Affects Status Importance Assigned to Milestone
kdebase (Ubuntu)
Fix Released
Medium
Jonathan Riddell
Hardy
Fix Released
Undecided
Unassigned
Intrepid
Fix Released
Medium
Jonathan Riddell

Bug Description

When unmounting a external hard disk or a usb stick from the kde desktop, i get a error, that the media could not be ejected.
Of course it can't be ejected! only cdroms can be ejected.. ;-)

so, i would be happy if somebody could close that bug, because it confuses my girlfriend.

Related branches

Revision history for this message
Yuriy Kozlov (yuriy-kozlov) wrote :

I've gotten that message before with an SD card and it really doesn't make any sense.
KDE4 does not show this message.

Changed in meta-kde:
status: New → Confirmed
Changed in kdebase:
importance: Undecided → Low
Revision history for this message
Adam Porter (alphapapa) wrote :

Please fix this bug. It makes Kubuntu appear very unprofessional and unpolished. It also needlessly distracts and annoys the user.

Please upgrade this to at least medium importance.

Revision history for this message
Frode M. Døving (frode) wrote :

diff at: http://frode.kde.no/misc/kdebase_mediahelper_noEjectError.diff
applies to kdebase/kioslave

It bascially removes the useless error as umount has already succeeded.
It still tries to eject, because some devices require it to powerdown/prepare for removal, safely.

Changed in kdebase:
importance: Low → Medium
status: Confirmed → In Progress
Revision history for this message
Jonathan Riddell (jr) wrote :
Revision history for this message
Jonathan Riddell (jr) wrote :

This patch seems to cause kio_umountwrapper to display indefinately when running Safely Remove.

Revision history for this message
Frode M. Døving (frode) wrote :

oops. need to add an ::exit(0) after the comment.
Let's hope this works: http://frode.kde.no/misc/kdebase_mediahelper_noEjectError_r1.diff

I don't have time to build or test. Sorry.

Revision history for this message
Jonathan Riddell (jr) wrote :
Revision history for this message
Jonathan Riddell (jr) wrote :

TEST CASE: install new kdebase-kio-plugins, log and and back into KDE, plug in USB disk, open it in Konqueror or Dolphin, then Safely Remove it (right click on icon in media:/ in konqueror. right click ->actions->safely remove in Storage Media in dolphin).

Revision history for this message
Asraniel (asraniel) wrote :

cool, i hope the fix gets into one of the next updates :-) realy makes kubuntu feel more professional

Revision history for this message
Jonathan Riddell (jr) wrote :

Uploaded to hardy-proposed, waiting for approval.

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in kdebase:
status: New → Fix Committed
assignee: nobody → jr
Revision history for this message
Rich Johnson (nixternal) wrote :

And then they said, "let there be no errors!"

Finally, the error isn't popping up for me. Working here!

Revision history for this message
Job Noorman (jobnoorman) wrote :

The error message indeed disappeared, but now the icon on the desktop won't disappear after a safely remove. If I just plug out a stick without safely removing it, the icon will disappear but if I safely remove it first, the icon stays on the desktop and there is no way to remove it.
Frankly, I'd rather have a useless error message than an icon for a device that does not exist.

Please let me know if I can provide additional info.

Cheers,
Job

Revision history for this message
Frode M. Døving (frode) wrote :

Yeah, i might have found a better way to do this.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in kdebase:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Copied hardy-updates to intrepid.

Changed in kdebase:
status: In Progress → Fix Released
Revision history for this message
Paul Worrall (nicknak) wrote :

I wonder if this is the correct solution to this bug:

The HAL device for USB sticks does have an 'Eject' method. Whilst this doesn't actually make the USB stick pop out of the socket ;-), it does have the effect of removing the block device file (e.g. /dev/sdf1) and hence causing the desktop icon to be removed.

When 'Safely Remove' is selected, kdeeject is executed. This script does not call the HAL method, instead it calls the 'eject' program and this works only if the user has write access to the device file. But starting from Hardy, the device files are no longer owned by the plugdev group (see https://wiki.ubuntu.com/DesktopTeam/Specs/HardyHardwareDetection for the reasons) and hence 'eject' fails and kdeeject displays the error message mentioned in this bug.

For this reason I recon a better solution would be to patch kdeeject to use HAL's eject method as this does not depend on the user having write access to the device. Bug #217550 has such a patch but it might need some improvement?

Revision history for this message
Frode M. Døving (frode) wrote :

I am aware of this. And I also discussed it with Johnatan Riddell on IRC.
He thinks changing kdeeject is a feature-change, so it's not OK in -updates.

I however agree with you, and recommend patching kdeeject to talk to HAL.
This is what i refer to in comment 14 to this bug.

Revision history for this message
Lorenzo J. Lucchini (ljl) wrote :

Not only is there the cosmetic problems of icons sticking on the desktop...
Some devices (at least my Nokia E50, S60 operating system) will actually complain if they're removed without this "eject" action being executed.

They will inform the user that the device has been unplugged incorrectly and data loss may occur.
This is not very reassuring to the user at all...

Revision history for this message
Mitch Deoudes (mitch-houseofpain) wrote :

Regarding the patch in <a href="https://bugs.launchpad.net/bugs/217550">Bug #217550</a> (which has now been marked a dupe of this one) - the relevant command is given as:

     dbus-send --system --dest=org.freedesktop.Hal "$BLOCK_UDI" org.freedesktop.Hal.Device.Volume.Eject array:string:""

where BLOCK_UDI is gotten from here:

     dcop kded mediamanager properties "/dev/sdd2"

(replace the device file with whatever's appropriate). For some reason, this produces no results from the command line on my system (up-to-date hardy) - no unmount, no eject, nada. Oddly, right-click->Safely-Remove *does* unmount, but does not eject. (This is with the patched kdeeject from Bug #217550.)

This is with an ipod, btw. So the current steps to eject for me are: "Disconnect" in Amarok (which supposedly calls kdeeject, but still doesn't seem to unmount), "Safely Remove" from desktop, then "sudo eject /dev/sdd2" from the command line in order to get "Safe to Disconnect" screen from ipod. (Just unplugging it without the eject causes it the ipod db to become corrupt in some way.) Seems pretty onerous, just for an ipod.

Revision history for this message
Paul Worrall (nicknak) wrote :

The attached version of kdeeject seems to work for me, including an ipod and several other removable storage devices.

Revision history for this message
Mitch Deoudes (mitch-houseofpain) wrote :

Confirmed the above - Paul Worrall's version of kdeeject actually ejects my ipod, directly from amarok. Nice one, dude!

Revision history for this message
Job Noorman (jobnoorman) wrote :

Confirmed here too: the icon now immediately disappears from the desktop. Thanks Paul!

Revision history for this message
x (xk2c-deactivatedaccount) wrote :

thanks Paul Worrall that's solved it.

Revision history for this message
x (xk2c-deactivatedaccount) wrote :

err. strange. I now use Pauls's kdeeject and it works great with flash-USB Medias (USB-Pen drive) but my USB-Harddisc now gets immediately remounted when i "safely remove it".
Can that patch be modified/improved to prevent that case also? TIA

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.