On Mac OS X, how can I disable journaling on shutdown and reenable it on boot?

2

1

The why: I want to share a home partition with Ubuntu, but I don't want to give up journaling while booted into Mac OS X (Snow Leopard) if I don't have to.

What I've figured out:

The commands I want are

diskutil disableJournal /Users

and

diskutil enableJournal /Users

(The volume is mounted on /Users)

rc.local and rc.local.shutdown looked promising at first, but I think there's a dependency which rules them out.

I tried to make a StartupItem, but it wasn't running.

What I'm looking for:

What is an explanation of how to make a StartupItem specifically for this? I have the gist of it, but I'm missing some subtleties.

What is an explanation of why a StartupItem is the wrong way to go about is and a suggested course of action?

Is there a really obvious easy solution or is this entire endeavor is pointless? What is the explanation?

Alex R

Posted 2010-12-18T09:54:01.993

Reputation: 191

I have the same deal on my Macbook Air. I have two partitions—one for the OS and one for all Users, which I mount at /Users. When I run the sudo diskutil disableJournal /Users command I get: "An error occurred journaling the file system: The underlying task reported failure on exit (-69860)". I would love to see this feature, because now I boot to linux from an external drive using rEFIt. For now I am going to login OSX as root and disable journaling permanently until this question is properly answered. – Jonathan Komar – 2012-12-16T10:04:32.033

Answers

2

First of all, what version of OS X are you in?

Second, just a clarification: I assume the reason you need to disable journaling is that Ubuntu doesn't support reading and/or writing to HFS+ Journaled volumes?

Or, wait, what in the world....

diskutil disableJournal takes a path to a volume, not to an arbitrary folder.

So, if your home folder is located on the root drive, in /Users/, you would do something like

diskutil disableJournal /

Or do you have a volume named Users? If so, you would use:

diskutil disableJournal /Volumes/Users

Okay, both rc and the StartupItem method have been deprecated for some time. Both have basically been replaced by launchd, which has taken over the place of init (I think, anyway, you'll notice launchd is PID 1).

While I think StartupItems are still supported in 10.6, rc is officially unsupported, as man rc states:

rc.local is now unsupported and has been replaced with launchd(8), which bootstraps itself via the launchctl(1) bootstrap subcommand to read in launchd(8) jobs from the standard locations.

You can check the following for LaunchAgent and LaunchDaemon definition files:

 ~/Library/LaunchAgents         Per-user agents provided by the user.
 /Library/LaunchAgents          Per-user agents provided by the adminis-
                                trator.
 /Library/LaunchDaemons         System-wide daemons provided by the admin-
                                istrator.
 /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
 /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.

NSGod

Posted 2010-12-18T09:54:01.993

Reputation: 1 485

1Actually I have the volume mounted in /Users. Also, I'm on Snow Leopard. – Alex R – 2010-12-18T17:38:25.900

From what I've read, LaunchDaemons aren't guaranteed to run at boot or shutdown, just before they're needed. – Alex R – 2010-12-18T17:42:36.487

Ubuntu does support reading a journaled HFS+ volume, but not writing. – Alex R – 2010-12-18T17:52:36.473