Mac OS X’s native file system (HFS+) supports journaling, a feature that is enabled by default on all new volumes. Journaling is a very nice feature as it allows a quick recovery of the file system’s status should anything bad happen to the machine — e.g. a power failure or a crash. With a journaled file system, the operating system can easily undo or redo the last operations executed on the disk without losing meta-data, effectively avoiding a full file system check.

However, journaling introduces a performance penalty for write operations. Every time the operating system has to modify the file system, it must first update the journal, then execute the real operation and at last mark the operation as completed in the journal. In most situations, this penalty is worth it for the reasons stated above. (Note: I haven’t benchmarked this penalty; it may be unnoticeable!)

There are some scenarios in which it can be avoided though. For example: I keep several disk images in my machine that hold the source code of some projects—NetBSD, pkgsrc—because these need to be placed in case-sensitive file systems. Up until now I had these configured as journaled HFS+ file systems, but I just figured out that I could gain some performance points by disabling this feature at the risk of losing the robustness introduced by journaling. After all, crashes are rare and power failures are non-existant in a laptop; plus the data stored in the images can be easily refetched at will in case of a disaster.

It turns out that the Disk Utility allows you to easily enable journaling for a volume (just check out the big icon in the toolbar), but the interface provides no way to disable it. Or at least I haven’t found that option. According to multiple articles I found, it was possible in older OS X versions. So I realized that the feature had to be available somewhere in recent versions.

And that’s right: the command-line diskutil program is able to disable journaling for a given mounted volume. Just run it as:

# diskutil disableJournal /Volumes/TheVolumeName

And voila! Journaling disabled.

For more details, check out the #107248 Knowledge Base Article.