# lexar flashcard reader

## st. anger

i just bought a flashcard reader, its a lexar. ive compiled all the necessary modules and

 cat /proc/scsi/usb-storage-0/1 shows:

```

 # cat /proc/scsi/usb-storage-0/1 

   Host scsi1: usb-storage

       Vendor: USB

      Product: Mass Storage

Serial Number: None

     Protocol: Transparent SCSI

    Transport: Bulk

         GUID: 05dcb0020000000000000000

     Attached: Yes

```

so, my question is: how do i access the data? how do i mount it? there is no /dev entry for it.

Ive tried rebooting with the card inserted, still nothing

any help appreciated.

----------

## erebus

O.k. all you should need to do is mount the drive like you would any drive.. if you check you kernel logs you see the card reader mention along with the name of the drive it was assigned, which should be a scsi drive, so it should be named something like sd0, sr0 or something similar, also check under /dev.

Then simply mount it like this (assuming it has a fat filesystem on it.)

mount -f vfat /dev/sd0 /mnt/flashdrive

Of course changing /dev/sd0 and /mnt/flashdrive to where the device is and where you want it mounted.

Good luck.

----------

## st. anger

i cant mount it, there is no /dev entry for it.

shouldnt devfs make the entry?

if i have to edit the conf file, how would i go about doing that

----------

## oniq

Anything in dmesg or /var/log/messages that relates to the device?

----------

## st. anger

here s a chunk of dmesg

```
sda : READ CAPACITY failed.

sda : status = 0, message = 00, host = 0, driver = 28 

Current sd00:00: sense key Not Ready

Additional sense indicates Medium not present

sda : block size assumed to be 512 bytes, disk size 1GB.  

 /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0

 I/O error: dev 08:00, sector 0

Device not ready.  Make sure there is a disc in the drive.

VFS: Disk change detected on device 08:00

sda : READ CAPACITY failed.

sda : status = 0, message = 00, host = 0, driver = 28 

Current sd00:00: sense key Not Ready

Additional sense indicates Medium not present

sda : block size assumed to be 512 bytes, disk size 1GB.  

 /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0

 I/O error: dev 08:00, sector 0

nvidia: loading NVIDIA Linux x86 NVdriver Kernel Module  1.0-3123  Tue Aug 27 15:56:48 PDT 2002

NVRM: AGPGART: VIA Apollo KT133 chipset

NVRM: AGPGART: aperture: 64M @ 0xe0000000

NVRM: AGPGART: aperture mapped from 0xe0000000 to 0xd9be6000

NVRM: AGPGART: mode 4x

NVRM: AGPGART: allocated 16 pages

Device not ready.  Make sure there is a disc in the drive.

sda : READ CAPACITY failed.

sda : status = 0, message = 00, host = 0, driver = 28 

Current sd00:00: sense key Not Ready

Additional sense indicates Medium not present

sda : block size assumed to be 512 bytes, disk size 1GB.  

 /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0

 I/O error: dev 08:00, sector 0

 unable to read partition table

usb.c: USB disconnect on device 2

hub.c: USB new device connect on bus1/2, assigned device number 3

WARNING: USB Mass Storage data integrity not assured

USB Mass Storage device found at 3

Device not ready.  Make sure there is a disc in the drive.

sda : READ CAPACITY failed.

sda : status = 0, message = 00, host = 0, driver = 28 

Current sd00:00: sense key Not Ready

Additional sense indicates Medium not present

sda : block size assumed to be 512 bytes, disk size 1GB.  

 /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0

 I/O error: dev 08:00, sector 0

 unable to read partition table

Device not ready.  Make sure there is a disc in the drive.

sda : READ CAPACITY failed.

sda : status = 0, message = 00, host = 0, driver = 28 

Current sd00:00: sense key Not Ready

Additional sense indicates Medium not present

sda : block size assumed to be 512 bytes, disk size 1GB.  

 /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0

 I/O error: dev 08:00, sector 0

 unable to read partition table
```

i dont have /var/log/messages

----------

## Carlos

The device entries should show up as /dev/sdax, where x is an integer.  If the LexMark has more than one drive in it (e.g. CF, SM), you'll have to have enabled multiple LUNs under SCSI support, and you'll have /dev/sdbx, and maybe others as well.

If those don't show up, then you have to get into the wonderful world of devsd configuration, about which I know next to nothing.  this message has a good example, though.  Maybe try 

```
ls -r /dev/scsi
```

to see where your device node is being made.

----------

## st. anger

i guess my reader isnt supported. i found a patch for it here: http://lwn.net/Articles/8413/

but i think ill wait until its official and i guess i can always just use the reader on my windows box.  oh well

edit:  the patch is for a SmartMedia reader, is that the same as the CompactFlash reader?

----------

## jbuberel

I'm going to assume that you have already formatted your Compact Flash card using the camera, and have managed to store some images on it.

The key here is to understand that your Lexar JumpShot Compact Flash reader just makes the CF card look like a SCSI hard disk to linux. So to pull this off, will need the following modules built into your kernel (no sense in building these into the kernel statically):

usbcore ( USB Support -> Support for USB)

uhci (USB Support -> UHCI or EHCI or OHCI)

usb-storage (USB Support -> USB Mass Storage Suppport)

fat (File Systems -> DOS FAT fs support)

vfat (File Systems -> VFAT (Windows-95) fs support)

scsi_mod (SCSI Support -> SCSI generic support)

sd_mod (SCSI Support -> SCSI disk support)

Once you've used 'make menuconfig' to configure your kernel, do:

```
make dep && make modules modules_install
```

This will install all the correct modules into /lib/modules/. No need to restart. You just need to load the modules into memory (as root).

```
modprobe usbcore uhci usb-storage
```

Which usb-chipset driver you need to load depends on your motherboard. You can use the KDE Info Center application to check which one your machine uses. 

Then load the SCSI drivers:

```
modprobe scsi_mod vfat sd_mod
```

Next, make a mount point for your card reader:

```
mkdir /mnt/jumpshot
```

Now, insert your compact flash card into the reader. The next thing to do is figure out which scsi device your card reader was assigned by the devfs daemon. Again, the KDE Info Center application (K -> System -> Info Center) is very useful here. Launch that, and click on the SCSI tab. 

You should see something like this:

```
Host: scsi0 Channel: 00 Id: 00 Lun: 00

  Vendor: Lexar  Model: Jumpshot USB CF Rev: 0001

  Type: Direct-Access            ANSI SCSI revision 02
```

That crap translates into:

```
/dev/scsi/host0/bus0/target0/lun0/
```

Now, you just need to mount the device file in that directory (should be named 'part1') to your /mnt/jumpshot mountpoint:

```
mount -t vfat /dev/scsi/host0/bus0/target0/lun0/part /mnt/jumpshot
```

Now you should be able to 'cd' into that directory, and see files. If you use this often enough, you can put all of those module names into /etc/modules.autoload. You can also create an entry for that device in /etc/fstab so that the next time you want to use it, you just insert the compact flash card, and type 'mount /mnt/jumpshot'.

Works like a charm. Let me know if this helps.

----------

## st. anger

i finally got it working. 

jbuberel: i already had all those modules compiled but it still wasnt workng.

I decided to start my kernel from scratch. i was using gentoo-sources 2.4.19-r9. i upgraded to gentoo sources-2.4.20-r1 and as i was in make menuconfig i noticed the option Memory Technology Devces (MTD) which i didnt have confgured in my previous kernel.

heres the help on MTD from makemenuconfg:

Memory Technology Devices are flash, RAM and similar chips, often       x   

  x used for solid state file systems on embedded devices. This option      x   

  x will provide the generic support for MTD drivers to register            x   

  x themselves with the kernel and for potential users of MTD devices       x   

  x to enumerate the devices which are present and obtain a handle on       x   

  x them. It will also allow you to select individual drivers for           x   

  x particular hardware and users of MTD devices. If unsure, say N. 

whether or not ths made the dfference or maybe the upgrade n kernels made the diff., im happy i got my reader working.

thanks for all your help.

----------

