LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 01-15-2009, 01:06 PM   #1
tiger762
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Rep: Reputation: 0
Unable to mount SD memory card by USB reader


OK, I have some SD cards (256MB, 1GB, 2GB) that I am trying to mount with a USB card reader. This used to work fine. I install the 256MB card, and get this in dmesg:


sd 4:0:0:0: [sdb] 494080 512-byte hardware sectors (253 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
sd 4:0:0:0: [sdb] 494080 512-byte hardware sectors (253 MB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
sdb: unknown partition table


OK, so I put it in my Windows XP box, and it sees a FAT32 filesystem there. Can read/write to it fine. I format it under WIndows, just in case I'm hallucinating that it works in XP. I try it in the Linux box again, and get the same thing from dmesg.

Next, I use fdisk /dev/sdb and get:

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x62a297c4.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):


So, like, what the h*** is going on? I go through the steps to create a new primary partition (#1), label it 0c (Win95 FAT32 LBA, like my USB thumb drives), and write to the card and exit (with 'w'). I get told:

Disk /dev/sdb: 252 MB, 252968960 bytes
8 heads, 61 sectors/track, 1012 cylinders
Units = cylinders of 488 * 512 = 249856 bytes
Disk identifier: 0x62a297c4

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1012 246897+ c W95 FAT32 (LBA)


Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.

Error closing file


Before anyone asks, here's /proc/filesystems:

nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cgroup
nodev cpuset
nodev binfmt_misc
nodev debugfs
nodev securityfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev anon_inodefs
nodev tmpfs
nodev inotifyfs
nodev devpts
ext3
nodev ramfs
nodev hugetlbfs
iso9660
nodev mqueue
nodev rpc_pipefs
nodev fuse
fuseblk
nodev fusectl
vfat


Anyone have an idea what's going on? This s**t gets really tiring. I just want it to work, like it always does in Windows. Useful error messages would be nice.

Thanks!
 
Old 01-16-2009, 09:56 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,665

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
Try doing this first:
Code:
dd if=/dev/zero/ of=/dev/sdb bs=512 count=1
then :
1) create a new partition on the stick (vfat or type b in fdisk terminology):
Code:
fdisk /dev/sdb
2) and write a FAT32 file system on it
Code:
mkdosfs -F32 /dev/sda1
Be careful to use the right device name as it will erase everything on it

Shamelessly borrowed from AlienBob.

P.S. Or shoud I say borrowed to ? Please English speaking readers, correct me.

Last edited by Didier Spaier; 01-16-2009 at 10:11 AM.
 
Old 01-16-2009, 10:07 AM   #3
tiger762
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, tried that. Got an awful lot of these messages here when running dmesg:

end_request: I/O error, dev sdb, sector 1920
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 2160
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 2400
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 2640
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 2880
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 3120
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 3360
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 3600
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 3608
sd 4:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current]
sd 4:0:0:0: [sdb] Device not ready: <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
end_request: I/O error, dev sdb, sector 3848

The sector number mostly goes up by 240 with each message.

Quote:
Originally Posted by Didier Spaier View Post
Ty doing this first:
dd if=/dev/zero/ of=/dev/sda
 
Old 01-16-2009, 10:10 AM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,665

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
Sorry, I'm afraid that my former message was not complete when I mistakenly did hit 'Post" button. Please re-read it now.
 
Old 01-16-2009, 10:28 AM   #5
nafan
Member
 
Registered: May 2004
Location: /dev/bed
Distribution: Mandriva 2009.0 Powerpack
Posts: 172

Rep: Reputation: 30
The card is most likely using a 'superfloppy' type format, where the entire disk contains the filesystem, and does not contain a partition table.

Try mounting the device using
Code:
mount -t vfat /dev/sdb /mnt
 
Old 01-16-2009, 02:54 PM   #6
tiger762
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I get the following:

Code:
[root@electron asp]# mount -t vfat /dev/sdb /media/hp2gb/
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
dmesg shows the following:

Code:
FAT: bogus number of FAT structure
VFS: Can't find a valid FAT filesystem on dev sdb.
I'm at my wit's end.


Quote:
Originally Posted by nafan View Post
The card is most likely using a 'superfloppy' type format, where the entire disk contains the filesystem, and does not contain a partition table.

Try mounting the device using
Code:
mount -t vfat /dev/sdb /mnt
 
Old 01-21-2009, 07:04 PM   #7
tiger762
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Got it working

I got it working. Thanks for all the help.

Quote:
Originally Posted by tiger762 View Post
I'm at my wit's end.
 
Old 01-22-2009, 02:45 AM   #8
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,665

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
Just curious -- and it could help some other people.

How did you solve that issue ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Card Reader + Memory Stick Agon Slackware 2 07-10-2007 10:31 AM
USB memory card reader Hargibi Linux - Hardware 5 05-04-2007 05:00 PM
PCMCIA Memory Card Reader won't Mount NoIdentity Linux - Hardware 2 04-14-2007 08:10 AM
6 in 1 usb 2.0 digital memory card reader slackinagn Linux - Software 1 02-19-2004 07:01 PM
Can't access USB Memory Card reader rhauff Linux - Hardware 1 12-05-2003 09:10 AM


All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration