Bug 164053

Summary: KDE should automatically mount all removable media at logon or when plugging in
Product: [Unmaintained] plasma4 Reporter: Frederik Himpe <fhimpe>
Component: widget-devicenotifierAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: adreeve, andresbajotierra, anselmolsm, arvidjaar, aseigo, asraniel, axel, bgn66922, chgonzalezg, greatbunzinni, idefy, james.ellis, jan.hlodan, kfunk, kontakt, lamarque, lex.lists, moritz-kdebugs, mutlu_inek, olivier.emery, pocallaghan, PVince81, shafff, sven.burmeister, tcech, tdfischer, Terranarion, th0ma7, tl, updatedb, vidakris, weber-jonathan, wilderkde
Priority: NOR Keywords: junior-jobs, regression, usability
Version: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Frederik Himpe 2008-06-14 14:41:32 UTC
Version:           4.0.82 (using Devel)
Installed from:    Compiled sources

KDE only mounts file systems on removable systems if you open them via Dolphin/Konqueror, the Device Notifier Plasma or the file dialog. However it does not mount devices automatically right after plugging them in or when logging if (if the device was plugged in before log on).

This causes confusion for users, because they are unable to save/open files from within non-KDE applications (think of OpenOffice.org) without browsing the file system with Dolphin first. GNOME's behaviour of always automatically mounting all file systems, is much more intuitive, and corresponds also to what Windows and Mac OS X are doing.
Comment 1 Moritz Moeller-Herrmann 2008-07-11 01:17:13 UTC
I can confirm this, the option to automount devices is missing (it was present in KDE 3.0)
Comment 2 Moritz Moeller-Herrmann 2008-11-24 11:45:44 UTC
Someone has already done all the work, this should become part of KDE-4.2 (I hope this is not blocked by the feature freeze, lack of automounting is a BUG)

http://www.kde-look.org/content/show.php/New+Device+Notifier+with+Automount?content=91517&PHPSESSID=fe455f7cf34deaca909446280c6c7c47
Comment 3 Aaron J. Seigo 2008-11-29 02:40:48 UTC
well, if the person who wrote that code would have the decency to send patches upstream, maybe it could have ended up in 4.2. 

in any case, this is a feature request.

i'd suggest making it optional, however, as this may not be desirable in all cases.

"because they are unable to save/open files from within non-KDE applications"

you know, there's only so much we can do to fix other people's messes. i don't see how it's a failure of KDE that OO.o doesn't have the ability to list available drives in its file dialog as we do in kde4.
Comment 4 Dario Andres 2009-04-11 17:02:32 UTC
*** Bug 189371 has been marked as a duplicate of this bug. ***
Comment 5 Moritz Moeller-Herrmann 2009-05-25 12:55:46 UTC
Maybe this could be added in time for KDE-4.3? It is very annoying to have to open dolphin, when all I want to do is mount my USB stick.
Comment 6 Aaron J. Seigo 2009-05-25 16:45:36 UTC
we are, once again, in feature freeze. someone who cares about this really needs to bring it up when we aren't in a feature freeze.

as a side note, some care to only mount file systems that make sense should probably be applied. just mounting everything possible is a little daft (cameras come to mind as an obvious example of something that often can be mounted shouldn't necessarily be mounted).
Comment 7 Vincent Fortier 2009-05-26 12:02:32 UTC
In my perspective there are few things in this bug request:
1) Mounting any removable devices by default when it gets plugged (initial comment).  Although I personally agree with comment #3 & #6, I would not want to mount everything all the time...

