Using Your Digital CameraHow to use your
Android smart phone
with Linux and BSD
Attach the camera to the USB port, verify that it's seen
The kernel should detect the USB device.
should display a line showing the device.
On OpenBSD, use
With either command, add the
option for verbose output and many more details.
Linux% lsusb Bus 003 Device 003: ID 046d:c404 Logitech, Inc. TrackMan Wheel Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply Bus 003 Device 001: ID 0000:0000
Bus 004 Device 006: ID 04cb:01d2 Fuji Photo Film Co., LtdBus 004 Device 003: ID 05e3:0760 Genesys Logic, Inc. USB 2.0 Card Reader/Writer Bus 004 Device 001: ID 0000:0000 Bus 002 Device 005: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0 Bus 002 Device 004: ID 03f0:5511 Hewlett-Packard Bus 002 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000
OpenBSD% usbdevs addr 1: EHCI root hub, Intel addr 2: 802.11 n WLAN, Ralink addr 1: EHCI root hub, Intel
addr 2: USB PTP Camera, Fuji Photo Filmaddr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel
may provide a detailed graphical user interface for
examining USB devices.
Use the device
There are two entirely different methods of data storage on digital cameras:
- USB Mass Storage Device
- Picture Transfer Protocol, or PTP
If your camera behaves as a mass storage device, it will appear as a SCSI disk. Mount it with something like the following:
% mount /dev/sda1 /media/camera
The device will be something like
How can you tell what the device name is?
It will probably be the first partition of some
SCSI/SATA device, but how do you get the specific name?
If you can't just guess, on Linux you could ask for your
partition tables as
# fdisk -l
You could also see what the kernel has recently noticed:
% dmesg | grep 'sd[a-z]'
How can you allow an ordinary user to mount removeable
Specify this in
% grep media /etc/fstab /dev/sda1 /media/camera auto user 0 0
If, on the other hand, your camera uses PTP, as seems more common on newer cameras, use some user-space tools.
part of the
Just bring up a Konqueror browser and change the location
That should let you browse the camera's storage. The URL ends up being something like this:
Of course, that
indicating USB bus #4 and device #6,
will depend on where you attach your camera.
lsusb output above for how you can
figure out in advance what this will be.
However, Konqueror will give give you icons to click on:
USB PTP Class Camera, then
101_FUJI (or however your camera identifies itself).
To download the pictures from the command line, simply use:
% cd /path/to/desired/storage/area % gphoto2 -P
gphoto2 manual page
for far more.
Recover Deleted Images
recoverjpeg is a very nice tool.
Get it from
If your camera works as a USB mass storage device,
you can simply find its device name (it will appear
as if it were a SCSI or SATA disk, use
to figure out its name).
Then you can image the camera's memory into a file,
and extract images from there:
$ cd $ dd if=/dev/sdb of=camera-image bs=1M $ recoverjpeg camera-image
Or you could simply recover the JPEG image files directly, there is no real need to save an image of the camera's memory:
$ cd $ recoverjpeg /dev/sdb
If, on the other hand, your camera uses the
Picture Transfer Protocol, or PTP,
then as far as I know you will have to put the memory card
into a reader so it appears as a USB mass storage device.
I don't think there's a way of using the PTP interface
to directly access or copy the memory.
gphoto2 manual page
for far more, maybe there's a way to image or directly
access the memory.