Forcing a FAT16 format onto a 4MB FAT12 CompactFlash card

I have a 4MB card formatted with FAT12 and the code Ive inherited is for FAT16. I bought a USB CF Card reader so that Windows XP/DOS could format it, but it also formats it to FAT12. Is there any way to force a 4MB (currently FAT12) CF to FAT16. I now its not as efficient, but it would make things much easier for development.

Ben

Reply to
Ben Nguyen
Loading thread data ...

Wouldn't it be easier to patch the code for FAT12 instead? FAT12 is used for drives up to about 16MB, and FAT16 is used for 16MB to about 2GB. The reason FAT12 will always be chosen is because the tools will try to use the optimized filesystem. By switching the 4MB card to FAT16, you will loose some capacity. I do not see why it would be impossible to format the card as FAT16, but if you cannot find a tool to do it, you will probably have to write one yourself (or modify/hack the tool you use to format so that it CANNOT choose FAT16.)

Another option would be to just use a 32MB CF card instead of the 4MB card, this would force formatting to FAT16. Also, last time I checked, 32MB was the smallest you can find easily nowadays (not that you CAN'T get 4, 8, or

16MB; they just aren't as availible.) This is the option I would go with, but without knowing your specific needs or intentions, that may not be possible.

At any rate, I thought FDISK allowed you to choose only FAT16 or FAT32 (by choosing no when it asks if you want to enable large disk support.) I doubt it would work with DOS and USB though. What about a CF-IDE adapter? Then you can access the CF card like any other drive. Maybe "Partition Magic" from PowerQuest would allow you to do this? I know it allows you to change cluster sizes, but don't remember if it lets you change filesystems as well.

These are my thoughts, not necessarily expert opinions. I haven't messed with filesystems in quite some time. Maybe somebody more knowledgable will give a better answer.

Scott

P.S. Check out

formatting link
and see if it has anything of help. Specifically
formatting link
gnuPart looks like perhaps it could do the job you want.

Reply to
Scott McDonnell

The type of FAT (FAT12/16/32) is dependant *only* on the number of clusters on the volume. If you have fewer than 4085, then you must use FAT12, volumes with 4085-65525 clusters must be formatted FAT16. Further, there are many, many, many implementations that are just a bit off at the boundaries, so it's strongly recommended that you do not create any volumes with sizes within about 16 clusters of the actual boundaries (leave some space unused at the end of the physical device if necessary).

That being said, it's basically impossible to create enough 1KB clusters on a 4MB device to exceed 4084 (you don't count the reserved areas at the beginning of the volume - up to, and including, the root directory area). To manage it you'd have to create a volume with only a single FAT and a root directory with no more than 96 entries (you'll need to check my math here). And in any event that leaves you way too close to 4085 for comfort.

If you format with 512 byte clusters, you should always get FAT16.

Probably the definitive definition of FAT:

formatting link

Reply to
Robert Wessel

Format with 512 bytes (1 sector) per cluster, at 4MB you'll just squeeze into FAT16. Infact I suspect you may encounter a problem finding a formatter that lets you specify such things on the command line or via a dialogue box, it's probably just as quick to use a disc editor.

Sure, it makes the FAT a bit bigger, but for small files 1 sector per cluster could be more efficient for you... Sprow.

Reply to
Sprow

First, I second the other opinions that this probably isn't a good plan. You're practically begging for trouble down the road.

If you still insist you have to do id that way, you may have better luck with non-MS tools. GNU mtools, e.g., come with a program that does let you choose the FAT type (and just about everything else, too) explicitly.

If they don't work on Windows, you could still use a friendly Linux near you to do this once, then image the CF and replay that image instead of formatting.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

I found a utility that looks promising (Diskman :

formatting link
Ill try it tonight and post my results.

Im not very familiar with this file systems so Ill just cut and paste what it says about it:

"4MB is VERY SMALL for FAT16. You will be able to do but only just 4MB

=4194304 bytes =8192 sectors

Therefore, using very small clusters (1 sector sized) you will have about

8000 clusters. The minimum for FAT16 is 4085, therefore this is okay. However, if bigger clusters were required (2 sectors) there wouldn't be enough of them to make it FAT16. Looking at the DM source code it appears that the smallest FAT16 volume possible (by my sums) is about 2.5MB. FAt12 make better use of the space in small volumes."
Reply to
Ben Nguyen

Hi,

Try Partition Magic. It can convert from different file formats. It can convert from FAT-16 FAT-32. I am not sure if it can convert from FAT-12 FAT-16.

Regards Anton Erasmus

Reply to
Anton Erasmus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.