Re: Problems accessing USB Mass Storage

Andries Brouwer
2002-09-18T09:17:57Z

On Tue, Sep 17, 2002 at 12:15:13PM -0600, Jonathan Corbet wrote:

> SmartMedia cards are weird in that they have a (seemingly) random amount of
> waste space at the beginning of the card. Your 8MB card, in particular,
> has nothing of interest in the first 25 sectors. Some cards have a
> reasonable partition table in the first sector, and some don't. Modern
> Windows systems (and cameras, of course) seem to be able to access the
> filesystem on the card without needing to see a partition table.
>
> A little while I posted a Lexar SmartMedia driver patch which hacked around
> this by substituting a fake partition table when the first sector was read.

The structure of SmartMedia cards is well-known and precisely documented.
See, e.g., http://www.win.tue.nl/~aeb/linux/smartmedia/SmartMedia_Format.pdf
What varies is how readers present this to the outside world.

The card starts with the CIS, followed by a remapping table that tells
where on the card a given user sector lives. There are also sector checksums
and information about bad sectors.

Some readers have this as built-in knowledge, and present to card to
the outside world as an ordinary block device.

Some readers give direct access to the bits on the card, and then
understanding this remapping business is a job for the driver.

If you see non-understood space at the beginning of the card,
then one might suspect that your reader is of the latter kind.
The partition table will be on the card, but not on sector zero.

Andries