LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Reading SD cards in Debian Lenny (https://www.linuxquestions.org/questions/debian-26/reading-sd-cards-in-debian-lenny-855063/)

felixk 01-08-2011 04:23 PM

Reading SD cards in Debian Lenny
 
I currently have the following entry in my "?etc/fstab":

/dev/sda1 /mnt/memstick auto rw,user,noauto 0 0

This configuration works perfectly whenever I plug a <memory stick|flash drive> into any of my USB ports.

However the plug-in USB-adapter, that is used in conjunction with SD-Cards is not recognized by my computer. The error message reads:

"Unknown file system".

Just in case it is relevant, most of the entries in my "/etc/fstab" have the format "/dev/hd??"; only my flash-drive port is identified as an *sda?* port.

All advice/guidance will be gratefully received.

felixk

frankbell 01-08-2011 06:56 PM

What is the file system on the SD card?

If it is NTFS, Lenny by default does not have NTFS drivers (I recently encountered that in setting up a USB hard drive).

felixk 01-09-2011 04:05 PM

Thank you. That might explain my problem.

Since the SD-Reader does not mount, I am unable to verify the file system that is used (I have no access to MS products).

The following entries (from dmesg) were generated in response to plugging the SD-Card reader into my computer:

> [ 620.572348] usb 3-5.1: new high speed USB device using ehci_hcd and
> address 5
> [ 620.998794] usb 3-5.1: configuration #1 chosen from 1 choice
> [ 620.999738] usb 3-5.1: New USB device found, idVendor=090c,
> idProduct=1000
> [ 620.999747] usb 3-5.1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 620.999750] usb 3-5.1: Product: USB DISK
> [ 620.999753] usb 3-5.1: Manufacturer: SMI Corporation
> [ 620.999755] usb 3-5.1: SerialNumber: AA04012700035643
> [ 621.137519] Initializing USB Mass Storage driver...
> [ 621.139678] scsi0 : SCSI emulation for USB Mass Storage devices
> [ 621.139892] usbcore: registered new interface driver usb-storage
> [ 621.139900] USB Mass Storage support registered.
> [ 621.139929] usb-storage: device found at 5
> [ 621.139932] usb-storage: waiting for device to settle before scanning
> [ 626.136261] usb-storage: device scan complete
> [ 626.137352] scsi 0:0:0:0: Direct-Access SMI USB DISK
> 1100 PQ: 0 ANSI: 0 CCS
> [ 626.205356] **Driver 'sd' needs updating - please use bus_type
> methods**
> [ 626.208870] sd 0:0:0:0: [sda] 1957888 512-byte hardware sectors (1002
> MB)
> [ 626.209731] sd 0:0:0:0: [sda] Write Protect is off
> [ 626.209739] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
> [ 626.209742] sd 0:0:0:0: [sda] Assuming drive cache: write through
> [ 626.212864] sd 0:0:0:0: [sda] 1957888 512-byte hardware sectors (1002
> MB)
> [ 626.213708] sd 0:0:0:0: [sda] Write Protect is off
> [ 626.213716] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
> [ 626.213719] sd 0:0:0:0: [sda] Assuming drive cache: write through
> [ 626.213728] sda: sda1
> [ 626.214893] sd 0:0:0:0: [sda] Attached SCSI removable disk

Regrettably, interpreting this information is well beyond my technical capabilities.

I have posted the above in the hope that the messages will make sense to more knowledgeable readers of this posting.

Again, many thanks for taking an interest in my problem.

felixk

michaelk 01-09-2011 04:45 PM

Device IDs for IDE devices are /dev/hdx
Device IDs for any other devices i.e USB, Firewire, SCSI are /dev/sdx

SD cards used in cameras etc are all pretty much formatted with a FAT filesystem. Some more information is required. I assume the output is when a memory card was plugged into the USB adapter. If so at first glance I do not see a real problem. Does this happen with any card plugged into the adapter?

Larry Webb 01-09-2011 04:59 PM

try ls /media

felixk 01-10-2011 03:37 AM

Quote:

michaelk;4218686]Device IDs for IDE devices are /dev/hdx
Device IDs for any other devices i.e USB, Firewire, SCSI are /dev/sdx
I suspect that the above (no longer fully valid) information points to the problem - even if I currently have no idea what needs changing.

Debian has notified that, in future versions of the kernel, HD partitions will be identified as /dev/sdx (and not - as in the past - as /dev/hdx). In accordance with the Debian upgrade advice, I identified the "to-be-upgraded partitions" with unique LABELS (rather than continue to use the /dev/hdx notation).

After successfully completing the dist-upgrade to Lenny, it turned out that the foreshadowed change from "dev/hdx" to /dev/sdx" had not been implemented in the supplied Lenny kernel (2.6.26-x).

I have no idea what the current state-of-play is and hope to be told how to cope with the foreshadowed switch to "/dev/sdx" when the next stable version of Debian is released.

Meanwhile I am sitting on my hands (because I am too scared to tamper with the kernel).

Quote:

SD cards used in cameras etc are all pretty much formatted with a FAT filesystem
.

This answers a previous suggestion.

I have tried use my computer to read the SD-Card of a digital camera and the digital card of an Android tablet. Both attempts failed and gave the same error message.

I believe that the problem is in my <computer|kernel>. My daughter's Mac had no problems in reading the content of the above-mentioned SD-Cards.

felixk

michaelk 01-10-2011 05:42 AM

