RE: The Linux FAT issue on SD Cards.. maintainer support please

From: Mukund JB.
Date: Fri Aug 12 2005 - 10:47:03 EST



Dear Lennart,

Thanks for the immediate reply.
Please see inline comments.

>If you don't at least read the partition table to find where the first
>partition starts, then you won't know where to start looking for a FAT
>filesystem.

When I said mount, I guess FAT will read sector 0 to get the partition
info. And is it due to lack of partition support in the driver that will
affect the FAT layer reading the device.
Please update?

>> Is it why I am NOT able to mount the CAM formatted device?
>> Is this a problem?
>
>Well in the past I have seen cards that had a partition table, with one
>partition in it (usually either primary partition 1 or 4) and had that
>partition formated with FAT12, 16 or 32 (depending on size).

Yes, right, my card size if 16 MB. FS type is FAT12.

> Some had no partitions, and just had the whole device formated with
FAT > like a floppy. Windows seems to deal with both, as does linux
(as long as > you ask it to mount the right device such as /dev/sda1
sda4 or sda > depending on which partition (if any) the card
uses.

The SD card has partitions on it (both: cam, windows).
So, my device node accessing is direct.
You can see below the SD card has a single primary partition.

So, I say "mount -tvfat /dev/tfa0 /mnt" which works for windows
formatted SD.
The same does NOT work with CAM formatted SD.

Sfdisk -l /dev/tfa0 ( CAM & win)
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/tfa0p1 * 0+ 449 450- 14371+ 1 FAT12
/dev/tfa0p2 0 - 0 0 0 Empty
/dev/tfa0p3 0 - 0 0 0 Empty
/dev/tfa0p4 0 - 0 0 0 Empty
Warning: partition 1 extends past end of disk

I don't understand, what is /dev/tfa0p1? I have no such device.

>If you ignore partitions entirely, many cards will not work for you
>since they do have partitions on them. Some will work if they use the
>entire device without partitions like a floppy would.

Will you please elaborate this?
What kind of partition support is required in the driver to support the
Camera Fat12 formatted SD Card?

I dumped the 1st sector of SD when formatted on CAM.
I have attached the files. Please have a look at them

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
sector
in Partition table)

Regards,
Mukund Jampala



>And the minfo of the partition:
>device information:
>===================
>filename="/dev/sde1"
>sectors per track: 32
>heads: 2
>cylinders: 450
>
>mformat command line: mformat -t 450 -h 2 -s 32 -H 57 c:
>
>bootsector information
>======================
>banner:"PwrShot "
>sector size: 512 bytes
>cluster size: 32 sectors
>reserved (boot) sectors: 1
>fats: 2
>max available root directory slots: 512
>small size: 28743 sectors
>media descriptor byte: 0xf8
>sectors per fat: 3
>sectors per track: 32
>heads: 2
>hidden sectors: 57
>big size: 0 sectors
>physical drive id: 0x80
>reserved=0x0
>dos4=0x29
>serial number: 6F68CF4E
>disk label="CANON_DC "
>disk type="FAT12 "
>
>Len Sorensen
?`Á9GpUªë?  Gpø 9?)NO NAME FAT12 UªøÿÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿNIKON001DSC"!0MISC !0!0DCIM !0!0