Regularly defragment your built-in File Store!
If you happen to have a Pocket PC with built-in storage (it's called iPAQ File Store, LOOXstore, Built-in Storage depending on your particular Pocket PC brand; in this article, I only use File Store - FS for short - when referring to it) on your (pre-Windows Mobile 5) Pocket PC, you may want to regularly defragment it, particularly if you often write to it.
Why is this needed, you may ask. It's pretty easy to explain: if you often write/copy files to your FS or install applications there that do this automatically, the file system easily becomes fragmented, which results in tremedous slowdowns, particularly as far as writing operations are concerned.
As has already been pointed out, there can be many cases when you don't even know that writing to FS is taking place. For example, the great alternative Web browser NetFront (see this blog entry for information on the latest version) has a local cache. Being local means the following: if you install NetFront in the FS, then, it'll also keep its cache in the FS, resulting in even hundreds of new, written (and old, deleted) files in a Web browsing session. The list continues – for example, a lot of mobile phone handler applications (see this article on them) do the same, as with alternative mailer clients like WebIS Mail.
An example of what problems this can cause: I haven't ever defragmented my LOOXstore (the name for the built-in FS in Fujitsu-Siemens Pocket Loox devices) since I've bought my Pocket Loox 720 (some 14-15 months ago) and, when I started making some explicit tests to see how fast it is, I was really frightened to see it was about 30 (thirty) times slower to write to than after a defragmentation. Indeed it's worth defragmenting the FS in order to gain back the lost speed!
How can you defragment the FS?
It's pretty easy. Just copy all the files from the File Store to a temporary storage. Both your desktop computer and your PDA's RAM (if there's enough of it to store the current contents of your FS) will suffice. If you go for the former, make sure you read the desktop file copy-related comments here. If you go for the latter, you can use even the built-in Pocket File Explorer. Much as it doesn't show hidden files, it copies them. The same stands for Resco File Explorer, which also disables showing hidden files by default (you can easily override this by enabling File/Options/Browser/Show all files), but it does copy them in both directions.
If you opt for copying the contents of your FS to the RAM of your device, do the following:
- start your file explorer of choice (in here, I use the built-in File Explorer) and go to the root directory of the file system
- go to the tap-and-hold the directory name of the FS and choose Copy from the context menu:
- navigate to the directory (in the RAM or, if you don't mind the slightly slower transfer speed, in any memory card) you want to temporarily store the files in. Tap-and-hold the screen anywhere while you're in the directory and choose Paste from the context menu:
You'll see the traditional clock icon while the files are being copied. After the copying has finished, the directory will reappear:
- go back to the File Store directory; step into it. Bring up the built-in keyboard, click Ctl and then, click A. All files and directories will be highlighted:
- tap-and-hold anywhere in the list and choose Delete from the context menu:
Answer Yes to the following question.
Note that File Explorer doesn't delete directories with hidden files inside, as can be seen in the following screenshot:
In this case, you may really want to delete these directories (and the files inside) with, say, Resco File Explorer on the Pocket PC – or any desktop-based file explorer. Leaving them there won't cause much problems, except for some (minimal) fragmentation remaining in the FS, though.
- Now, return to the temporary directoy you've copied your files to and select all files/directories the same way as before the deletion (Ctl + A on the on-screen keyboard). Tap-and-hold the list somewhere and choose Cut:
- Go back to the FS, tap-and-hold the (now, empty) filelist and choose Paste. All files will be copied back to here – now, without being fragmented.
Now, you're set – everything is speedy again.
Tips and tricks for advanced users: Fine-tune the FS speed by reformatting it and modifying the formatting parameters
The tutorial above doesn't reformat the FS – it "only" defragments it. If you do format it, however, you can achieve even more speedup.
First, let's see how you can format the FS. It all depends on the particular Pocket PC model you have.
- Some PPC's (for example, the iPAQ 2210) grant unlimited access to their FS; that is, you can use any third-party, PPC-based card formatting tools (of which there're many) to format your file store.
Using these formatting tools is pretty straightforward. No matter which tool you choose, you just navigate to the formatter dialog and format the FS. Please check out the screenshots and the instructions in the main comparison chart to see where these features are located and how you can access them.
- There're some Pocket PC's that only have a "super" hard reset feature, which delete the contents of the FS when you "super" hard reset them. One of these Pocket PC's is the Fujitsu-Siemens Pocket Loox 720 (PL720 for short). These devices don't allow for (other) formatting attempts – therefore, you can't just use formatter tools. The downside of this approach is that you must hard reset your device in order to reinitialize its FS. This is not a problem if you backup the contents of your PDA and restore it after a hard reset.
There's not much point in using this feature as you can't change the formatting parameters.
- Some Pocket PC's have built-in tools to initialize the FS; for example, the iPAQ rx3715. They don't allow for changing the parameters either.
- Finally, there are Pocket PC's, which only reformat their FS upon an operating system upgrade/reflash. No parameter changing either.
A comparison chart of the iPAQ 2210 and the PL720
I've made some thorough tests on what tools/options you can use/you have when trying to reformat the FS of these two devices. The results can be seen in the comparison chart below.
Note that, in addition to the above-mentioned formatting options ("super" hard reset and third-party formatter tools running on the Pocket PC), I've also listed Card Export II, which (may) show the FS as a local drive in the connected desktop Windows operating system and, in cases, might allow for direct formatting it from under the desktop Windows. That way, you can avoid getting a third-party formatter tool for the Pocket PC.
Devices tested:iPAQ 2210PL720
Built-in "super hard reset?"-+, Calendar + Power + reset
Card Export II 2.11b- (Write protected)- (doesn't even map the FS)
Resco File Explorer 5.35 (tap-and-hold the card in the tree view and choose Format from the context menu; on the next dialog, just click Format and then, Yes)+- (complains of being locked)
SKTools 2.3.24 (double-click the Storage Cards icon in the main menu; in the next dialog, highlight FS in the top list and go to Action/Format. You can also set formatting parameters – to fine-tune the file system in the FS – here in Tools/Settings before formatting the card)+; allows for fine-tuning- (it is offered but doesn't work)
CNetX Flash Format 2.62 (go to Settings/System, click the Flash Format icon, go to the Format tab and choose the FS from the drop-down list above. After this, just click Format at the bottom)- -
Pocket Mechanic 1.59 (choose Logical Format in the main menu and choose the FS in the "Choose a volume" drop-down list)+ - ; its settings dialog doesn't allow for enabling access to the FS either
Storage Tools 2.0 (go to the Format tab and choose the FS in the above drop-down list. After this, click Format in the bottom left corner)+ -
Achievable results of fine-tuning the FS parameters
As I've pointed out in my article "Optimizing storage cards", by playing with the formatting options (the file system, the lack of FAT table backup, the cluster size), you can achieve (additional) speedup. In the following comparison chart, I give you some of them, all measured on a iPAQ 2210 by copying about 600 files, totalling 500 kbytes, to the File Store, into the same subdirectory, after formatting it.
As can be seen, creating a backup FAT table has an adverse effect on the speed and, therefore, should be avoided. As has also turned out, the file system FAT16 with cluster sizes 2-4 kilobytes turned out to be absolutely the fastest. Of the two, I recommend the smaller, 2 kbyte option to reduce allocation losses.
Of course, your particular Pocket PC model may have different optimal settings. Feel free to play with the different formatting options to find the most optimal setting. Always use many small files to test the most optimal setting because it's always file creation speeds that are greatly influenced by the file system, cluster size etc. settings - not plain large file-copying speed.
File system/parameters usedResults
FAT16/0.5k, no backup FATNot formattable to this
FAT16/1k, no backup FAT21s
FAT16/2k, no backup FAT18s
FAT16/2k, with backup FAT28s
FAT16/4k, no backup FAT18s
FAT16/8k, no backup FAT19s
FAT16/16k, no backup FAT30s
FAT32/0.5k (Resco default)23s
FAT32/1k, no backup FAT20s
FAT32/1k, with backup FAT29s
What about Windows Mobile 5?
Windows Mobile 5 (WM5) doesn't have File Store (except for the Extended ROM in PPC Phone Edition devices; they are, however, not visible to the casual user unless you explicitly "unlock" them) - all files are stored in the same, central ROM memory.
With WM5 devices, a hard reset automatically formats the storage memory. I'm still making some tests to find out whether fragmentation is an issue with the built-in storage of WM5 or not. Some say it is, some it isn't. Stay tuned!
Recommended links
Optimizing storage cards - this article is a must for everyone!
Defragmenting storage cards - another very important article.
ADDITION (later the same day): don't forget to check out the comments!
UPDATE (8:34AM CET, the next day): : I've heavily updated the article, thanks to the insightful comments of MobilitySite user Pony99CA.
- Login or Register to post comments
Printer-friendly version




The cause for the speed degradation with heavily fragmented FS's is very simple - if you copy a new file in a fragmented place, the FAT table seems to be written to without any kind of caching, unlike with the case of sequential writing (when it suffices to flush the new FAT addresses only once).
It seems the FAT table is written to only once if there's no fragmentation (that is, the consequent clusters are written to in a row); if there is, however, fragmentation, the operating seems to write to the file system when it needs to skip some memory area allocated to some other file.
This is really a pain in the back, particularly if the cluster size is small (say, 512 bytes - the default with a lot of FAT32 systems).
Think of it: if you copy a 100 kbyte-long file to a heavily fragmented memory and the FAT-based memory controller needs to write to new address information after transferring, say, every 512 bytes (the memory is so fragmented), then, the file copy will really slow down – in my case, easily to the 1/30th of the original, defragmented/freshly formatted speed.
I'm just making the WM5 fragmentation tests. Will keep you posted as soon as they're all done. It takes some time because I also test whether WM5 still slows down when the WinCE databases are full (the case of, say, synchronizing thousands of Outlook mails to the Pocket PC via ActiveSync).
Nope, those results have been all measured in the ideal (non-fragmented) case. In fragmented case, they may have been much more different. That is, the only show the effect of the actual file system used in a FS to give a hint on the differences caused by different file systems - in the optimal case.
As it's almost impossible to reliably and reproducably repeat the tests with heavily fragmented FS's so that the results are comparable, i haven't made quantitive tests of the latter. I do think, however, than 512-byte blocks would have performed much worse than, say, 4 kilobyte-ones. I'm not 100% sure, of course - that's only the case if my theory is right about the fat constantly upgraded during a file copy.