Bug 116209 - cannot "safely remove" usb storage device
Summary: cannot "safely remove" usb storage device
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: media (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
Depends on:
Reported: 2005-11-12 23:19 UTC by Carlos Sanchis
Modified: 2007-05-08 18:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:

skip/omit manual umount, eject does that already (585 bytes, patch)
2006-02-08 16:52 UTC, Rex Dieter

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Sanchis 2005-11-12 23:19:52 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    SuSE RPMs
OS:                Linux

If you try to "safely remove" an usb storage device in media:/ an error message comes up:

"umount: /media/LAPIZ no está en fstab (y usted no es el usuario root)
Compruebe que el disco está correctamente introducido."

wich in Spanish means that /media/LAPIZ ("LAPIZ" is the label of mi usb stick) does not appear in /etc/fstab and that I'm no root. It also prompts me to check if the disk was in its place. Sorry, but I don't know the original English message: that's why I'm translating.

I've checked that root actually can do that throuht the command line or from media:/, so it seems to be an issue with permissions.
Comment 1 Carlos Sanchis 2005-11-13 14:29:37 UTC
I just upgraded to KDE 3.5 rc1 and I still have the same problem
Comment 2 Kevin Ottens 2005-11-13 19:46:25 UTC
As far as I know, SuSE uses supermount, and removable devices are automatically mounted this way using a root process. Then the user can't unmount it himself...
Which makes the "safely remove" action useless.

That's a SuSE specific issue, they surely forgot to disable this option that is irrelevant on their platform. Closing it as INVALID.
Comment 3 Volker Lanz 2006-01-19 22:58:50 UTC
As far as I can tell, SUSE has /bin/eject set setuid root to allow safely removing  external storage devices as a user. Unfortunately, kio_media_mounthelper wants to call umount on the device itself and shows the error message mentioned above if it fails, not going on to try calling eject. If it just called kdeeject (which would in turn call /bin/eject, which in turn would umount), the whole thing would work as expected, both using subfs (like in SUSE's case) or not.

I have patched this on my system as a temporary workaround. My whole findings on the issue are described in detail here: <a href="http://www.volker-lanz.de/en/toys/ipod_suse10/">http://www.volker-lanz.de/en/toys/ipod_suse10/</a>
Comment 4 raid517 2006-01-25 19:17:19 UTC
I also have this issue - but am using Debian unstable and KDE 3.5.

It is impossible to use the safely remove feature in KDE.

Symptoms are exactly as decrbed above. Please reopen the bug.

Comment 5 H.H. 2006-02-08 15:54:15 UTC
Why does KDE not use the patch from Volker Lanz? Has it any unwanted sideeffects?
Comment 6 Rex Dieter 2006-02-08 16:50:59 UTC
FYI, attaching patch referenced in #3
Comment 7 Rex Dieter 2006-02-08 16:52:59 UTC
Created attachment 14608 [details]
skip/omit manual umount, eject does that already
Comment 8 H.H. 2006-02-08 17:47:31 UTC
does this mean, that it is now in the current svn-version?
Comment 9 Rex Dieter 2006-02-08 17:50:15 UTC
No, simply that I attached the patch here so that folks wouldn't have to go elsewhere to see/review it.
Comment 10 Carlos Sanchis 2006-02-08 19:02:07 UTC
I'm reopening the bug because of the new info from Volker.
Comment 11 Carlos Sanchis 2006-02-08 19:03:38 UTC
Sorry for not reopening this before, I must admit that I hadn't noticed I could do that myself :-)
Comment 12 Carlos Sanchis 2006-02-08 19:41:26 UTC
I'm using KDE 3.5.1. I just realised that it doesn't work with CDs either. I get the same message when I try to "eject" or "unmount" from the context menu.
Comment 13 Carlos Sanchis 2006-02-12 11:35:23 UTC
Audio CDs are ejcted without problems.
Comment 14 kbugs 2006-02-20 15:42:05 UTC
Since eject calls umount anyway, isn't the whole cause of this issue clearly in the "helper" taking inappropriate action. That much seems to be clearly a KDE issue. I cant see the reason for this not already having been remedied since a patch has even been submitted.

as for the "unconfirmed" status, this bug has been running a year now. Several different posters on different distros have confirmed the bug.

What else is required here?
Comment 15 M. Schneider 2006-04-15 01:57:07 UTC
*** This bug has been confirmed by popular vote. ***
Comment 16 Kevin Ottens 2006-06-16 00:13:27 UTC
SVN commit 551890 by ervin:

It seems that letting "eject" handling the unmount doesn't introduce 
undesired side-effects. So let's do it this way, to avoid error on 
unmount for supermounted devices.

BUG: 116209

 M  +0 -13     kio_media_mounthelper.cpp  

--- branches/KDE/3.5/kdebase/kioslave/media/mounthelper/kio_media_mounthelper.cpp #551889:551890
@@ -91,19 +91,6 @@
 	else if (args->isSet("s") || args->isSet("e"))
-		if (medium.isMounted())
-		{
-		  DCOPRef mediamanager("kded", "mediamanager");
-		  DCOPReply reply = mediamanager.call( "unmount", medium.id());
-		  if (reply.isValid())
-		    reply.get(m_errorStr);
-		  m_device = device;
-		  if (!m_errorStr.isNull()) 
-		    {
-		      error();
-		      return;
-		    }
-		}
 		invokeEject(device, true);
Comment 17 Mary Ellen Foster 2006-08-22 17:49:02 UTC
On Fedora, some change to the media manager -- possibly this one, or maybe one of the other HAL-related changes -- has broken user unmounting for USB devices. See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203073 .

Sorry if this is the wrong change, but it seems suspicious ...
Comment 18 Rex Dieter 2006-08-23 17:38:25 UTC
Mary, see also bug #131540 for eject info.
Comment 19 Søren Holm 2006-10-25 23:29:21 UTC
I'm running KDE 3.5.5 and is not able to do a "safe remove" from the storage-applet. So the bug is from my point of view not resolved.

I am able to do it from a prompt using pumount /media/<NAME>
Comment 20 Stephan Kulow 2007-05-08 18:42:03 UTC
removing the explicit mount is wrong - it removes any error handling. Any distribution having a problem with unmount is free to patch it out though