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

John Hupp lubuntu at prpcompany.com
Fri Nov 2 16:06:18 UTC 2012


Phill, I posted in the UbuntuForums at 
http://ubuntuforums.org/showthread.php?p=12333141#post12333141.  And 
yes, this Canon Powershot G1 is a digital camera with built-in memory 
which is being auto-mounted as as file system at 
gphoto2://[usb:003,004]. The Wikiinfo that applies to your webcam does 
not apply to my Canon.  (There is no /dev/video*, for instance).

Steve, you suggested that I look at writing udev rules for the camera.  
So I read up on the topic at 
http://manpages.ubuntu.com/manpages/karmic/en/man7/udev.7.html, but I 
have not yet found a way to apply that. Somewhere there is probably 
further reading that would tell me how to locate the rule that causes 
the camera auto-mount, but just taking a guess that the governing rule 
file was /lib/udev/rules.d/40-libgphoto2-2.rules (since the camera 
mounts as gphoto2://[usb:003,004]), I didn't see any rule that would 
govern auto-mount.

I could attach 40-libgphoto2-2.rules if anyone wants to see it, but it's 
179KB.

So unless I can get some pointed advice on where to locate the rule of 
interest, it looks to me like trying to write a udev rule-- while an 
appealing and compliant approach-- would be jumping down a pretty deep 
rabbit hole for me. (I mean deeper than the one I've already jumped down.)

On 11/2/2012 5:44 AM, Yorvyk wrote:
> On 02/11/12 01:10, Phill Whiteside wrote:
>> Hi John,
>>
>> I've found my little minicom usb camera / mic device. It does not get
>> mounted by PCManFM, but does appear if I check
>>
>> phillw at piglet:~$ ls /dev/video*
>> /dev/video0
>>
>> Which changes to
>>
>> phillw at piglet:~$ ls /dev/video*
>> /dev/video0  /dev/video1
>>
>> when I plug it in.
>>
>> I suspect that as my device is a real dumb web-cam, has yours got in
>> built memory? If it has, then that would explain it being mounted as a
>> storage device.
>>
>> I'm following the hints and tips from the wiki area [1] The Multimedia
>> guys on the forum are far better placed to assist you[2].
>>
>> Regards,
>>
>> Phill.
>> 1. https://help.ubuntu.com/community/Webcam#Configuring_Webcam_Software
>> 2. http://ubuntuforums.org/forumdisplay.php?f=334
>>
>>
>> On 1 November 2012 23:59, John Hupp <lubuntu at prpcompany.com
>> <mailto:lubuntu at prpcompany.com>> wrote:
>>
>>     Thanks!
>>
>>     The home page is at http://entangle-photo.org/
>>
>>     Since Entangle is not in the official repos, I installed it from
>>     GetDeb: http://www.getdeb.net/software/Entangle
>>
>>     On 11/1/2012 7:43 PM, Phill Whiteside wrote:
>>>     I'd expect USB flash drives to be auto mounted (The screams of "I
>>>     plugged my flash drive in & it didn't mount - do not worth
>>>     thinking about :) )
>>>
>>>     I'm in no way any expert on this, but IIRC, when I plugged my USB
>>>     webcam in a few cycles ago, it launched Cheese and not PCManFM.
>>>     Things will have changed and my laptop as of them is no longer,
>>>     this one has a built in one. If you have a link to Entangle I'd be
>>>     happy to install it & see how it gets on.
>>>
>>>     Regards,
>>>
>>>     Phill.
>>>
>>>     On 1 November 2012 23:06, John Hupp <lubuntu at prpcompany.com
>>>     <mailto:lubuntu at prpcompany.com>> wrote:
>>>
>>>         Perhaps it is too eager, I don't know.  It seems like standard
>>>         behavior with removable storage -- it does the same thing with
>>>         USB flash drives, which is also what Windows does.
>>>
>>>         It would also be interesting to figure out why Entangle locks
>>>         up when it tries to unmount the camera.
>>>
>>>         But in the meantime I'm very eager for a work-around. I've
>>>         put in a lot of research and testing time on this over the
>>>         lastfew weeks, and it seems that I'm close to a decent
>>>         solution with Entangle.  (I like it very much when things work
>>>         the way they should, and I prefer to see the "right" solution,
>>>         but I'll admit to some battle-weariness with confronting one
>>>         issue after another.)
>>>
>>>         On 11/1/2012 6:42 PM, Phill Whiteside wrote:
>>>>         Hi John,
>>>>
>>>>         from what you describe I think PCManFM is being maybe just a
>>>>         little too eager to mount anything that arrives in a USB
>>>>         port. As such, I'd suggest raising a bug against PCManFM in
>>>>         the first instance, it can always get re-allocated once the
>>>>         dev-team have had chance to look into it.
>>>>
>>>>         Regards,
>>>>
>>>>         Phill.
>>>>
>>>>         On 1 November 2012 22:36, John Hupp <lubuntu at prpcompany.com
>>>>         <mailto:lubuntu at prpcompany.com>> wrote:
>>>>
>>>>             I'm trying to get a Canon Powershot G1 USB-connected
>>>>             camera working with remote capture (tethering) using
>>>>             either Entangle or Gtkam.
>>>>
>>>>             Both apps get tripped up on the fact that Lubuntu
>>>>             auto-mounted the camera. Gtkam simply generates an error
>>>>             message about the camera already being in use. Entangle
>>>>             notes the same condition and offers to unmount the
>>>>             camera, but approving that causes the program to lock up.
>>>>
>>>>             Either program launches OK if I manually unmount the
>>>>             camera from pcmanfm first.
>>>>
>>>>             So I'd like to launch the camera program from a script
>>>>             that first unmounts the camera.
>>>>
>>>>             Post #2 in
>>>> http://ubuntuforums.org/showthread.php?t=967104had a
>>>>             solution in the command "gvfs-mount -s gphoto2," but
>>>>             gvfs-mount is not installed by default in Lubuntuand is
>>>>             not available from the default repos.
>>>>
>>>>             I also tried "sudo umount /home/<user>/.gvfs," which was
>>>>             the mount point suggested to me by "sudo mount." That ran
>>>>             without error, but the camera did not seem to be truly
>>>>             unmounted, and both cam apps errored as before.
>>>>
>>>>             What's my best solution in Lubuntu?
>>>>
>>>
> >
> I think you need to be looking at writing udev rules for the camera.
>
> -- 
> Steve
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20121102/bbef1768/attachment.html>


More information about the Lubuntu-users mailing list