2) Getting a new icon for a mount-only action within the new device notification plasmoid instead of being only able to open a file browser by default. (my "view" of comment #5).  I see that as being very very useful.

3) Making sure applications are capable of getting access back to removable devices at next logon without any "human" interventions... (my view of the initial comment and comment #3).  That indeed would be a nice feature.  If a set of devices where mounted when I logged out why don't it remount it by default at next login if they are available?  For instance, that would make sure picture frame plasmoid which access my usb drive to randomize photos work at next login instead of me getting pissed and be mounting manually the drive so it works... That really is a must!

4) Being able to manage "removable devices" and thus "automount" them... I would see something like the network manager but in a "removable device manager"... just like network manager tries to reconnect you to your last working wifi network the "removable device manager" would do a similar task.  And getting options to decide weather or not I want to automatically mount that drive and to what mounting point (in a expert sub-section with selectable mount options) .... At least that is my view of comments #1, #3 and #6 and I think that would become really really useful... :)
Comment 8 Moritz Moeller-Herrmann 2009-06-02 12:18:38 UTC
(In reply to comment #6)
> we are, once again, in feature freeze. someone who cares about this really
> needs to bring it up when we aren't in a feature freeze.
> 
> as a side note, some care to only mount file systems that make sense should
> probably be applied. just mounting everything possible is a little daft
> (cameras come to mind as an obvious example of something that often can be
> mounted shouldn't necessarily be mounted).

I always thought that was what a bug tracker was for - to serve as a reminder.
 Lots of stuff is added to plasma, but bugs with an existing fix is not applied without a reminder - strikes me as lack of maintainer attention actually. I would love to file a duplicate bug once the code freeze for 4.3 is over. 

This is one of the most annoying things in KDE4 for me and just the kind of stuff that is sooo easy to fix, but sooo annoying until it is. Please try to explain to a new convert to KDE that you have to open a file browser to mount a file... Crazy! That he has to remount his USB drive every time at login Crazy..! That all wonderfully restored session managed applications complain about missing files. Crazy...!

Should we relabel this to a bug?
Comment 9 Jan Hlodan 2009-06-03 21:41:04 UTC
I have two external disks pluged in and after system starts up, they are unmounted. If I want to mount them all (5 partitions), I need to open them via dolphin (5 times!)
(3 x reiserfs, 1 x ext3, 1 x fat)
I think, it's a bug. KDE should automatically mount (at least) pluged disks during the boot.
Comment 10 babuum 2009-06-08 20:48:47 UTC
I'm missing auto-mounting too! 
Please, integrate the fix into KDE4.3
Thank you.
Comment 11 Nick Shaforostoff 2009-06-11 10:56:30 UTC
are we able to uniquiely identify devices somehow? we could have 'automount this device in future' option then.
Comment 12 Ray Charles 2009-06-11 20:28:37 UTC
> are we able to uniquiely identify devices somehow? we could have 'automount
> this device in future' option then.

What about the UUID?
Comment 13 Adam 2009-06-11 23:53:20 UTC
(In reply to comment #11)
> are we able to uniquiely identify devices somehow? we could have 'automount
> this device in future' option then.

What's the point in only automounting some drives though? Why not just automount all of them? This is the behaviour in other desktop environments and operating systems.
Comment 14 Jan Hlodan 2009-06-11 23:55:42 UTC
(In reply to comment #2)
> Someone has already done all the work, this should become part of KDE-4.2 (I
> hope this is not blocked by the feature freeze, lack of automounting is a BUG)
> 
> http://www.kde-look.org/content/show.php/New+Device+Notifier+with+Automount?content=91517&PHPSESSID=fe455f7cf34deaca909446280c6c7c47

Apparently it's not part of KDE 4.2 
Is this auto-mounting feature coming into KDE 4.3?
Comment 15 Olivier E. 2009-07-05 11:05:52 UTC
It's still NOT enabled in KDE 4.3 RC1 ...
Comment 16 Beat Wolf 2009-07-09 23:28:48 UTC
dupe of https://bugs.kde.org/show_bug.cgi?id=161176 ?
Comment 17 Dario Andres 2009-07-09 23:39:42 UTC
*** Bug 161176 has been marked as a duplicate of this bug. ***
Comment 18 Beat Wolf 2009-07-21 12:56:57 UTC
somebody is working on it it seems

http://wm161.net/2009/07/20/automounting-in-kde4/
Comment 19 mutlu inek 2009-07-21 13:12:27 UTC
I tried to add a comment to the blog post Beat Wolf linked to above, but the comment could not be submitted, so let me try here:

First of all, Trevor, this is a much appreciated effort! Thank you for your work. :)

One suggestion: In comments #11 and #12, it was suggested to mount only some removable media, based on their UUID. I think it would be a great idea to make a) mounting and b) commands run after mounting dependent on the UUID. I might not want some drives to be mounted automatically. Or, I might always do the same thing with a drive. For example, I have an external drive which I use only for backups. It would be great if the automounter or the devices plasmoid could be configured to automatically open the device with a certain program. On MacOS, for example, this is what happens when a drive is configured as a backup drive for TimeMachine.

Thank you for your attention!
Comment 20 jamese 2009-07-21 14:08:44 UTC
Referencing a kubuntu bug on launchpad I lodged many moons ago regarding just this issue:

https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/255533
Comment 21 Torrie Fischer 2009-07-23 19:07:20 UTC
(In reply to comment #19)
> I tried to add a comment to the blog post Beat Wolf linked to above, but the
> comment could not be submitted, so let me try here:
> 
> First of all, Trevor, this is a much appreciated effort! Thank you for your
> work. :)
> 
> One suggestion: In comments #11 and #12, it was suggested to mount only some
> removable media, based on their UUID. I think it would be a great idea to make
> a) mounting and b) commands run after mounting dependent on the UUID. I might
> not want some drives to be mounted automatically. Or, I might always do the
> same thing with a drive. For example, I have an external drive which I use only
> for backups. It would be great if the automounter or the devices plasmoid could
> be configured to automatically open the device with a certain program. On
> MacOS, for example, this is what happens when a drive is configured as a backup
> drive for TimeMachine.
> 
> Thank you for your attention!

Thanks for telling me my comments are borked. I'll have to get on that...

As far as your suggestions go, thats what I'm planning on adding soon. There is already a solid-actions KCM that is supposed to let you automatically run a program when a device is attached, but I haven't seen it work for me yet. It seems to have been untouched since May 30th, so I figure the author wouldn't mind if I had a look-see if I asked nicely. I plan on working with him on combining his nice KCM UI with my already-working stuff so we can have device automounting /and/ "running arbitrary programs when devices move around" in one go.
Comment 22 Patrick O'Callaghan 2009-07-24 17:59:17 UTC
See also: https://bugs.kde.org/show_bug.cgi?id=192671
Comment 23 Moritz Moeller-Herrmann 2009-08-05 21:58:27 UTC
*** Bug 175611 has been marked as a duplicate of this bug. ***
Comment 24 Moritz Moeller-Herrmann 2009-08-05 21:59:05 UTC
*** Bug 174612 has been marked as a duplicate of this bug. ***
Comment 25 Moritz Moeller-Herrmann 2009-08-05 21:59:53 UTC
*** Bug 196624 has been marked as a duplicate of this bug. ***
Comment 26 Moritz Moeller-Herrmann 2009-08-05 22:00:57 UTC
*** Bug 192671 has been marked as a duplicate of this bug. ***
Comment 27 Moritz Moeller-Herrmann 2009-08-05 22:16:48 UTC
*** Bug 187366 has been marked as a duplicate of this bug. ***
Comment 28 Moritz Moeller-Herrmann 2009-08-05 22:17:28 UTC
*** Bug 198783 has been marked as a duplicate of this bug. ***
Comment 29 Moritz Moeller-Herrmann 2009-08-05 22:18:01 UTC
*** Bug 191046 has been marked as a duplicate of this bug. ***
Comment 30 Moritz Moeller-Herrmann 2009-08-05 22:18:24 UTC
*** Bug 185262 has been marked as a duplicate of this bug. ***
Comment 31 Moritz Moeller-Herrmann 2009-08-05 22:18:45 UTC
*** Bug 185694 has been marked as a duplicate of this bug. ***
Comment 32 Moritz Moeller-Herrmann 2009-08-05 22:19:09 UTC
*** Bug 170457 has been marked as a duplicate of this bug. ***
Comment 33 Moritz Moeller-Herrmann 2009-08-06 15:07:59 UTC
Since KDE-4.3 has been released without a solution (but is very nice apart from this), feature freeze has ended. Could someone please fix this? Aaron asked to raise this issue outside of feature freeze, which I hereby do.
Comment 34 Dario Andres 2009-08-06 15:10:09 UTC
Try to contact the developer of http://websvn.kde.org/trunk/playground/base/device-automounter/ , so it can be reviewed and hopefully merged.
Comment 35 S. Burmeister 2009-08-06 15:36:21 UTC
(In reply to comment #34)
> Try to contact the developer of
> http://websvn.kde.org/trunk/playground/base/device-automounter/ , so it can be
> reviewed and hopefully merged.

That tool works nicely already. If you mounted a device once manually, i.e. e.g. by clicking on it in dolphin, it will mount it again as soon as/if it is attached while kde starts.

It is available as package for opensuse already, so ask your distro to package it.

I think with the above tool available this bug can be marked as fixed. IMHO it should become part of kdebase, but that is another matter.
Comment 36 Adam 2009-08-26 10:54:11 UTC
Can someone please explain why you can't just automount all drives automatically? When wouldn't you want a drive mounted? If it's just certain types of devices that people don't want mounted, can you check for CDs and USB drives etc and mount them automatically, but not other drives?

My problem is I have a USB drive I use to synchronise my work between different computers using Unison. It's annoying having to open dolphin then close it again just to do this.
Comment 37 S. Burmeister 2009-08-26 11:06:13 UTC
(In reply to comment #36)
> Can someone please explain why you can't just automount all drives
> automatically? When wouldn't you want a drive mounted? If it's just certain
> types of devices that people don't want mounted, can you check for CDs and USB
> drives etc and mount them automatically, but not other drives?
> 
> My problem is I have a USB drive I use to synchronise my work between different
> computers using Unison. It's annoying having to open dolphin then close it
> again just to do this.

Get the device-automounter package for your distro, install it and mount your usb drive once via dolphin, after that it will be mounted automatically.
Comment 38 Andrey Borzenkov 2009-08-26 16:45:49 UTC
(In reply to comment #37)
> mount your usb drive once via dolphin

Why, oh why should I use dolphin when all I want is to mount it? Why cannot we have device-notifier settings for default action; this way those who want to use dolphin are free to set default action to it; and those who want to just mount it will set default action to mount.
Comment 39 Patrick O'Callaghan 2009-08-26 18:21:55 UTC
I agree that having a configurable default action would be useful. Whether this should depend on the UUID is another matter. Pendrives by and large aren't going to have a UUID, so perhaps more than one criterion should exist.

In the meantime, note that adding a "Mount" action to the device-notifier widget is actually quite easy (System Settings->Advanced Tab-> etc. and create a new action). I did it a couple of weeks ago and it works fine. Now if I could only preselect it instead of the current "Open Digikam" action -- which in my context is *never* correct -- then I'd be a lot happier.
Comment 40 Andrey Borzenkov 2009-08-26 18:29:21 UTC
(In reply to comment #39)
> In the meantime, note that adding a "Mount" action to the device-notifier
> widget is actually quite easy

Of course. I used it since KDE3 where plain mount was missing as well IIRC, at least for some device types (that I happened to use).

What I still do not understand, why this action is not available by default.
Comment 41 Krisztian Vida 2009-08-26 18:43:22 UTC
What command did you define for mounting the disks? 
When KDE mounts an USB-drive, it creates a directory for it, which isn't done if you mount the drive manually - how can this done from the command line?
Comment 42 Patrick O'Callaghan 2009-08-26 18:53:43 UTC
In the device action script, "mount %f" works. For the filter criteria I used: "All conditions" ("The device must be of the type StorageVolume" AND "The devices property StorageVolume.ignored must equal False")

The device is mounted under /media.
Comment 43 Andrey Borzenkov 2009-08-26 19:03:12 UTC
(In reply to comment #41)
> What command did you define for mounting the disks? 

{pts/0}% cat .kde4/share/apps/solid/actions/test-predicate-mount.desktop
[Desktop Entry]
X-KDE-Solid-Predicate=[[ StorageVolume.ignored == false AND StorageVolume.usage == 'FileSystem' ] OR [ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ]]
Type=Service
Actions=mount;

[Desktop Action mount]
Name=Mount
Exec=solid-hardware mount %i
Comment 44 Lamarque V. Souza 2009-08-26 19:33:19 UTC
You do not need to execute any program, using /bin/true suffices. My .desktop is like this and works:

[Desktop Action open]
Exec=/bin/true
Icon=emblem-mounted
Name=Montar

[Desktop Entry]
Actions=open;
Type=Service
X-KDE-Action-Custom=true
X-KDE-Solid-Predicate=[ [ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ] ] OR [ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ] ]
Comment 45 Adam 2009-09-07 23:58:09 UTC
Anyone have any success getting the device-automounter working in Kubuntu? Trying to access http://websvn.kde.org/trunk/playground/base/device-automounter I just get a 404 and a Python traceback.
Comment 46 Dario Andres 2009-09-08 00:00:07 UTC
@Adam: it was moved to kdereview to get the proper review before going mainstream:
http://websvn.kde.org/trunk/kdereview/device-automounter/

Thanks
Comment 47 Giorgos Pallas 2009-09-11 14:29:14 UTC
connected devices should not be automatically mounted... Best would be a configurable option.
Comment 48 Dario Andres 2009-09-27 20:21:12 UTC
@Giorgos Pallas: the proposed solution is configurable by device (automount-disabled by default)
Comment 49 Beat Wolf 2009-11-26 15:14:08 UTC
the device automounter moved to trunk. It will be released in 4.4