# SD-card and card-ready

## DMoL

When I insert a SD-card used by my Palm device, it says some error, whilst my gentoo box mounts other sd-cards transparently. 

The kernel says the following:

```
Sep  8 20:05:17 localhost kernel: usb 1-5: new high speed USB device using ehci_hcd and address 2

Sep  8 20:05:17 localhost kernel: scsi5 : usb-storage 1-5:1.0

Sep  8 20:05:18 localhost kernel: scsi 5:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0

Sep  8 20:05:18 localhost kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] 1999872 512-byte logical blocks: (1.02 GB/976 MiB)

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Write Protect is off

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Assuming drive cache: write through

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Assuming drive cache: write through

Sep  8 20:05:19 localhost kernel: sdb:

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Device not ready

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Result: hostbyte=0x00 driverbyte=0x08

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Sense Key : 0x2 [current] 

Sep  8 20:05:19 localhost kernel: Info fld=0x0

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 08 00

Sep  8 20:05:19 localhost kernel: end_request: I/O error, dev sdb, sector 0

Sep  8 20:05:19 localhost kernel: Buffer I/O error on device sdb, logical block 0

Sep  8 20:05:19 localhost kernel: unable to read partition table

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Assuming drive cache: write through

Sep  8 20:05:19 localhost kernel: sd 5:0:0:0: [sdb] Attached SCSI removable disk

```

Under SystemRescueCD it says:

```
Sep  8 19:53:58 sysresccd kernel: [  139.700805] usb-storage: device found at 2

Sep  8 19:53:58 sysresccd kernel: [  139.700808] usb-storage: waiting for device to settle before scanning

Sep  8 19:54:03 sysresccd kernel: [  144.700257] usb-storage: device scan complete

Sep  8 19:54:03 sysresccd kernel: [  144.828726] scsi 5:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0

Sep  8 19:54:03 sysresccd kernel: [  144.829078] sd 5:0:0:0: Attached scsi generic sg3 type 0

Sep  8 19:54:04 sysresccd kernel: [  145.416975] sd 5:0:0:0: [sdc] 1999872 512-byte logical blocks: (1.02 GB/976 MiB)

Sep  8 19:54:04 sysresccd kernel: [  145.417721] sd 5:0:0:0: [sdc] Write Protect is off

Sep  8 19:54:04 sysresccd kernel: [  145.417725] sd 5:0:0:0: [sdc] Mode Sense: 03 00 00 00

Sep  8 19:54:04 sysresccd kernel: [  145.417728] sd 5:0:0:0: [sdc] Assuming drive cache: write through

Sep  8 19:54:04 sysresccd kernel: [  145.421471] sd 5:0:0:0: [sdc] Assuming drive cache: write through

Sep  8 19:54:04 sysresccd kernel: [  145.421476]  sdc:

Sep  8 19:54:04 sysresccd kernel: [  145.423085] sd 5:0:0:0: [sdc] Device not ready

Sep  8 19:54:04 sysresccd kernel: [  145.423088] sd 5:0:0:0: [sdc] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

Sep  8 19:54:04 sysresccd kernel: [  145.423091] sd 5:0:0:0: [sdc] Sense Key : Not Ready [current] 

Sep  8 19:54:04 sysresccd kernel: [  145.423094] Info fld=0x0

Sep  8 19:54:04 sysresccd kernel: [  145.423096] sd 5:0:0:0: [sdc] <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff

Sep  8 19:54:04 sysresccd kernel: [  145.423102] sd 5:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00

Sep  8 19:54:04 sysresccd kernel: [  145.423108] end_request: I/O error, dev sdc, sector 0

Sep  8 19:54:04 sysresccd kernel: [  145.423111] Buffer I/O error on device sdc, logical block 0

Sep  8 19:54:04 sysresccd kernel: [  145.424445] ldm_validate_partition_table(): Disk read failed.

Sep  8 19:54:04 sysresccd kernel: [  145.424450] Dev sdc: unable to read RDB block 0

Sep  8 19:54:04 sysresccd kernel: [  145.426222]  unable to read partition table

Sep  8 19:54:04 sysresccd kernel: [  145.428944] sd 5:0:0:0: [sdc] Assuming drive cache: write through

Sep  8 19:54:04 sysresccd kernel: [  145.428949] sd 5:0:0:0: [sdc] Attached SCSI removable disk

```

I tried to "create partition table" via gparted, but I had the same problem. Could anybody help me? Thanks for any advices!

----------

## NeddySeagoon

DMoL,

Maybe it really doesn't have a partition table, which would make it like a big floppy disk.

Linux doesn't mind if you partition block devices or not, you just need to keep that in mind.

As root, attempt to mount the whole device.  

```
mount /dev/sdb /some/mount/point
```

If that works, thats the issue. Partitioning the SD card is not the fix. Your Palm would not be able to read it then.

----------

## gerard27

Just a shot in the dark:

Remove the card,

Issue modprobe -r ehci_hcd,

Reinsert the card and try again.

This is on the assumption that your kernel has modular USB.

This way you'll force the card to be connected to ohci/uhci.

If this doesn't work I wouldn't know what else to try.

Gerard.

----------

## DMoL

Thanks for replies.

I don't think, that the problem is in filesystem. I think the problem relates to hardware or kernel bug.

I've done the following

```
# dd if=/dev/zero of=/dev/sdb

dd: writing to `/dev/sdb': No space left on device

1999873+0 records in

1999872+0 records out

1023934464 bytes (1.0 GB) copied, 348.786 s, 2.9 MB/s

# install-mbr --force  /dev/sdb

# parted /dev/sdb 

GNU Parted 2.3

Using /dev/sdb

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mkpartfs primary fat16 0 100%                                    

WARNING: you are attempting to use parted to operate on (mkpartfs) a file system.

parted's file system manipulation code is not as robust as what you'll find in

dedicated, file-system-specific packages like e2fsprogs.  We recommend

you use parted only to manipulate partition tables, whenever possible.

Support for performing most operations on most types of file systems

will be removed in an upcoming release.

Warning: The resulting partition is not properly aligned for best performance.

Ignore/Cancel? I                                                          

(parted) print                                                            

Model: Multiple Card Reader (scsi)

Disk /dev/sdb: 1024MB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number  Start  End     Size    Type     File system  Flags

 1      512B   1024MB  1024MB  primary  fat16        lba

(parted) quit                                                             

Information: You may need to update /etc/fstab.                           

```

After creating the partition in parted I've noted, that /dev/sdb1 file created. But after removing-inserting the SD-card, there is only /dev/sdb and the previous errors.

gerard82,  I have CONFIG_USB_EHCI_HCD=y in my kernel config, so I think your solution willn't work.

----------