Yes, if the kernel is using libata then all devices including IDE will have a device ID of /dev/sdx. However, whether the kernel uses libata or not the USB adapter / memory card should work the same as a regular flash drive.

Try manually mounting the memory card (as root):
mount -t vfat /dev/sda1 /mnt/memstick

Larry Webb 01-11-2011 06:33 AM

Try looking in /proc/partitions without the usb plugged then plug it in and look again and see if there are any changes. The reason I am questioning the dev being sda1.

felixk 01-11-2011 06:23 PM

Quote:

Originally Posted by michaelk (Post 4219170)
Try manually mounting the memory card (as root):

Made no difference.

[root@carrot ~]# mount /mnt/memstick
mount: you must specify the filesystem type
-----
[root@carrot ~]# mount -t vfat /dev/sda1 /mnt/memstick
mount: special device /dev/sda1 does not exist
-----
[root@carrot felixk]# cat /etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>

SNIPPED

/dev/sda1 /mnt/memstick auto rw,user,noauto 0 0

------------

Thank you for the suggestion and interest.

felixk

michaelk 01-11-2011 06:36 PM

Do you have a memory card plugged into the adapter?
Post the output of the command
fdisk -l (you must be root and -l is a small L)

felixk 01-11-2011 06:43 PM

Quote:

Originally Posted by Larry Webb (Post 4220404)
Try looking in /proc/partitions without the usb plugged then plug it in and look again and see if there are any changes. The reason I am questioning the dev being sda1.

If run the mount command (mount /dev/sda1) when a flash drive into any of my usb ports, the entries in "/proc/partitions" include:

major minor #blocks name

8 0 253224 sda
8 1 253208 sda1

These entries are absent, if I repeat the mount command with an SD-Card reader plugged into a usb-port. They are also absent when nothing is plugged into any usb-port.

felixk

Larry Webb 01-11-2011 08:57 PM

Just making sure to cover all the bases, you did make a directory

mkdir /mnt/memstick

before trying to mount /dev/sda1

michaelk 01-11-2011 09:05 PM

I will also ask again if a SD card is plugged into the adpater.

Larry Webb 01-11-2011 09:15 PM

Do this also as it will tell us the file type also


Quote:

Originally Posted by michaelk (Post 4221119)
Do you have a memory card plugged into the adapter?
Post the output of the command
fdisk -l (you must be root and -l is a small L)


felixk 01-12-2011 12:06 AM

Quote:

Originally Posted by michaelk (Post 4221119)
Do you have a memory card plugged into the adapter?
Post the output of the command
fdisk -l (you must be root and -l is a small L)

I believe it is worth repeating some of my previously-posted observations. Specifically:

1. On my computer (OS Debian Lenny) the "mount" command - either "mount /dev/sda1" or "mount /mem/memstick" - works perfectly when a flash-drive is plugged into any of my vacant usb ports.

2. Both "mount" commands fail on my computer when the flash-drive is replaced by an SD-Card Reader.

3. My daughter's Mac has no problems in mounting (and reading the content of) my SD-Card reader.

None of the hitherto suggested strategies for identifying the file-type of the contents of the SD-Card work on my computer. Below is the output of "fdisk -l" when a flash-drive is mounted:

Disk /dev/sda: 1002 MB, 1002438656 bytes
65 heads, 32 sectors/track, 941 cylinders
Units = cylinders of 2080 * 512 = 1064960 bytes
Disk identifier: 0xdd206466

Device Boot Start End Blocks Id System
/dev/sda1 * 1 942 978928 6 FAT16
Partition 1 has different physical/logical endings:
phys=(956, 64, 32) logical=(941, 18, 32)

This output is absent after the (failed) mount of the SD-Reader.


For good measure, I attach herewith some of the latest output recorded in "/var/log/kern.log:

Jan 12 11:27:26 carrot kernel: [1140000.265379] sd 2:0:0:0: [sda] Attached SCSI removable disk
Jan 12 16:20:26 carrot kernel: [1157580.500292] sd 3:0:0:0: [sda] 1957888 512-byte hardware sectors (1002 MB)
Jan 12 16:20:26 carrot kernel: [1157580.501164] sd 3:0:0:0: [sda] Write Protect is off
Jan 12 16:20:26 carrot kernel: [1157580.501170] sd 3:0:0:0: [sda] Mode Sense: 43 00 00 00
Jan 12 16:20:26 carrot kernel: [1157580.501174] sd 3:0:0:0: [sda] Assuming drive cache: write through
Jan 12 16:20:26 carrot kernel: [1157580.504663] sd 3:0:0:0: [sda] 1957888 512-byte hardware sectors (1002 MB)
Jan 12 16:20:26 carrot kernel: [1157580.505529] sd 3:0:0:0: [sda] Write Protect is off
Jan 12 16:20:26 carrot kernel: [1157580.505536] sd 3:0:0:0: [sda] Mode Sense: 43 00 00 00
Jan 12 16:20:26 carrot kernel: [1157580.505539] sd 3:0:0:0: [sda] Assuming drive cache: write through
Jan 12 16:20:26 carrot kernel: [1157580.505548] sda: sda1
Jan 12 16:20:26 carrot kernel: [1157580.506716] sd 3:0:0:0: [sda] Attached SCSI removable disk


Needles to say - I do not understand any of the above output.

I believe that my problem should be put into the "too-hard" basket and hope that it will resolve itself when the next stable release of Debian arrives.

Meanwhile, my sincere thanks for all who took an interest in my problem.



felixk


All times are GMT -5. The time now is 08:30 AM.