[Lubuntu] How to unmount a camera from the command line?

John Hupp lubuntu at prpcompany.com
Mon Nov 5 20:21:38 UTC 2012


On 11/3/2012 4:54 AM, Yorvyk wrote:
> On 03/11/12 00:02, John Hupp wrote:
>> Despite what I wrote below, I had the further thought that, "Yes, I
>> would like to know how to write udev rules, and if I can find a
>> well-written how-to, then I'll move ahead."
>>
>> And indeed, I believe I found such a document at
>> http://www.reactivated.net/writing_udev_rules.html
>>
>> But after plowing through the whole thing, I encountered this
>> mysterious warning in his USB Camera section:
>>
>> Like most, my camera identifies itself as an external hard disk
>> connected over the USB bus, using the SCSI transport. To access my
>> photos, I mount the drive and copy the image files onto my hard
>> disk.
>>
>> Not all cameras work in this way: some of them use a non-storage
>> protocol such as cameras supported by gphoto2. In the gphoto case,
>> you do not want to be writing rules for your device, as is it
>> controlled purely through userspace (rather than a specific kernel
>> driver).
>>
>> Though I don't understand what he was saying about userspace, I
>> observe that pcmanfm displays the camera files locationas
>> gphoto2://[usb:003,004] rather than a usual device or file system
>> path. Plus /dev/disk seems to have no reference to the camera
>> memory.
>>
>> Does this seem like a udev rule show-stopper when it comes to solving
>>  this problem?
>>
> I remember this been a monumental pain to set up, unfortunately the 
> camera died in a flood so we no longer have anything to refer back to. 
> We did use http://capture.sourceforge.net/ apparently. Whether we used 
> this directly or just gained ides/info from it we can't remember, but 
> it may be of some use even though it doesn't mention your camera.
>
Marcus Meissner from the gphoto email list confirmed that udev rules 
won't help here. He wrote:

/gvfs does "virtual" mounts of devices, not only just USB mass storage 
kinds.//
//
//Most remote controllable cameras are not USB Mass storage devices, 
//and the USB access is in userland, via libusb.//
//
//gvfs turns this into a virtual drive that it can represent to Nautilus 
et.al. //and offers it via "fuse" (userland filesystem) below the 
~/.gvfs/ tree.//
//
//So looking at udev rules does not help./
---------------

I went on to install gvfs-bin, which includes gvfs-mount, and then wrote 
this script to unmount the camera's memory filesystem before trying to 
run a remote capture program (here, entangle):

     #!/bin/sh
     gvfs-mount -s gphoto2
     sleep 10
     entangle

That successfully got me past the initial problem of tripping over 
pcmanfm's auto-mount of the camera's memory, but then I ran into another 
bug which I detail as further information in this report: 
https://gna.org/bugs/index.php?20286
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20121105/5319c11f/attachment.html>


More information about the Lubuntu-users mailing list