Receive kio_media_mounthelper error when removing usb device

Bug #217550 reported by Gumper
22
Affects Status Importance Assigned to Milestone
HAL
Invalid
Undecided
Unassigned
hal (Ubuntu)
Invalid
Undecided
Unassigned
kde-hal-device-manager (Ubuntu)
Invalid
Undecided
Unassigned
kdebase (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Running Hardy Heron beta with all current updates installed as of 14.04.2008. After selecting the "safely remove" function for a currently mounted usb device, the message appears that says "Synchronising data to disk, please wait...", and also the following message:

"Error - kio_media_mounthelper"
"The device was successfully unmounted, but could not be ejected"
Once I select "OK", both messages go away.

It also appears that the device is unmounted before the error message appears.

If you need any other information, please let me know.

Revision history for this message
Gumper (rlutzinger) wrote :
Revision history for this message
Gumper (rlutzinger) wrote :

Is it possible that this problem could be that the wrong command is being sent to the "kio_media_mounthelper"? If I enter the command 'kio_media_mounthelper -u media:/sdd1', the device is unmounted without any errors. If I use the command 'kio_media_mounthelper -s media:/sdd1' the device is unmounted, with the eject error. Could hal be giving the mounthelper this incorrect command? Why should it try to eject a USB device?

Revision history for this message
JBAce (kubuntu-bergqvist) wrote :

I can confirm this behaviour in Hardy Heron Beta with current updates (2008-04-20) on two different machines (HP NX7300 laptop + custom built desktop).

Revision history for this message
mfabry (mfabry) wrote :

I've got exactly the same problem on Hardy. It has probably something to do with permission rights. I can manually eject my usb stick with sudo (from console), but I cannot do the same without it. To unmount the device however I don't need sudo. My guess is one of the recent upgrades was messed up. I've seen something like this before on debian. It took me a while to solve it. I had to add my user to plugdev group to make "remove safely" option work again (not this time though, my user is already there). Anyway, closer look on /etc/groups file might help. It may be that users are not added to a correct group during upgrade or that a group is missing.

Revision history for this message
mfabry (mfabry) wrote :

Possible solution!! Add your users to the disk group. It looks like udev bug (change of permissions on some devices).

Revision history for this message
Tom Helner (duffman) wrote :

This is still an issue for the official release of hardy. Adding the users to the disk group does stop the error, but this feels like a work around.

The "safely remove" option worked fine in Feisty and Gutsy without having users in the disk group. Also If I remember correctly it worked fine on Hardy when I first installed beta 3, at some point in the beta cycle it broke.

Revision history for this message
mfabry (mfabry) wrote :

Maybe it's not a bug, but a feature after all. Like someone's idea of making the system more secure or cleaning up device permissions.

Revision history for this message
Alexander Darovsky (adarovsky) wrote :

This is a bug. There are several ways to workaround it:

The first is set "plugdev" group to removable disks instead of "disk": http://forums.gentoo.org/viewtopic-p-4195064.html?sid=813dffeae093c39fde2ad38c21d4af12#4195064

The second is to patch /usr/bin/kdeeject to be able to eject items via HAL command (see attached file and link) http://bugs.gentoo.org/attachment.cgi?id=144017&action=view

The third is to add users that were in "plugdev" group to "disk" group also, so they still have rights to eject removable devices

Revision history for this message
Tom Helner (duffman) wrote :

Looking at a Gutsy system I found what has changed. On gutsy udev would assign group rights of "plugdev" to USB portable storage, and Hardy is assigning "disk".

It looks like the following line in /etc/udev/rules.d/40-permissions.rules is the culprit:
ATTRS{type}=="0", GROUP="disk"
This line is new in Hardy. After commenting it out I now get the expected permissions:

brw-rw---- 1 root plugdev 8, 16 2008-04-29 11:06 /dev/sdb
brw-rw---- 1 root plugdev 8, 17 2008-04-29 11:06 /dev/sdb1

Revision history for this message
Alan Jenkins (aj504) wrote :

To make explicit a caveat for mfabry's workaround (adding your user to group disk): I believe this will give you write access to all _non_ removable disks, i.e. your hard drive. On a single-user machine you may be willing to accept this, but it is pretty undesirable.

Revision history for this message
Alvaro Carroz (alvaro-carroz) wrote :

Just tested the udev fix from the gentoo forums. Worked perfectly on Kubuntu 8.04.

Revision history for this message
Alvaro Carroz (alvaro-carroz) wrote :

I went back and removed the files /etc/udev/rules.d/51-local.rules, and commented the line in /etc/udev/rules.d/40-permissions.rules, so when the package is updates (hopefully fixing this) it will be overwritten.
It also worked, but using both methods the error keeps appearing when umounting and SD card.

Revision history for this message
Alexis (alxju) wrote :

Same problem (since kubuntu 8.04). Waiting for an apt-get bugfix :)

Frode M. Døving (frode)
Changed in kio-umountwrapper:
status: New → Invalid
Changed in kde-hal-device-manager:
status: New → Invalid
Changed in hal:
status: New → Invalid
status: New → Invalid
Changed in kio-umountwrapper:
status: Invalid → Confirmed
Revision history for this message
Ravi (s-ravi-in) wrote :

After removing the line mentioned by Tom from file /etc/udev/rules.d/40-permissions.rules, this is fixed. It is surprising why this small fix is still not applied, given that it happens everytime a removable disk is removed.

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

Whilst Tom's work-around may work, it goes against the Hardy hardware detection scheme specified in <https://wiki.ubuntu.com/DesktopTeam/Specs/HardyHardwareDetection>, one of the aims of which is to drop the plugdev and scanner groups. IMHO the "Proper" solution is the second one proposed by Alexander Dorovsky.

Revision history for this message
Kåre Särs (kare-sars) wrote :

here is a patch to fix it the "Proper" way :) (Alexander Dorovsky's second proposal)

cd /usr/bin
sudo patch -i /path/to/usb_umount.patch

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

Tested the above patch in an up-to-date (as of today) Hardy install. I no longer get an error message when right-click-Safely-Removing, and the device unmounts, but it does not eject. This is with an ipod. Also, kdeeject <device> does nothing from the command line or from amarok - not even unmount the device.

Previous behavior was to unmount & eject, removing the ipod icon from the desktop, and changing the ipod display from "Do Not Disconnect" to the normal operating menu. Currently, I have to "sudo eject <device>" after right-click-Safely-Removing.

Also, it seems that when re-connecting the device, it no longer gets the ipod desktop icon after the first time, but the standard hard drive icon - which has "unmount" as an option, but no "Safely Remove". The difference is syslog appears to be lines of the form:

    New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_5ac_1260_000A270019F1DEC2_if0_scsi_host').

are now replaced with:

    New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_5ac_1260_000A270019F1DEC2_scsi_host').

The "if0" is gone. I'm pretty much out of my depth at this point.

Revision history for this message
Kåre Särs (kare-sars) wrote :

This is a duplicate of:
https://bugs.launchpad.net/ubuntu/+source/hal/+bug/222041

That bug is set to fixed and updated packages are available.

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.