Jump to content

Digital camera removable storage


aRTee
 Share

Recommended Posts

Since a couple of weeks I have a digital cam, that has two usb connection modes, as removable storage (which needs no drivers installed in winXP and should work with usb-storage on linux), and a special mode for which it needs software installed on MSWin (so I don't care about this mode since I have no MSWin).

 

When I plug in the usb cable into the cam, I can tell from the /var/log/messages that it gets seen; it just doesn't get seen well enough.

 

Note: I have tried this on 4 different pc's with mandrake 10.0 OE, on my machine with kernels: 2.6.3-7mdk and 2.6.5phoenix, on my wifes machine and the one at work with 2.6.3-8mdk, and my brothers laptop with 2.6.3-7mdk.

 

[root@zurich roor]# tail -f /var/log/messages
Jul  3 18:02:38 zurich su(pam_unix)[10817]: session opened for user root by (uid=501)
Jul  3 18:03:13 zurich kernel: usb 1-1: new full speed USB device using address 2
Jul  3 18:03:14 zurich kernel: Initializing USB Mass Storage driver...
Jul  3 18:03:14 zurich kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jul  3 18:03:14 zurich kernel:   Vendor: MATSHITA  Model: DMC-FZ10          Rev: 0100
Jul  3 18:03:14 zurich kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jul  3 18:03:14 zurich kernel: SCSI device sda: 494081 512-byte hdwr sectors (253 MB)
Jul  3 18:03:14 zurich kernel: sda: assuming Write Enabled
Jul  3 18:03:14 zurich kernel: sda: assuming drive cache: write through
Jul  3 18:03:24 zurich scsi.agent[10908]: Attribute /sys/devices/pci0000:00/0000:00:09.0/usb1/1-1/1-1:1.0/host0/0:0:0:0/type does not exist (Timeout)

 

Now /dev shows only sda, no sda1, and sda is not mountable, nor should it be (SD ultra II 256MB card in the cam). /dev/sda is a link to /dev/scsi/host0/bus0/target0/lun0/disc

 

If I now start harddrake2 (as root: harddrake2, or as user: /usr/sbin/harddrake2 ) the dialog box "Please wait

Detection in progress"

really takes a long time -- which is a good sign - means it's doing something. (Alternatively I could have started mcc instead of harddrake2.) From time to time the display on my can shows 'ACCESS' for a couple of seconds.

Log output:

 

Jul  3 18:06:14 zurich kernel:  /dev/scsi/host0/bus0/target0/lun0:SCSI error : <0 0 0 0> return code = 0x6000000
Jul  3 18:06:14 zurich kernel: end_request: I/O error, dev sda, sector 494080
Jul  3 18:06:14 zurich kernel: Buffer I/O error on device sda, logical block 494080
Jul  3 18:06:28 zurich harddrake2[11112]: ### Program is starting ###

 

At some point, the following log entries show up and harddrake finally starts, please check the exact times:

Jul  3 18:09:15 zurich kernel: SCSI error : <0 0 0 0> return code = 0x6000000
Jul  3 18:09:15 zurich kernel: end_request: I/O error, dev sda, sector 494080
Jul  3 18:09:15 zurich kernel: Buffer I/O error on device sda, logical block 494080
Jul  3 18:09:15 zurich kernel:  p1
Jul  3 18:09:15 zurich kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Jul  3 18:09:15 zurich kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
Jul  3 18:09:15 zurich kernel: drivers/usb/core/usb.c: registered new driver usb-storage
Jul  3 18:09:15 zurich kernel: USB Mass Storage support registered.
Jul  3 18:09:16 zurich perl: drakupdate_fstab called with --auto --add /dev/scsi/host0/bus0/target0/lun0/part1

 

That last line shows what I was waiting for: the part1 (which /dev/sda1 that also just got created points to) now exists, meaning I can now mount my camera-sd-card as removable drive.

 

It really took me quite some time to figure out between (un)plugging usb cables and switching on and off the cam that I just had to start mcc or harddrake2. Linux sure can be nasty...

 

 

Why in the world does this take 6 minutes before I can get to my data? OK, 3 minutes if you count from the moment harddrake2 gets started...

 

What commands could I issue to get this working direclty?

Now it's fine at home, but on holiday on my brothers laptop with short battery life, this really matters...

 

 

BTW If I switch the cam off or disconnect, things work fine:

Jul  3 18:20:00 zurich kernel: usb 1-1: USB disconnect, address 2
Jul  3 18:20:01 zurich perl: drakupdate_fstab called with --auto --del /dev/scsi/host0/bus0/target0/lun0/part1

 

 

Note: yes I know cardreaders exist, and yes, I already have one, which works fine. I just want to get this working too. Besides, it works fine on MSWindows (so I hear), so it should work fine on linux too.

Note that if I plug in the cardreader things are fast:

Jul  3 18:27:43 zurich kernel: usb 5-1: new high speed USB device using address 2
Jul  3 18:27:43 zurich kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jul  3 18:27:44 zurich kernel:   Vendor: Generic   Model: STORAGE DEVICE    Rev: 9138
Jul  3 18:27:44 zurich kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jul  3 18:27:44 zurich kernel: SCSI device sda: 494080 512-byte hdwr sectors (253 MB)
Jul  3 18:27:44 zurich kernel: sda: assuming Write Enabled
Jul  3 18:27:44 zurich kernel: sda: assuming drive cache: write through
Jul  3 18:27:44 zurich kernel:  /dev/scsi/host1/bus0/target0/lun0: p1
Jul  3 18:27:44 zurich kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Jul  3 18:27:44 zurich kernel: Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0
Jul  3 18:27:44 zurich kernel:   Vendor: Generic   Model: STORAGE DEVICE    Rev: 9138
Jul  3 18:27:44 zurich kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jul  3 18:27:44 zurich kernel: Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 1
Jul  3 18:27:44 zurich kernel: Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 1,  type 0
Jul  3 18:27:44 zurich kernel:   Vendor: Generic   Model: STORAGE DEVICE    Rev: 9138
Jul  3 18:27:44 zurich kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jul  3 18:27:44 zurich kernel: SCSI device sdc: 494080 512-byte hdwr sectors (253 MB)
Jul  3 18:27:44 zurich kernel: sdc: assuming Write Enabled
Jul  3 18:27:44 zurich kernel: sdc: assuming drive cache: write through
Jul  3 18:27:44 zurich kernel:  /dev/scsi/host1/bus0/target0/lun2: p1
Jul  3 18:27:44 zurich kernel: Attached scsi removable disk sdc at scsi1, channel 0, id 0, lun 2
Jul  3 18:27:44 zurich kernel: Attached scsi generic sg2 at scsi1, channel 0, id 0, lun 2,  type 0
Jul  3 18:27:44 zurich kernel:   Vendor: Generic   Model: STORAGE DEVICE    Rev: 9138
Jul  3 18:27:44 zurich kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jul  3 18:27:44 zurich kernel: Attached scsi removable disk sdd at scsi1, channel 0, id 0, lun 3
Jul  3 18:27:44 zurich kernel: Attached scsi generic sg3 at scsi1, channel 0, id 0, lun 3,  type 0
Jul  3 18:27:44 zurich perl: drakupdate_fstab called with --auto --add /dev/scsi/host1/bus0/target0/lun0/part1
Jul  3 18:27:45 zurich scsi.agent[11973]: disk at /devices/pci0000:00/0000:00:09.2/usb5/5-1/5-1:1.0/host1/1:0:0:0
Jul  3 18:27:45 zurich scsi.agent[12002]: disk at /devices/pci0000:00/0000:00:09.2/usb5/5-1/5-1:1.0/host1/1:0:0:1
Jul  3 18:27:45 zurich scsi.agent[12026]: disk at /devices/pci0000:00/0000:00:09.2/usb5/5-1/5-1:1.0/host1/1:0:0:2
Jul  3 18:27:45 zurich scsi.agent[12054]: disk at /devices/pci0000:00/0000:00:09.2/usb5/5-1/5-1:1.0/host1/1:0:0:3
Jul  3 18:27:45 zurich perl: drakupdate_fstab called with --auto --add /dev/scsi/host1/bus0/target0/lun2/part1
Jul  3 18:27:45 zurich perl: suggest_mount_point: don't know what to with hd scsi/host1/bus0/target0/lun2/part1

 

Just 2 seconds, and I have

sd sda sda1 sdb sdc sdc1 sdd

so the card is ready for mounting (sdc1 is the card, reads four types, hence sda b c d, don't have a clue why it also shows sda1, nothing there, and can't mount that). (Don't worry about that last perl message, it's likely because I have that mount device mentioned in my fstab.)

Link to comment
Share on other sites

aRTee

what exactly is harddrake2 doing ...

 

probably rerunning hotplug ??

 

have you tried

hotplug usb

 

??

 

also have you tried disabling harddrake and adding a static mount point in fstab...

 

My camera access with supermount has always been weird, sometimes it creates a desktop item others not but doing it manually has worked...

 

(sd sda sda1 sdb sdc sdc1 sdd)

for the different scsi devices, is it acting like some multicard reader ?

(i.e usb mass storage vs other access)

 

I have always had unpredicatable behavior on USB-Mass storage under MDK when its left up to itself .. removeable1, removeable2 etc. it just seems to keep creating new devices... but once its hardcoded I just run hotplug and it creates the real device which I mount by hand

Link to comment
Share on other sites

I find that as of the recent 2.6 kernels, for me, only sda shows up as well, no sda1.

 

I run cfdisk /dev/sda, then quit it, no changes, and /dev/sda1 appears for me. Irritating, but I dont use it often enough to worry.

 

I have an external panasonic SD card reader that came with my Mp3 player.

Link to comment
Share on other sites

Thanks for the replies; will report back with my findings.

 

I did try

cfdisk /dev/sda

which also kept me waiting for a few minutes, and then gives me /dev/sda1; basically the same result as I already have with running mcc/harddrake2

 

Will try more tonight.

 

 

BTW: my intentions are to use a mount command, not supermount -- really, make sure that you don't use supermount since it wants to keep the media updated continuously to be unplugged. Basically this means that each section of block-reads is coupled with an a-time (access time) write, which slows down usb2 speed to around usb1 speed.

The issue is just that I don't get the device /dev/sda1 until after a few minutes, whereas with my cardreader and elsewhere it works within 2 seconds...

 

Oh and yes, I do have a mount point defined in /etc/fstab, both for /dev/sda1 (usb hd and/or camera) and /dev/sdc1 (cardreader with sdcard in proper slot).

 

 

Yves, your links don't include my case, unfortunately; the automounting I could use with my cardreader, but I'm fine mounting by hand.

 

Gowator, maybe hotplug usb will do something for me -- I sure hope so... stay tuned!

Edited by aRTee
Link to comment
Share on other sites

Hmmm, unfortunately not good:

[root@zurich root]# hotplug --help
Usage: /etc/hotplug.d/default/default.hotplug AgentName [AgentArguments]
AgentName values on this system:  dasd firmware ieee1394 input net pci scsi tape usb
[root@zurich root]# hotplug usb
Bad USB agent invocation, no action
[root@zurich root]#

 

Any other commands I could try?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...