Re-formatting a HP-200LX memory card to save space

 

    First, let's begin with some theory: The file system uses clusters to take control of files. Clusters are a constant-sized blocks of a drive. A file can be located in one or (usually) more clusters, but two files can't share one cluster. For example when we have a 3kB file and 2kB clusters, the file uses 2 clusters occupying 4kB.

What happens with the missing 1kB of space? No file can use it, because the cluster is already used, so it's wasted.

The problem is bigger when we're talking about a palmtop, where files are very small. In an ideal FAT file system the number of clusters determines maximum number of minimum-sized files stored on drive. But FAT16 file system is not ideal, so it can maximally store 65526 clusters. It means that if we use a card larger than 64MB, the FAT will simply not hold the entire card when 1K clusters will be formatted. Even if we use a 64MB card, we have to sacrifice about 16K of space.

It means that if we use larger card, we will have available only first 64MB after re-formatting. This hack is not applicable if you have card bigger than 64MB.

We can make less wasted space by formatting a memory card with a smaller cluster size. It's 4kB with HP-formatted cards, 2kB when we format it using Windows format tool. We can format it even to 0.5kB, but access will be VERY slow and we will use only first 32MB. The good middle-point is 1kB.

To format the card, we need:

 - A memory card reader

 - A PC with Windows 9x - it's important, WinXP WILL NOT WORK, and will make card unusable in 200LX (until re-formatting back in 200LX). Here I used a PC with Windows 95 OSR2.

The procedure is as follows:
1. Insert the card to the reader and the reader to the PC
2. Determine which letter is the card (in our example drive X:)
3. Copy everything to the hard drive - it's better to use an archiver such as 7-Zip or WinRAR to make a nice backup
4. Check the backup!
5. Open Start menu->Run and type in:

            format x: /Z:2

6. Confirm everything and format. ALL DATA ON CARD WILL BE LOST! Some bad blocks will be tried to recover at the end of the card.
7. Restore the backup to the card.
8. Put the card back to 200LX, turn it on and as first screen pops in press Ctrl-Alt-Del...

The /Z attribute specifies cluster size as a multiplier of sector size (512 bytes). So if we want 4K clusters we use /Z:8.

 

These pictures show space before and after re-formatting. Used space (marked with red rectangle) is smaller after re-formatting. there is more free space for Your files.

 

Final notes

If you screwed up, you can re-format your card in 200LX as follows:
1. Ctrl-Alt-del
2. As the system boots, press ALT
3. press 5
4. Type:

d:

cd bin

fdisk100

4. Now create a blank partition, confirm, exit FDisk100
5. Ctrl-Alt-del, Alt, 5 (as in steps 1-3)
6. Type:

d:

cd dos

format a:

It usually works.

 

MCbx, 2010


Home
Back to home pagehacks
Back to hacks