Dec 142007

Well, once again I’ve got a bee in my bonnet … and once again, it’s Microsoft that I’m whining about. This time, it’s not the office suite that “Works” by name (but not by nature), but rather, their pathetic excuse for file system management.

I’m sure most people have heard of the FAT and NTFS file systems. I’m sure that NTFS has some nice features. I’m also quite sure there’s a reason why FAT is so popular on flash drives, when better alternatives exist for this role (such as JFFS2). But one thing I hate about BOTH file systems, particularly on their reference platform, is their ability to fragment files.

As some of you may already know, I do a lot of network administration work for Asperger Services Australia who run a network of 5 Windows XP-based workstations hanging off a Gentoo Linux server. Sadly, Windows XP is a necessity on this network, as they require Microsoft Office to communicate with government departments (who haven’t yet seen the light that is ISO26300, but that’s a rant for another day), and they also use MYOB for their accounts (in the absence of decent open-source accounting software configured for Australia’s rather complicated tax laws, I’m happy for this to continue).

The maintenance is generally not to bad. However, over the last few days, I’ve been doing some much needed work just before I get whisked away to work in some distant location. Part of this, is file system defragmentation.

Now, feel free to correct me if I’m wrong, but I don’t seem to recall too many issues regarding fragmentation on any legacy Unix systems. Either the problem was ignored, or it didn’t exist to any significant degree — otherwise I’m quite certain that there’d be tools alongside fsck to defragment a file system. I don’t see any for EXT2/3, ReiserFS, XFS, JFS, HFS/HFS+, FFS or UFS (in its various forms). Some filesystems, like HPFS, I even seem to recall in the OS/2 Warp 4 install, it mentioning how HPFS doesn’t need to be defragmented, since space gets automatically allocated before writing begins on a file. Which is ironic that NTFS should be suffering from fragmentation so bad, because Windows NT did, back in v3.x days, use HPFS as its native filesystem. Therefore I ask this question:

Why are Microsoft operating systems so lousy at managing file systems?!

C’mon guys, you’re supposed to be the market leaders. Where’s the bloody leadership? Why can’t you develop a file system driver for your operating systems that prevents, as much as possible, any fragmentation of the disk? I can understand if the disk is just about full, needing to fragment a file, but even then I notice other file systems manage fine… but why does this need to happen on a practically empty disk?!

I spose I should show you the horrors that greeted me yesterday and today. Below, are the fragmentation reports generated from one of the boxes I look after. Admittedly, I don’t think I’ve ever ran defrag on them in the year or so this particular one has been in service — I didn’t think it’d be a problem with a mostly-empty disk. I was wrong (the full reports can be viewed here, and here):

Volume OS (C:)
    Volume size                                = 29.28 GB
    Cluster size                               = 16 KB
    Used space                                 = 9.34 GB
    Free space                                 = 19.94 GB
    Percent free space                         = 68 %

Volume fragmentation
    Total fragmentation                        = 13 %
    File fragmentation                         = 26 %
    Free space fragmentation                   = 0 %
Volume APPS (D:)
    Volume size                                = 45.23 GB
    Cluster size                               = 4 KB
    Used space                                 = 912 MB
    Free space                                 = 44.34 GB
    Percent free space                         = 98 %

Volume fragmentation
    Total fragmentation                        = 21 %
    File fragmentation                         = 42 %
    Free space fragmentation                   = 0 %

21% fragmentation on a disk that’s 2% full?! WTF is going on? Microsoft’s OS is so lazy, it fragments files in a partition that’s so empty, it could duplicate the files another 49 times over. If they’re concerned about performance when appending to files, then why not leave a 1MB growing space or something? There’s plenty of space — use it wisely.

I’m not sure what the strategy is in various file systems out there, but I’m sure it wouldn’t be hard for Microsoft to take a look at how it’s done, and implement it in their own systems. It can’t be too difficult, because almost everyone else seems to handle the situation fine.

I guess it’s just another example how the Redmond-based slap-dash software company continue to rip us off and hobble the IT industry.