Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] 2GB miniSD card and 1024-byte sectors - cannot mount



Hi,

As mentioned in an earlier thread I've been busy playing with a new
keitai, which has the particularity of being able to switch to "data
storage" mode and thus behaves as a straightforward pen-drive when
connected to the computer via a USB cable.

I have 3 miniSD cards I use with it right now: a 64MB card that was in
the sales package, a 1GB card I ordered at the same time as the phone
and a 2GB card I ordered more recently.

Both the 64MB and 1GB cards are no problem to use whatsoever. The fact
that the phone formats cards as "superdisks" isn't a problem either, I
can mount /dev/sda instead of /dev/sda1 no problem.

What *is* a problem, however, is a wierdness with the 2GB card.

Other than the obvious differences in geometry, the 2GB card shows as
having 1024-byte sectors. Having run `strace fdisk` I ascertained that
fdisk acquires this information with an ioctl call.

Okay then. No problem. "mkdosfs -S 1024" should be able to tackle that.
But it doesn't. Subsequently attempting to mount the newly formatted
card results in "mount: /dev/sda1: can't read superblock"

Yes, I did partition the card and format /dev/sda1.

Yes, I get exactly the same results if I use it as a superdisk and try
and mount /dev/sda instead.

So, I got the phone to format the card and then took a look at the
content of the bootsector to see if there was anything strange going on
there.

All is perfectly normal except that the bootsector contains 0x0200 at
offset 0x0b meaning that it's claiming that the sectors are 512 bytes
in length rather than the 1024 that fdisk found. Furthermore, the first
FAT is indeed 512 bytes into the "disk", supporting the content of the
bootsector rather than what's being reported by ioctl.

Regardless of how I format the card from my command line, and
regardless of the type of filesystem I put on the partition, my Linux
box is unable to use it - mount is unable to read the superblock.

Interestingly enough, a partition formatted on the command line *is*
usable by the keitai. It'll store audio and video on it no problem. I
just can't mount it on the Linux box!

My gut feeling says it has something to do with the 1024-byte sector
size reported by fdisk. mount doesn't appear to call the same ioctl if
the strace output is anything to go by, and the system call to mount(2)
fails with an EIO error, which is odd since pulling data off the card
with dd works fine.

Googling for information about 1024-byte sectors threw up a few results
about reformatting RAID arrays...

Any ideas out there?

--
G. Stewart - godwin.stewart@example.com

Which is worse: ignorance or apathy?  Who knows?  Who cares?

Attachment: pgpsSKPwlIJAm.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links