# Partitions on SD/MM Cards aren't recognized (somehow solved)

## Corax

I purchased a Hama CardReader recently and wanted to put some files onto the SD-Card. Unfortunately, there aren't any partitions recognized on the card, though they exist (I formatted this card using Windows). Fdisk can't open the device /dev/sda, neither can parted nor cfdisk. 

This is the the appropriate snippet from the kernel log:

```

Jul  6 23:56:39 albatros usb 1-3: new high speed USB device using ehci_hcd and address 4

Jul  6 23:56:39 albatros usb 1-3: configuration #1 chosen from 1 choice

Jul  6 23:56:39 albatros scsi0 : SCSI emulation for USB Mass Storage devices

Jul  6 23:56:39 albatros usb-storage: device found at 4

Jul  6 23:56:39 albatros usb-storage: waiting for device to settle before scanning

Jul  6 23:56:44 albatros Vendor: Hama      Model: Card Reader   CF  Rev: 1.9C

Jul  6 23:56:44 albatros Type:   Direct-Access                      ANSI SCSI revision: 00

Jul  6 23:56:45 albatros sd 0:0:0:0: Attached scsi removable disk sda

Jul  6 23:56:45 albatros usb-storage: device scan complete

```

As you can see, the device itself is recognized correctly. Obviously it is not able to detect the cards that I plug in: I can't find or open a device like /dev/sda1. I tried this with with udev-079-r2, 087-r1 and 089-r2, which made no difference. 

As I read some posts about similar issues, of course I tried the kernel configuration option "Probe all LUNs on SCSI devices", but this wasn't a solution as well, the only difference was that udev assigned /dev/sdc and reported about a "Rejecting I/O to dead device".

I summarize: I have compiled all appropriate kernel switches like usb_storage, scsi-emulation for usb devices, vfat etc. I didn't install them as modules, but compiled them into a monolithic kernel. Inspite of all measures undertaken that I know of, I simply can't access the cards in the card reader. That's frustrating. Can someone shed some light on this? Any help is appreciated.

----------

## Corax

I tried sfdisk, which complains that it couldn't open the device /dev/sda for reading. This follows fdisk, as both do not find a medium. Is the card defunct? It is new and worked fine in Windows.

----------

## fangorn

Some cards and usb sticks come with defective partition tables (which work in windows but not in linux) till now I never had a case where linux fdisk could not at least delete the partition table, but hey, you never know.

If there are no necessary data on the stick try deleting the partitions on it (under windows if fdisk does not recognize it) and try with a clean stick to put new partition on it (in linux). If that fails do (very carefully watching for typing errors)

```

dd if=/dev/null of=/dev/sda bs=512 count=20

```

This will overwrite the mastar boot record, the partition table and the initialization section of the first partition. 

This will also overwrite the partitioning of any other harddisk /usb stick available if you select the wrong device for of=, so check at least twice for correctnes.

----------

## Corax

Thanks for pointing to that - ultimate - solution. However, even dd gives me:

```
dd if=/dev/null of=/dev/sda bs=512 count=20

dd: öffne /dev/sda: Kein Medium gefunden
```

That's translated like: dd: open "/dev/sda": No medium found.

What do we do now?

----------

## Corax

I finally got another card reader - my mp3 player with a card slot. After switching on again the kernel option "Probe all LUNs on each SCSI device" I now can access the internal flash memory as well as the SD/MM Card on devices /dev/sda1 and /dev/sdb1. Works for me, so I will bring back the originial Hama CardReader.

Thanks a lot for your idea.

----------

## paz120

I confirm the above helped me with my little camera..

I got a Mustek dv8200 which has internal memory and an SD slot. On me gentoo it would only pick up the internal memory. I knew it would work as it worked fine on a live version of PCLOS and also worked in XP..

Took me a good few hours before stumbling over this post and seen the answer, the kernel option (after installing pmount and dbus etc to no avail)

"Probe all LUNs on each SCSI device"

it was turned off, so a re-compile later and a reboot, all good..detected both on /dev/sda1 and /dev/sdb1

ps: if ya re-compile, dont forget to run lilo like i did, duh...

cheers

----------

