I have a USB Mass Storage Camera. How do I use it with digiKam ?

The Easy Way!

If you have a relatively modern Linux distribution that is pre-configured to work with USB Mass Storage Devices, there’s nothing you need to set up!. It should be truly "plug and play":

  • Plug your device in to the USB slot
  • It will be automatically detected by the kernel, and an appropriate entry in /etc/fstab will be added automatically.
  • The device will be mounted under /mnt/flash or /mnt/camera
  • Run digikam setup and add a "Mounted Camera". Set the path to the above path, where the camera is mounted.

Manual Setup

If you’re running a Linux distribution that doesn’t set up USB Mass Storage devices automatically, here are the steps you need to follow:

  • Most users using a recent Linux Distribution can skip this step. Configure the Linux Kernel:
    • Add SCSI Support
    • SCSI Support (CONFIG_SCSI)
      SCSI IDE Support (CONFIG_BLK_DEV_IDESCSI)
      SCSI disk support (CONFIG_BLK_DEV_SD)
      SCSI generic support (CONFIG_CHR_DEV_SG)
    • Add USB Support
    • Support for USB (CONFIG_USB)
      USB drivers. One or more of: ECHI HCD (CONFIG_USB_EHCI_HCD), UHCI (CONFIG_USB_UHCI), OHCI (CONFIG_USB_OHCI)
      Preliminary USB device file system (CONFIG_USB_DEVICEFS)
      USB Mass Storage support (CONFIG_USB_STORAGE)
  • Load the required kernel modules: modprobe ide-scsi sd_mod sg vfat modprobe usb-ohci (or usb-uhci depending on your usb bus) modprobe usb-storage (or usb-uhci depending on your usb bus)
  • Plug in your USB device. You should see your device listed in /proc/bus/usb/devices. If not, you need to fix the kernel or check your cabling.
  • Use the sg3-utils package to determine the device name of your USB Mass Storage Device:
    • Install the sg3-utils package (e.g. on Debian, Lindows: apt-get install sg3-utils)
    • Connect the camera and turn it onto the picture display mode
    • List your raw SCSI devices by running sg_scan -i. The output will look something like this: /dev/sg0: scsi0 channel=0 id=0 lun=0 [em] type=5 _NEC CD-ROM CD-3002A C000 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0] /dev/sg1: scsi1 channel=0 id=0 lun=0 [em] type=0 OLYMPUS C-120/D-380 1.00 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]
    • This tells me that I have 2 SCSI devices on my system: My CD drive on /dev/sg0, and a OLYMPUS D-380 Camera on /dev/sg1
    • Determine the real SCSI device associated with your USB Mass Storage Device with sg_map. The output looks like: /dev/sg0 /dev/sr0 /dev/sg1 /dev/sda
    • Now we can match the results of these last two steps. For example the Olympus camera is on the /dev/sda device.
    • In most cases, USB Mass Storage Devices will only have one partition on them, so we can safely assume that the final, mountable device is /dev/sda1 (the first partition on /dev/sda).
    • Make a directory where you can mount the camera: mkdir /mnt/camera; chmod 666 /mnt/camera
    • Try mounting the camera now: mount -t vfat /dev/sda1 /mnt/camera
    • If no errors show up, then you have performed all the steps correctly. To verify everything is right, point you file manager to /mnt/camera and you should be able to see the folder/pictures on the camera
  • Add an entry to /etc/fstab for the mount point: /dev/sda1 /mnt/camera auto defaults,user,noauto 0 0
  • Now it’s ready to go. Any user can mount the device: mount /mnt/camera
  • Make sure you unmount it before taking the card out or unplugging it: umount /mnt/camera
  • Run digikam setup and add a USB MassStorage Camera. Set the path to the above path, where the camera is mounted.