In order to access USB pendrives and digital cameras as USB mass storage dievices what modules need to be loaded and how does one go about mounting these devices. I was a little spoiled in the past with Supermount in other distros, so this is a little new to me.
Please take a look at the Arch Linux WiKi page:
This answers most questions about USB sticks (and most cameras as well, since the only principled difference between the two is the inherent file structure that cameras maintain for photographs and other data management purposes).
I have not set up my camera on Arch yet but this is how I have set mine manually in the past.
It may be diffrent with the 2.6 kernel, devfs and may depend on your camera.
It should go something like this (which is what the wiki page is saying)
As root do the following:
1) Make sure that usb is up and running (if you use a usb mouse or keyboard, etc you can skip
this step as you know this is working)
type " ps x | grep usb "
2) connect the camera to a usb port and start the usb-mass storage module
type " modprobe usb-storage"
3) check /proc to see if the device is loaded properly
type " less /proc/bus/usb/devices "
type " less/proc/modules"
The usb storage module will map the camera as a scsi device and have a name like sda or sdb etc.
If you have problems you may need to load the scsi module:
type " modprobe sd-mod"
4) create a mount point
type " mkdir /mnt/camera"
5) try to mount the camera manually
type " mount -t vfat /dev/sda1 /mnt/camera " (/dev/sda1 being specific to your camera)
you should then be able to cd /mnt/camera or ls /mnt/camera just like any other drive.
6) Open your favorite editor and add to your /etc/fstab a line like
"/dev/sda1/ /mnt/camera vfat defaults 0 0"
I hope this helps more then hurts.
There is a nice gnome app. If you run gnome, you may be interested. You can tweak it's settings with little afford so the app pops up when a camera is connected!
Frumpus ♥ addict
I was having no end of trouble with flacky USB Storage Device recognition under Linux and it was by reading your posts that I found I needed sd-mod loaded. Can't thankyou all enough. Now for that USB2 Hard Drive. If only I wasn't sponsoring my Girlfriend part payment in a motorcycle, I'd have it tomorrow )-:
Still important to have her mobile and at least I can now easily use my USB storage stick.
Leave ones footprint not in the physical world but the in the world of the mind.
You don't have to set up complete usb storage with mounting dirs etc. Yesterday I sucessfully set up my cannon ixus v3 with ghpoto2 and digicam. Follow the second link provided by PinkChick and you will find that you need 3 simple steps in archlinux to do this (basically: generating usbcam list, copying the usbcam scirpt to /etc/... - in archlinux it's somewhere in /usr/share/libgphoto..., changing the name of usergroup - that depend's on the method you want to provide usbcam for users - I just changed the group name to users). Now my ixus works very well. BTW: Digikam from staging is much more powerfull than gtkam but I can't find the plugins described on it's homepage - someone tried this (I suppose I shoud recompile it myself...) ?
Afaik, Digikam is a KDE app, while gtkam is a gnome one. gtkam is a bit buggy, yet. I haven't noticed much progress in gtkam, lately and had a nice time using digikam on ... shame ... lindows ... :oops:
Frumpus ♥ addict
Yes, gtkam is very simple while digikam is a full featured program for managing photos (I really like it's speed when browsing lots of thumbnails). There are lots of plugins for digikam http://digikam.sourceforge.net/plugins.html but I could not find them in the version from staging.
Arghhh. Of course. There is a new version 0.6.1 with a separate plugin package! And both packages are already in incoming http://bbs.archlinux.org/viewtopic.php? … ht=digikam. :-) I'll try them soon...
I'm trying to download some pictures from my Cannon PowerShot A60, but I don't seem to be able to detect it.
I try doing an "ls /dev/s*" at several times, hoping for the "/dev/sda1" to show up, but so far it hasn't. I have it connected to a USB port that worked under Windows, so I think it should work.
I have a 2.6 IDE kernel, so I was trying this:
And I get nothing.
I see where some USB stuff is being loaded:
[b@ant23 b]$ dmesg | grep usb
drivers/usb/core/usb.c: registered new driver usbfs
drivers/usb/core/usb.c: registered new driver hub
drivers/usb/core/usb.c: registered new driver hiddev
drivers/usb/core/usb.c: registered new driver hid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
usb 3-1: new full speed USB device using address 2
drivers/usb/core/usb.c: registered new driver usb-storage
usb 3-1: USB disconnect, address 2
I bet "usb3-1" is my camera!
I've never used USB under Linux before, but I have several other devices I'm going to try and connect after I get the A60 working.
I found out that the A60 using a non-standard USB protocol, but that gphoto2 can still talk to it. I was able to successfully do the following command as root:
Now I know I need to make a "usb group" and give that group access to the USB port, as described here:
...but I'm not sure I understand it quite yet.
I want to make a "usb" group and give user "b" access to it. Is that hard?
Will this line work on Arch (from the above link):
none /proc/bus/usb usbdevfs devuid=0,devgid=1002,devmode=0660 0 0
My /etc/fstab file already has this line it:
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
do let users use my USB digital camera, do I need to add something like:
usbdevfs /proc/bus/usb usbdevfs defaults,devmode=0600 0 0
I saw this line during my search, which gave me the idea:
none /proc/bus/usb usbfs defaults,devmode=0666 0 0
I tired the above 0600 entry, and it still doesnt work, here is my output:
[b@ant23 b]$ cd a60/
[b@ant23 a60]$ gphoto2 --get-all-files
*** 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 (e.g. dc2xx or stv680) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***
For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <email@example.com>, please run
gphoto2 as follows:
env LANG=C gphoto2 --debug --get-all-files
Please make sure there is sufficient quoting around the arguments.
[In case you haven't read this, take a look at the Arch Wiki of USB Sticks: http://wiki.archlinux.org/index.php/USB Sticks. This is good advice for USB cameras as well -- with the exception of formatting the camera memory, of course.]
What I've done for a large range of USB devices for the 2.6 kernel series is this:
1. Add 'usb-storage' to the MODULES list in /etc/rc.conf. The 'sd_mod' module is already built into the 2.6 kernel, so it's not necessary to add it to the MODULES list (or use 'modprobe sd_mod') to get its functionality.
2. In /etc/fstab add the following lines:
none /proc/bus/usb usbfs defaults,devmode=0666 0 0
/dev/sda1 /mnt/usb vfat user,noauto,defaults 0 0
When the USB device is inserted, the /dev/sd* devices automagically appear.
3. You can then do, as any user, mount and unmount the USB device or camera:
and read from (and write to, if that's appropriate) the device as a normal user. The nice thing about this arrangement is that the files on the USB device or camera appear with the permissions of the user who's mounted the USB device or camera.
You can also set up desktop icons to mount and unmount these devices; and navigate them as you would a hard drive, floppy, or CD-ROM (I do this with the KDE desktop, for example).
Well I can see my camera now, when its turned on, but I still can't access it with a non-root account.
[root@ant23 b]# ls /proc/bus/usb/003
The A60 digital camera is 005. That number goes up each time I turn the camera off and then back on.
So all I have to do is give my "b" account full access to /proc/bus/usb - right?
Not sure exactly how to do that yet.
The A60 does not show up as a regular USB device, they use some weird protocol. gphoto2 speaks that protocol (something like 'ptpn').
I can log in as root pull the pictures off the camera without loading any extra modules, just doing this:
[root@ant23 a60]# gphoto2 --get-all-files
Detected a 'Canon:PowerShot A60'.
Downloading 'IMG_0012.JPG' from folder '/DCIM/100CANON'...
Saving file as IMG_0012.JPG
This command does not show any storage device:
[root@ant23 a60]# ls /dev/s*
/dev/stderr /dev/stdin /dev/stdout
controlC0 midiC0D0 pcmC0D0c pcmC0D0p pcmC0D1p timer
adsp audio dmmidi
I think my only problem is giving access to /proc/bus/usb to my non-root account. Apparently the A60 doesn't even use the USB stuff.
I solved the problem using Sarah's instructions at:
chown -R sarah.users /proc/bus/usb/001/*
tehdely helped me a bunch in IRC, but it eventually became apparent that the devmode entry for the usbdevfs in /etc/fstab was simply not going to work. A bug perhaps?
Now I can take pictures and import them to linux!
I use hotplug to handle my permissions for my camera. I don't know how well it works with 2.6.4 or 2.6.5 because of the hotplug issues (though, I'm not getting those messages like I was with 2.6.4... weird...), I haven't downloaded any pictures since then.
I followed these instructions. I also included all the scripts they mention in one of the gphoto packages...
I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal
I can only confirm what Xentac says - at least in arch linux this way is probably the easiest and you don't have to use any addtional modules. Just follow the instructions from the link - personally I use usbcam script for group of users (I changed the original group name to "users" group - this way hotplug will allow any users of my desktop computer use the usb device). It takes 5 min or so to setup it this way :-)
If you are using digikam (or gtkam) you have to first detect the device and protocol - there is a button for autodetection in digikamclient which should work for your cam too. Digikam has some very cool features (try the version from incoming not staging repo. There is also a separate package for plugins).
BTW Xentac thanks for including the scripts. It was very easy to use my ixus with archlinux this way (after reading a lot of web pages full of some strange device names, different advises etc :-) for several hours I just discovered that in Arch it takes just a few minutes to set everthing up :-))