Make HFS to ZFS conversions fast and painless
Let’s say you wanted to convert millions of computers to a new file system. How would you do it? Back up, reformat the disk, and then reinstall everything?

Or run a handy file system converter that changes the file system without touching the files?

What? You can do that?
According to a patent filed by a couple of smart Apple engineers, yes you can. The hardworking Greg Keizer mentioned it in this Computerworld article. I thought it was worth a deeper look.

What it does – and how
The patent says:

. . . a first file-system can be converted to a second file-system while . . . files stored on the computer . . . remain virtually undisturbed in the same location. . . . the second filey-system can be generated primarily based on the location of the file(s) already stored on the computer . . . . It will also be appreciated that there is no need for rewriting or storing the file(s) while the file system is being converted.

The converter reads the existing file system to find out where all the files are on disk. Then it creates a new set of data structures, such as a catalog and file extents, for the new file system. After verifying the new data structures, the converter can then replace the first file system by, for example, modifying the disk’s partition map and and overwriting the volume headers of the first file system.

Here’s the flowchart for the conversion:

Apple file conversion flow chart

HFS+ to ZFS conversion is obvious
But is that all there is to it? The patent makes the point that the converter could be embedded in iTunes and used to convert the file system used on a media player. I can see the dialogue box now:

You have attached a Zune media player. Would you like iTunes to make it compatible with your iTunes music collection and the iTunes Music Store? All existing Zune music will be saved.

Pop in an AACS decryption program – or maybe this happens after the labels give up on encryption – and away you rock.

Set Reality Distortion Field to “global domination”
Or how about this. Apple supports Mac OS X on non-Mac hardware. Change the file system, use Rosetta technology and the open-source Wine Windows emulator to run existing Windows apps and it is a whole new world.

Instead of shipping a few million copies of OS X every year on low-margin hardware, Apple suddenly has the opportunity to sell tens of millions of high-margin copies. The hardware business continues, because Mac hardware is good, and suddenly there is a huge new market for Apple to conquer: the world’s installed base of 700 million PCs.

The StorageMojo take
Touchless file system conversion is a very cool capability. It makes it plausible that ZFS will become the default file system for Mac OS 10.5.n. I still don’t think ZFS will make be the default file system in Leopard from day one, if only because of the Q&A advantages of rolling it out first on OS X Server.

As for the less grounded speculation: Apple is a profitable and cash-rich company with a strong brand and high-quality hardware. They are about as well-positioned to offer Mac OS X on non-Apple machines as they will ever be. If they partnered with IBM for support they would have a ready entree into a business market tired of the foul stew of viruses and malware in which Windows machines swim.

It is a charming thought, no? Real competition on the world’s desktops.

Comments welcome, of course.