The Journaling File System in Mac OS X

—by Massimiliano Picone, info@applenewton.it

19 November 2002

In the Mac OS X/Mac OS X Server 10.2.2 update Apple introduced Journaling, an important feature that will increase the uptime of your server. When you have a power failure and the computer restarts, the system disk is in an unknown state and the Operating System must do a data integrity check of the entire disk to ensure that no system files are dramatically damaged. In a normal disk with some GB used the check that the OS performs after a power failure restart could take minutes but in a multiterabyte volume this could take hours.

The new journaling feature in Mac OS X will incredibly speed up the restart process by writing into a file, called journal, each process that writes data on the disk. The disk will no longer be in an unknown state when using journaling because the System checks the journal file and reads the last normal process line, bringing the system up again and resuming operations that were interrupted during the failure. All this will happen in seconds (depending on the number of files you have and the volume size).

This journaling system is developed by Apple as an extension to the Mac OS Extended volume format (HFS+) so you can have a normal volume or a journaled volume. The great thing is that you can enable and disable journaling in a HFS+ disk with a click—without having to reformat the disk or having data loss. There’s complete compatibility with all applications because the journal works at a system level, writing all the transactions of the Volume. Obviously, when the System finishes making a transaction, it is purged from the journal so that the file will not become too large. Compatibility with earlier version of Mac OS Extended file system is fully supported as Apple says.

Because the journaling system features 32-bit allocation blocks, it also supports up to 255 character file names and Unicode text encoding for international and mixed-script file names.

But are there just benefits in this? The main downside to the journaling file system is a performance hit. However, the performance hit happens only when the system writes into the disk and not when it reads from the disk. Now I must note and underscore that Apple wrote a great and robust journaling system of two different types that ship with the two different versions of Mac OS X: the client and the server version. In the client version journaling is a “normal” one, disabled by default and if you want to enable it you must use the Terminal. This normal version has a 15–20 percent performance hit depending on the Mac you’re using.

In Mac OS X Server we have a buffered version of journaling; the more RAM you have, the less the performance hit. With 512 MB of RAM the performance hit is just 2-3 percent. It’s still disabled by default but here you can enable it just by opening the Disk Utility application and by clicking the enable journal button for each volume. The command line disk checker tools and Disk Utility have been updated to work with journaling but by reading this knowledge base article I noticed that some thirdy-party disk repair applications that are incompatible with journaling can turn off journaling.

Another downside in Mac OS X Server journaling is that you can’t use disk quotas with a journaled volume. So you’ll need to open Workgroup Manager and in the Sharing tab assure yourself that the enable disk quotas box is unchecked. There is an Apple Knowledge Base article regarding this.

Information on how to enable journaling with command-line tools in Mac OS X Server and client version is available by Apple here. A word regarding Mac OS 9: in Mac OS X Server you usually don’t have the classic enviroment (Mac OS 9) installed and so you don’t shift between systems. But if (for example) you’re doing backups of the server and you plug the external backup drive into a Mac OS 9 computer, the system will simply ignore the journal—so don’t worry.

I’ve enabled the journaling feature in my dual 1 GHz processor G4 Server with 1024 MB of RAM with no problems for me and my users. Now I’m only happier that the overall system is more stable. However I recommend, as Apple do, for maximum uptime to use Journaling in conjunction with an active backup strategy and possibly RAID.