Month: November 2007

  • worked it out: unable to import photos from digital camera via USB to fedora 7 system

    I ran into this problem and spent an annoying two hours trying to figure it out. I couldn't get the photos off my camera to my Fedora 7 x64 system. The gthumb import dialog gives the error:

    "An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device."

    Google turned up a few hits but none seemed to give the immediate answer. A few of the hits suggested it was a permissions problem. This is verified via the terminal with 'gphoto2 --list-files' (if you run it as root, you can access the camera fine, but not via the regular user account). However, I didn't want to switch to root just to get photos off my camera, and I wasn't thrilled either to be going back to 2004 with my shell script to do the file transfer.

    A few of the Google hits mention futzing with udev. I don't know jack about udev, but sometimes I just can't ignore that devilish mischievousness that cackles at the thought of poking various internal bits of the system, gleefully ignoring the blaring red alarms and risking the health and safety of women and small furry animals. There's a directory of rules for how udev should create device nodes when the system encounters new hardware. A search through /etc/udev/rules.d/50-udev.rules shows the string "usb" in several places, such as this group of lines:

    # usb devices
    KERNEL=="usb/dabusb*", MODE="0660"
    KERNEL=="usb/mdc800*", MODE="0660"
    KERNEL=="usb/rio500", MODE="0660"

    However, changing these to mode 0666 does not work. Farther down the file, there is this line:

    SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", 
    NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

    This has a mode also, so I set it to 0666. Instead of exploding on me, the photo import now works. Yay! Now that I have new photos, you may berate me for not updating my photo blog.

    P.S. You might be wondering why mode should be "666". There's nothing satanic about it, it's just a throwback to the Unix-style file permissions (read/write/execute for owner,group, and others).