Wednesday, January 18, 2012

How to optimize your SD-Card for Offline maps

So, I took a while to do it but here it is since I've just formatted my card today. This is a follow up from this post.

This process will improve the efficiency of the memory of your SD-Card. I don't want to go in too much details but to store 100.000+ of tiles from Google Maps or OSM, you need to use small clusters to make sure your card doesn't fill up to quickly.
The smaller the cluster, the more efficient the tiles storage on your card will be. By default, a card is formatted with 32K clusters (if my memory is correct... :-) )

Find out the smallest cluster size you can use by checking this formula:


FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 268435446


Concretely, here the smaller size for the following SD card sizes:
16GB=4096
8GB=2048
4GB=1024
etc...

Here are the steps to format your SD-Card:

Step 1: do "Windows key+R" and type "cmd".
Step 2: type the following command line


{Volume letter}: /FS:{format chosen} /A:{cluster size}


NB: this example works for 8GB SD-Card.


Here is the full documentation if you need more:


FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
FORMAT volume [/V:label] [/Q] [/F:size]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
FORMAT volume [/V:label] [/Q] [/1] [/4]
FORMAT volume [/Q] [/1] [/4] [/8]

volumeSpecifies the drive letter (followed by a colon), mount point, or volume name.
/FS:filesystemSpecifies the the file system (FAT, FAT32, or NTFS).
/V:labelSpecifies the volume label.
/QPerforms a quick format.
/CFiles created on the new volume will be compressed by default.
/XForces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid.
/A:sizeOverrides the default allocation unit size. Default settings are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).Note that the FAT and FAT32 files systems impose the below restrictions on the number of clusters on a volume:
FAT: Number of clusters <= 65526 FAT32: 65526 < Number of clusters < 268435446
Format will immediately stop processing if it decides that the above requirements cannot be met using the specified cluster size.
NTFS compression is not supported for allocation unit sizes above 4096.
/F:sizeSpecifies the size of the floppy disk to format (160,
180, 320, 360, 640, 720, 1.2, 1.23, 1.44, 2.88, or 20.8).
/T:tracksSpecifies the number of tracks per disk side.
/N:sectorsSpecifies the number of sectors per track.
/1Formats a single side of a floppy disk.
/4Formats a 5.25-inch 360K floppy disk in a high-density drive.
/8Formats eight sectors per track.


No comments:

Post a Comment