4

I set up rsync as an hourly cron job to back up data to an external USB device which is always plugged into my machine.

I see that Thunar (version 1.6.3 / Xubuntu 13.10) can mount this device when I just click on it in the left pane of the file manager under Devices. I can also right-click to "eject" it.

I want to know the actual command Thunar uses to mount/unmount the device without needing sudo. Then I can put the same command in autostart so that rsync can do its work. Now, if I forget to mount the USB device, rsync won't do the backup.

2
  • I'm not sure how Thunar does it, but I'm not sure of a way of mounting/unmounting filesystems other than mount and umount
    – Hugo Buff
    Mar 14, 2014 at 10:52
  • You could turn on automounting whenever a USB device is connected to the computer.
    – landroni
    Mar 21, 2014 at 15:53

2 Answers 2

6

Thunar, in xubuntu, uses udisks for it's volume management. Having said so, once thunar-volman is notified about a new device from udev, it does:

udisksctl mount -b /dev/$block

It just replaces block with whatever is being mounted, and throws it in /media, depending on the label in the filesystem. Some file managers use a dbus call to org.freedesktop to access the udisk mount methods, but whether it's the dbus call or the udisksctrl command, as long as there is a rule in your policy kit config, the command will run.

Ref: http://ubuntuforums.org/showthread.php?t=2204350&page=2&p=12925064#post12925064

-1

Yes, Thunar uses the udisks2 daemon in the background.

Which is a useful information - in my case, it helped me to add big_writes and lazytime to the default mount options for NTFS volumes (catered for by ntfs-3g, needed for libfuse < v3 , useful to know if you face sluggish NTFS writes). This can be done in /etc/udisks2/mount_options.conf . Uncomment the [defaults] section label and modify ntfs_allow and ntfs_defaults to suit your needs. After that, you still need to restart the service: systemctl restart udisks2 (maybe gracefully eject your removable volumes before this operation)

...and then I realized that it was really my shingled HDD that was slow, in that external USB enclosure :-(

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .