Removable drives and media not automatically mounted/listed

Bug #1320542 reported by Matthew Haughton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
thunar-volman (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The fix released for bug #1210898 did not fix the issue for me.

I have checked "Enable volume management" in Thunar's preferences. Under "Removable Storage" in the "Removable Drives and Media" window the following are checked:

* Mount removable drives when hot-plugged
* Mount removable media when inserted
* Browse removable media when inserted

The auto-mounting only works when a Thunar window is open. The same behaviour is experienced for SD cards using the laptop's built in card reader, and USB storage devices.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: thunar-volman 0.8.0-4ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat May 17 15:14:45 2014
InstallationDate: Installed on 2012-12-26 (507 days ago)
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
SourcePackage: thunar-volman
UpgradeStatus: Upgraded to trusty on 2014-03-13 (65 days ago)

Revision history for this message
In , Vaxon77 (vaxon77) wrote :

I have "Mount removable drives when hot-plugged" option enabled.
However, thunar-volman fails to mount any removable media.

I've made the following script as a workaround for the issue:

cat /usr/local/bin/thunar-volman
#!/bin/sh
sleep 1
exec /usr/bin/thunar-volman $@ >/tmp/thunar-volman.log 2>&1

Mount succeeds if thunar-volman is started after a small delay.
If I comment "#sleep 1", mount fails and the output of /tmp/thunar-volman.log looks as follows:
cat /tmp/thunar-volman.log
thunar-volman: Could not detect the volume corresponding to the device.

/usr/bin/thunar-volman --version
thunar-volman 0.8.0 (Xfce 4.10)

Copyright (c) 2004-2007 Benedikt Meurer <email address hidden>
Copyright (c) 2010-2011 Jannis Pohlmann <email address hidden>

All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.

Thanks,
Val.

Revision history for this message
In , Vaxon77 (vaxon77) wrote :

The problem seems to be in the inconsitency between thunar and thunar-volman.

Thunar seems to be using UDEV events to detect device add/remove, while thunar-volman uses GVolumeMonitor to find a volume corresponding to the added device and mount it. The problem is gvolume monitor has not set-up the new device volume by the time thunar-volman is started. Obviously UDEV events are emitted first and there's no guarantee GVolumeMonitor manages to set up a volume fast enough for thunar-volman to use it.

I'm not thunar expert, but probably the best way to fix it would be to use the the same event monitoring mechanism in both thunar and thunar-volman. For example, if thunar started thunar-volman based on GVolumeMonitor "volume-added" events AOT UDEV device add events, thunar-volman would detect the volume and mount it without any problems.

Thanks,
Val.

Revision history for this message
In , Mati86dl (mati86dl) wrote :

Confirm it.
Inspire in thunar-volman code now try to add support to remobable devices in pragha, and I found this problem.

Now I did a quick test, and adding a sleep (5) before tvm_g_volume_monitor_get_volume_for_kind, solves all the problems.

ONLY A TEST!.

Revision history for this message
In , Mati86dl (mati86dl) wrote :

Created attachment 4608
Mount devices with a timeout of 5 seconds.

Tested in Fedora 17 with xfce 4.10.
Only wait 5 seconds to make sure that glib detect the volume.

Revision history for this message
In , Andriy Yurchuk (ch00k) wrote :

Auto-mounting worked fine in 4.8. What has changed since then? Maybe

Revision history for this message
In , Peter F. Patel-Schneider (pfpschneider) wrote :

Adding a sleep at the beginning of twm_block_device_mount doesn't work for me. However, adding a sleep in main() does.

Further, adding a loop inside twm_block_device_mount with a sleep and retry of the tvm_g_volume_monitor_get_volume_for_kind doesn't help at all, even when the total delay runs into several minutes, and even when a new volume monitor is created.

I find this very strange - it is almost as if the contents of the volume monitor are fixed at thread invocation time and can't change thereafter. There is something about volume monitor not being thread-safe, but I don't understand just what this means.

Revision history for this message
In , Philipp (flashdoebi) wrote :

I have the same problem in Xubuntu 12.10 with XFCE 4.10.
With the workaround it seems to work now.

Thanks to vaxon77

Revision history for this message
In , programmist11180 (programmer11180) wrote :

Debian Wheezy, XFCE 4.10. When gvfs 1.16 and udisks2 2.1 is installed, Thunar mounts cd/dvd only if xfburn is launched. Mounts work normal with gvfs 1.12 and udisks 1.0.4

Revision history for this message
In , Alexander (alexkalachev) wrote :

(In reply to programmist11180 from comment #7)
> Debian Wheezy, XFCE 4.10. When gvfs 1.16 and udisks2 2.1 is installed,
> Thunar mounts cd/dvd only if xfburn is launched. Mounts work normal with
> gvfs 1.12 and udisks 1.0.4

I have experienced the same problem with the software you mentioned. Also, I couldn't mount my android phone to. When I've downgraded gvfs and udisks to debian's 'stable' branch, i.e. gvfs 1.12 and udisk 1.0.4, I've got automount worked both for cd/dvd and android phone.

Revision history for this message
In , Peter F. Patel-Schneider (pfpschneider) wrote :

Is there any further investigation of this problem?

Revision history for this message
In , programmist11180 (programmer11180) wrote :

The problem remains when using gvfs of version 1.18.2-2

Revision history for this message
In , Peter F. Patel-Schneider (pfpschneider) wrote :

I compiled the patch in comment 3, which appears to fix the problem, at the cost of a delay in mounting.

Revision history for this message
In , programmist11180 (programmer11180) wrote :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725978
CD/DVD/ any optical disk mount can be broken by udisks2.

Revision history for this message
In , programmist11180 (programmer11180) wrote :
Revision history for this message
In , programmist11180 (programmer11180) wrote :

A simple way to fix CD/DVD mount and others with udisks2: add to /etc/rc.local:

echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs

and reboot (Or, if you don't want to reboot now, you can execute this command from the root).

See for more details:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725978
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713877

Revision history for this message
In , Alejandro Perez (alejandro-perez-mendez) wrote :

I have the exact same problem, that gets fixed either with the script or the patch (setting it to 1s, instead of 5s).

Please, fix this issue :)

Besides, I detected that thunar needs to be running, either as a daemon or a window open.

Revision history for this message
In , P-willaime (p-willaime) wrote :

I'm also affected by this bug.

Why nobody fix thunar-volman? The bug report is open since 2012....

Revision history for this message
In , Alejandro Perez (alejandro-perez-mendez) wrote :

I desisted and started using udiskie instead. Never had a problem again.

Revision history for this message
In , adam jvok (ajvok1) wrote :

Still a problem

$ thunar-volman -V
thunar-volman 0.8.0 (Xfce 4.10)

$ thunar -V
Thunar 1.6.3 (Xfce 4.10)

Please fix.

Revision history for this message
Matthew Haughton (snafu109) wrote :
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Is the Thunar daemon process running in the background?

Revision history for this message
Matthew Haughton (snafu109) wrote :

No, it wasn't... when I added 'thunar --daemon' to the autostart programs and restarted the session the auto-mounting did work.

I'm sorry, this bug is invalid - thunar-volman is working as expected, the problem is that thunar wasn't starting with the session though I don't know if this is by design or a bad config on my machine.

Thanks for the pointer and quick reply.

Changed in thunar-volman (Ubuntu):
status: New → Invalid
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

It should be started automatically on session login. I therefore suspect that a saved session without the Thunar daemon is loaded in your case. Try to clear the session cache via Settings Manager > Session and Startup > Session and test again.

Revision history for this message
Matthew Haughton (snafu109) wrote :

I think that was exactly the problem. I removed the manual entry for thunar --daemon from the autostart list, cleared the session and restarted. Thunar did start as a daemon and drives auto mount when hot plugged.

Changed in thunar-volman:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Mati86dl (mati86dl) wrote :

Hi there.
I wrote the proposed patch, but honestly not recommend it..

This may solve the problems, but it really is not a problem of thunar!. it's definitely a problem between udev/udisk and glib!.

Please, Those who have problems, test the comented on:

https://bugzilla.xfce.org/show_bug.cgi?id=9193#c14

With it work properly, and no require changes in any code..

no longer affects: thunar-volman
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.