So I just spent a joyous few hours trying to figure out how to format my 2GB SD card for my Palm TX and have it work both on my laptop and on the Palm. The Palm will happily format the card itself, and it’ll work just fine inside the Palm, but alas, nowhere else. So then I tried formatting the card on my laptop, both with Ubuntu and with Mac OS X, and then the Palm just wants to format it when I stick it in.

So I dove in deep into the various geeky tools to see what I could do. I tried to repartition the card using cfdisk /dev/sdb1 but this lovely Palm format creates something that cfdisk doesn’t recognize:

FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

Using fdisk allowed me to see that the partition and the filesystem were marked as FAT16, so I could mount it if I told mount which filesystem it should see, like this: mount -t vfat /dev/sdb1 /mnt/tmp. So I can mount it ok, but not everything is happy:

[93139.773051] attempt to access beyond end of device
[93139.773067] sdb: rw=0, want=2797588, limit=2011136

Hmm, something is amiss. My guess is that this SD card is slightly bigger than 2GB in actual capacity, and FAT16 has a hard 2GB limit. The Palm is joyfully formatting the whole thing as FAT16, even though it should stop at 2GB. Anyway, back to making things work. I read lots of forums, tried some new tools like mkdosfs -F 16 /dev/sdb1 and dosfsck /dev/sdb1, but still it wasn’t working. I had read somewhere that Palms didn’t support FAT32, which is the FAT for disks bigger than 2GB, so I didn’t try that… until now.

So I created a new partition using the lovely cfdisk and set the partition type to 0B W95 FAT32, then I used mkdosfs /dev/sdb1 to create a FAT32 filesystem (mkdosfs tries to use the most appropriate version of FAT). And…. voila! It works on my Palm TX, it works on Ubuntu, it works on Mac OS X. And I am happy…