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 <benny@xfce.org> Copyright (c) 2010-2011 Jannis Pohlmann <jannis@xfce.org> All rights reserved. Please report bugs to <http://bugzilla.xfce.org/>. Thanks, Val.
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.
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!.
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.
Auto-mounting worked fine in 4.8. What has changed since then? Maybe
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.
I have the same problem in Xubuntu 12.10 with XFCE 4.10. With the workaround it seems to work now. Thanks to vaxon77
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
(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.
Is there any further investigation of this problem?
The problem remains when using gvfs of version 1.18.2-2
I compiled the patch in comment 3, which appears to fix the problem, at the cost of a delay in mounting.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725978 CD/DVD/ any optical disk mount can be broken by udisks2.
Also see https://bugs.freedesktop.org/show_bug.cgi?id=69825
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
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.
I'm also affected by this bug. Why nobody fix thunar-volman? The bug report is open since 2012....
I desisted and started using udiskie instead. Never had a problem again.
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.
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..
https://bugzilla.xfce.org/show_bug.cgi?id=9193#c14 doesn't work reliably for me. It may be that it doesn't help at all, except to cause the race condition to sometimes come out the "right" way. The problem is still active with Thunar 1.6.6 and thunar-volman 0.8.0. I'm going to try to add some patches to the current versions.
My patch that tries to get the volume up to three times, with a 1-second delay between each time, hides the problem successfully. However, a better solution would be to have thunar-volman only called when the volume has been set up. This is known, as the volume has to be set up for the icon to appear on the desktop.
> https://bugzilla.xfce.org/show_bug.cgi?id=9193#c14 > > doesn't work reliably for me. It may be that it doesn't help > at all, except to cause the race condition to sometimes come > out the "right" way. I honestly do not know. In the latest versions of fedora not have problems and use this change by default.. :S On thunar volman 0.8.1 added my patch.. :S http://git.xfce.org/xfce/thunar-volman/commit/?id=f3f8ba9d92923492d93672676dffc5f65c068ea9 As they added to the patch, Please at least reduce the time to one or two seconds. 5 seconds is completely unnecessary.
I see that 0.8.1 has your patch. I think that better than waiting 1 second would be to try immediately and only then wait for a bit. I modified the code accordingly, ending up with static gboolean tvm_block_device_mount_volume (TvmContext *context, GVolume *volume) { GMountOperation *mount_operation; /* check if we have a volume */ if (volume != NULL) { /* check if we can mount the volume */ if (g_volume_can_mount (volume)) { /* try to mount the volume asynchronously */ mount_operation = gtk_mount_operation_new (NULL); g_volume_mount (volume, G_MOUNT_MOUNT_NONE, mount_operation, NULL, (GAsyncReadyCallback) tvm_block_device_mount_finish, context); g_object_unref (mount_operation); } else { g_set_error (context->error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Unable to mount the device")); /* finish processing the device */ tvm_device_handler_finished (context); } } else { g_set_error (context->error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Could not detect the volume corresponding to the device")); /* finish processing the device */ tvm_device_handler_finished (context); } return FALSE; } static gboolean tvm_block_device_mount_retry (TvmContext *context) { GVolume *volume; volume = tvm_g_volume_monitor_get_volume_for_kind (context->monitor, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE, g_udev_device_get_device_file (context->device)); /* if no volume then call anyway to do not-found processing */ tvm_block_device_mount_volume (context,volume); return FALSE; } static gboolean tvm_block_device_mount (TvmContext *context) { GVolume *volume; g_return_if_fail (context != NULL); /* determine the GVolume corresponding to the udev device */ volume = tvm_g_volume_monitor_get_volume_for_kind (context->monitor, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE, g_udev_device_get_device_file (context->device)); if (volume != NULL) { tvm_block_device_mount_volume(context,volume); } else { /* clean up and try again in one second */ g_object_unref (context->monitor); context->monitor = g_volume_monitor_get (); g_timeout_add_seconds(1, (GSourceFunc) tvm_block_device_mount_retry, context); } return FALSE; } What's the best way to get this put into thunar-volman?
> I see that 0.8.1 has your patch. Yes .. Even though I recommended do it. hah :S > I think that better than waiting 1 second would be to try > immediately and only then wait for a bit. I modified the > code accordingly, ending up with Looks better.. =) > What's the best way to get this put into thunar-volman? Clone the repo, commit your change with a good description and make a patch from this commit. ;) Then attach it here. If you doubt, do it with a graphical interface as gitg- =) Regards.
Created attachment 6191 Try to get GVolume right away and only if that fails wait for 1 second This should change the total delay from 5 seconds per partition to at most 1 second for an entire physical device.
OK, done. Hopefully this will get picked up faster than your patch.
No action yet that I can see. Does anyone know how to get this patch looked at? The current setup with its 5 second delay is getting annoying.
*** Bug 10801 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar-volman/-/issues/4. Please create an account or use an existing account on one of our supported OAuth providers. If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev