disable HFS+ journaling on Leopard to use disks read/write with linux

Disk Utility in Leopard no longer allows you to disable journaling through the interface on a drive. The menu where it used to be only says "Enable Journaling" but it's grayed out (cause your drive is probably journaling already).

Political Rant (feel free to scroll on by)

So, someone at apple is making it harder and harder to run non-journaled hfs+ filesystems, even for external drives. Is this someone responsibly looking out for data integrity of their users, or deviously making it harder to use the disks crossplatform? Seems like removing this option is going to inconvenience more people than it helps. I hope this is an oversight that gets fixed at some point, cause HFS+ isn't that bad of a platform for moving data if you don't care about Windows clients. Ubuntu and Debian Linux now ship with HFS+ support by default - probably because of the rise of the iPod.

Apple should make non-journaled HFS+ disks the standard for moving data between Linux and Mac and help us get away from the horrible FAT32. How hard is it to leave in the option to disable journaling - or even to point out that linux computers can read non-journaled hfs+? The CD burning system advises you how to make windows friendly disks, and mail.app offers to send windows friendly attachments! Apparently the days of Apple being the most compatible platform - a platform that went out of its way to interoperate with what the other systems were doing to minimize pain for its small user base - is now over. Of maybe Apple is fine with interoperating with the ubiquitous, expensive and inconsistent windows world, but is pretty scared to invite the rapidly maturing and totally free Linux platform to the party? Unfortunately, too many steps down that road and microsoft's NTFS will solidify into the default crossplatform filesystem now that linux has read/write support for it. With all the patents on NTFS being held in Redmond, that's not good for anyone long-term.

Getting started

Anyway, here's how you disable journaling on a hfs+ filesystem by using the command line tool.

diskutil is the command line tool provided by Darwin (the mac's BSD core) that does what Disk Utility does through a graphical user interface. Fortunately, it can do everything that the graphical interface can do. Parenthetically, diskutil is still capable of making partitions smaller than 1GB (another casualty of Leopard's changes to the GUI Disk Utility) check out the partitionDisk command - it's not easy, but it works.

Ok, back to our subject!

Scouting it out

Type diskutil --help to see all the associated commands. Type man diskutil to really get more information about what it can do.

First: Lets assume that you are trying to turn off journaling on a 300GB disk called "Janice" that is connected to your machine via firewire. The first thing you should do is to read the listing of disks to find out where Janice is in the system's underlying mount points.

yourcomputer:~ youruser$ diskutil list

diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *74.6 Gi    disk0
   1:        Apple_partition_map                         31.5 Ki    disk0s1
   2:            Apple_Bootstrap                         40.0 Mi    disk0s2
   3:            Apple_UNIX_SVR2                         2.0 Gi     disk0s3
   4:            Apple_UNIX_SVR2                         33.0 Gi    disk0s4
   5:                  Apple_HFS MacHD                   39.4 Gi    disk0s6
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *279.5 Gi   disk1
   1:        Apple_partition_map                         31.5 Ki    disk1s1
   2:             Apple_Driver43                         28.0 Ki    disk1s2
   3:             Apple_Driver43                         28.0 Ki    disk1s3
   4:           Apple_Driver_ATA                         28.0 Ki    disk1s4
   5:           Apple_Driver_ATA                         28.0 Ki    disk1s5
   6:             Apple_FWDriver                         256.0 Ki   disk1s6
   7:         Apple_Driver_IOKit                         256.0 Ki   disk1s7
   8:              Apple_Patches                         256.0 Ki   disk1s8
   9:                  Apple_HFS Janice                  279.4 Gi   disk1s10

Look for the name of your disk. The second set of lines there ends with a line that says "Janice". diskutil groups all of the logical divisions of a physical disk together in the list. Since our volume 'Janice' is listed under /dev/disk1, we can determine that /dev/disk1 is our 300 GB external firewire drive.

What is the rest of that garbage before the the Janice line? It's a series of small partitions that Apple uses to store various types of information about the disk. The very first one, disk1 itself, is a tiny area containing the map of all the other areas. Each subsequent partition has an added number s1, s2 etc appended to the disk name - disk1 in this case - to make a complete identifier for that partition on this mac system. You're going to need to note that Janice HFS partition where we want to disable journaling is disk1s10.

OK, we know what we have to target, let's do it.

Taking Action

If you read the man page for diskutil (type 'man diskutil' in your terminal) you might think that we could just type:

yourcomputer:~ youruser$ diskutil disableJournal /Volumes/Janice
An error occured journaling the filesystem: The underlying task reported failure on exit (-9972)

Hmm... what happened here.. dunno. Maybe despite me owning the disk, I need to apply a little more elbow grease by using elevated privileges. I'll use sudo.

yourcomputer:~ youruser$ sudo diskutil disableJournal /Volumes/Janice
An error occured journaling the filesystem: The underlying task reported failure on exit (-9972)

Darn it, Apple! Is this why you disabled the option in the GUI? Cause there are bugs in diskutil that you didn't bother to fix by October's Leopard ship date? Maybe I'm being cynical, but the error message sure isn't helping me at all.

Oh well... Google doesn't come to the rescue.

Reading the man page again..... what if I dismount the disk and use the [force] option that the manual page tells me can only be run on an unmounted disk?

Let's try. Unmount your drive -- "Eject" in the Leopard finder. Then form a slightly different command by inserting the term 'force' after the disableJournal command, and by replacing the mounted volume name with the partition identifyer that I had you get in the first section. Like so...

yourcomputer:~ youruser$ sudo diskutil disableJournal force /dev/disk1s10
Journaling has been disabled for volume Janice on disk1s10

Ah, that's better. I think I'll move all my media files onto this disk for editing on my inexpensive, user-friendly and powerful linux workstation. Sweet, thanks Apple!

UPDATE: A quicker solution is to hold down option when you click the menu in Disk Utility - this enables the disable journaling option. Thanks to the reader that informed me. Fortunately haven't had to struggle with either command line errors or gui obfuscation to disable journaling again as haven't booted MacOS in a while.