Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enable a journaling file system on OS X 10.2.2 Client System
10.2.2 is out and it has journalling available as a Disk Utility option for OSX Server. The option is still there for OS X Client, but hidden.

Journaling allow the system to recover more easily from crashes and protect against corruption by having a "journal" (a buffer where changes are first made and then afterwards written to disk) and makes recoveries much faster when using tools like fsck. In exchange for this, extreme disk usage could have an impact (up to 10%) on performance. So, it's not recommended if your machine moves a lot of files around unless it's a file server, in which case it is *strongly* recommended (the priority in servers is safety of the files, not the speed of the disk).

To enable journaling on OS X Client, use the Terminal command:
 % sudo diskutil enableJournal /
There does not appear to be a man page, but 'diskutil --help' will get a rudimentary list of commands.

WARNING: This could very well mangle the filesytstem. Do not try it if you're not comfortable using root, the terminal or if you don't have everything you care for backed up safely somewhere (I use my iPod for this).

[Editor's note: The release of OS X 10.2.2 earlier today helped set a new record of sorts on macosxhints! The above hint regarding the journaling file system was submitted by 14 different users within a span of 45 minutes! Since 'eduo' was first in the queue, it's his hint that I chose to run, but thanks to everyone for being on the ball on this one! Edited: I fixed the command and removed the reference to the 'man' pages, as there don't seem to be any...]
    •    
  • Currently 1.71 / 5
  You rated: 2 / 5 (7 votes cast)
 
[64,976 views]  

Enable a journaling file system on OS X 10.2.2 Client | 47 comments | Create New Account
Click here to return to the 'Enable a journaling file system on OS X 10.2.2 Client' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
no man listing for diskutil
Authored by: theNonsuch on Nov 12, '02 12:42:40AM

Strange, I don't have a listing for diskutil... ?



[ Reply to This | # ]
no man listing for diskutil
Authored by: encro on Dec 10, '02 10:08:21PM

likewise here ?!?



[ Reply to This | # ]
no man listing for diskutil
Authored by: chabig on Dec 17, '02 12:15:50PM

There is no man page for diskutil. But type 'diskutil --help' and you'll get a list of commands.

Chris



[ Reply to This | # ]
diskutil usage (mini man page available)
Authored by: crkrenn on May 03, '03 10:45:29AM

Just type "diskutil" without any arguments to list the options available
with diskutil besides "enableJournal" and "disableJournal".

"diskutil list" and "diskutil info /" are other useful commands and don't
require root access.

-Chris

PS. Many other Un*x commands (particularly GNU versions) also will
give usage information if they are also typed with no arguments.



[ Reply to This | # ]
diskutil man page
Authored by: IslandDan on Dec 10, '03 01:14:54AM

There is now a man page for diskutil in Panther. One neat thing to do is to create a removable drive like a USB Flash drive with a Windows partition map that will work on both Windows and OS X with one DOS partition and one HFS+ partition.

Ex: diskutil partitionDisk '/dev/diskN' 2 MBRFormat MS-DOS DOS 20M HFS+ HFS 20M

where diskN is the correct drive (N is replaced with the correct number). Use the df command to fine the diskN for a volume.

Be _real_ careful!



[ Reply to This | # ]
slash tip from Slashdot
Authored by: dr_turgeon on Nov 12, '02 12:44:25AM

Make that 'sudo diskutil enableJournal /' As you know, this came up already today [slashdot.org]



[ Reply to This | # ]
Thanks!
Authored by: robg on Nov 12, '02 01:21:03AM

I fixed the original hint ... I also removed the reference to the non-existent man pages, although 'diskutil --help' will get a basic list of commands.

-rob.



[ Reply to This | # ]
GUI access available on OSX client as well
Authored by: daniel_steffen on Nov 12, '02 12:54:45AM

The GUI tool Disk Utility can be used to control journaling on Mac OS X Client as well, as it determines at runtime whether to show the journaling controls or not. All it does to verify if it's running on Server is check for the presence of the file ServerVersion.plist in /System/Library/CoreServices. Establishing the following symbolic link is sufficient to make this test pass:

sudo ln -s SystemVersion.plist /System/Library/CoreServices/ServerVersion.plist
BTW, with this in place, About this Mac will claim that the machine is running Mac OS X Server.



[ Reply to This | # ]
GUI access available on OSX client as well
Authored by: yoc on Nov 12, '02 05:29:35AM
Be carrefull !
After this hint if you hit software Update again, Apple will send you the Jaguar Server 10.2.2 Combo update !
I recommend to delete this link after you enabled the journaling FS :
sudo rm /System/Library/CoreServices/ServerVersion.plist


[ Reply to This | # ]
Point of no return
Authored by: NikWest on Nov 14, '02 06:23:08PM

Well, I wasn't careful enough and just blindly applied the hint.
After the reboot the system thinks it is Mac OS X Server.

Well, I deleted the link, rebooted, but it still thinks it's OSX Server.

Is there any way to just convince the system that it is NOT OSX Server?

NW



[ Reply to This | # ]
GUI access available on OSX client as well
Authored by: rvamerongen on Nov 12, '02 07:40:05AM

The System Software updater dont get confused?



[ Reply to This | # ]
GUI access available on OSX client as well
Authored by: wOOge on Nov 12, '02 10:32:20AM

i did this just for fun and reboot my mac...
there was no spash screen, but the system login window thought it was on OSX SERVER.... and some preference panes also are convinced.

i've downloaded the OSX SERVER update, and i'm going to install it and see what happens... anyone else try this?



[ Reply to This | # ]
Don't do this...
Authored by: daveschroeder on Nov 12, '02 11:00:48AM

Yes, your machine thinks it's running OS X Server, but attempting to install the OS X Server 10.2.2 Update will, at best, leave your machine with non-functional, or maybe half-working, Server bits. At worst, it will hose your machine. The Server updater, like many Apple updaters, expects the items that are being updated to exist beforehand in their default locations in order for them to be updated properly. They of course don't exist. Another issue would be that you'd have no valid serial number for OS X Server; but the bigger issue would be that you'd still be missing a LOT of OS X Server parts.



[ Reply to This | # ]
Don't do this...
Authored by: wOOge on Nov 12, '02 12:04:31PM

i looked at the files it updates, re-read your post , and figured i didn't want to go through the hastle of re-installing X and all my apps... just for 'fun'

thanks for the info though... I'll wait for a more inconvenient time to hose my machine ;)



[ Reply to This | # ]
Now I am running OS X server
Authored by: uteck on Nov 12, '02 10:36:58AM

I did this and then ran software update, and the OS 10.2.2 Server update is listed now. I will install it to see if it works. If I don't respond today then assume I am reinstalling :)



[ Reply to This | # ]
Now I am running OS X server
Authored by: uteck on Nov 12, '02 11:09:23AM

Everything is OK! In Utilities I now have the extra programs that Server has, Macintosh Manager, SQL Manager, ect. Some do not work (Network Image Utilty), others I don't know what they do (Workgroup Manager). Over all, the machine still boots and the apps still run.
But then I go out of my way to try to destablize my machine, it is the only way I know how to learn about it :)



[ Reply to This | # ]
Now I am running OS X server
Authored by: uurf on Nov 12, '02 12:54:00PM

I logged in to my machine via an account where I had not turned of auto software update; next thing I know the 10.2.2 Server Update was being downloaded and installed. (Actually, having installed 10.2.2 remotely via ssh, I thought it strange that the update didn't seem to take and said "go ahead" before I realized it was Server not Client update that was being applied.)

Unfortunately you'll find that none of those things (the server apps that end up in the Utilities Folder) work (Cannot Connect to server) and you now have no control over Sharing from the Pref Panes for example.

Luckily my php and apache installs seem to still work correctly as does mod_mp3, but who knows what's caught now in a half-server, half-client state. For example, 10.2.2 Server says it updates Apache 2.0, but my box is still @ 1.3.27

I am hoping that removing Serverversion.plist (which incidently is no longer a symlink after the 10.2.2 Server ug is applied) and installing 10.2.2 Combo from the standalone will put things right, but who knows.



[ Reply to This | # ]
Now I am running OS X server
Authored by: uurf on Nov 12, '02 12:55:36PM

I logged in to my machine via an account where I had not turned of auto software update; next thing I know the 10.2.2 Server Update was being downloaded and installed. (Actually, having installed 10.2.2 remotely via ssh, I thought it strange that the update didn't seem to take and said "go ahead" before I realized it was Server not Client update that was being applied.)

Unfortunately you'll find that none of those things (the server apps that end up in the Utilities Folder) work (Cannot Connect to server) and you now have no control over Sharing from the Pref Panes for example.

Luckily my php and apache installs seem to still work correctly as does mod_mp3, but who knows what's caught now in a half-server, half-client state. For example, 10.2.2 Server says it updates Apache 2.0, but my box is still @ 1.3.27

I am hoping that removing Serverversion.plist (which incidently is no longer a symlink after the 10.2.2 Server ug is applied) and installing 10.2.2 Combo from the standalone will put things right, but who knows.



[ Reply to This | # ]
Symbolic link not needed
Authored by: daveschroeder on Nov 12, '02 11:19:18AM

Actually, it appears that ServerVersion.plist just has to exist; it doesn't have to be a link to SystemVersion.plist. All you have to do is a

sudo touch /System/Library/CoreServices/ServerVersion.plist

Then your system won't think it's Server, but Disk Utility will still expose the GUI for Journaling.

It's still probably recommended to get rid of ServerVersion.plist, though, when you're done playing around with Disk Utility.



[ Reply to This | # ]
Symbolic link not needed
Authored by: oPossumi on Jan 28, '03 11:07:57AM

The touched file has to be deleted indeed. At least Sharing Preferences Pane get confused by the existing ServerVersion.plist file.



[ Reply to This | # ]
What should I do if I have partitions?
Authored by: jmordoj on Nov 12, '02 01:14:18AM

If I want to enable Journaling, but my internal hard drive is partitioned in 3 (logical) disks:

Should I just type 'enablejournal /' and that's it, or should I repeat this for every partition on my disk (like '/Volumes/***')?



[ Reply to This | # ]
How to use with multple partition & drives?
Authored by: bussdriver on Nov 12, '02 11:28:53AM

Using the same command there is a built-in man page for it. Just type the command and it will list directions. Use the device path to indicate drives.
-----
I've already done this on my machine and it works just fine:

1)
diskutil list
(it returns a list of all drives)

2)
Find the volume you want (its name will be in there somewhere) in the list and its corrisonding device path, such as /dev/disk3s9 or if its a RAID, /dev/disk3
(The s# part is the partition number. Apple RAIDs don't seem to have the extra partitions for drivers and maps for some reason; so you just use the disk#)

3)
sudo diskutil enableJournal /dev/disk3s9

Note:
the disk should be already mounted before you run this command. (it says so in the directions)

ALSO, you can see if its on using:
disktuil info disk3s9



[ Reply to This | # ]
How to use with multple partition & drives?
Authored by: jmordoj on Nov 12, '02 01:33:39PM

Why use de device path (/dev/Os**) instead of the path you get when you drag a disk to the terminal (/Volumes/***)???

What's the diference?



[ Reply to This | # ]
And...
Authored by: Myrddin on Nov 12, '02 01:23:21AM

I may be wrong but to have journaling on every disk then you have to repeat the process by replacing the 'destination' each time with the name of the disk, ... /Volumes/'disk or volume name'.



[ Reply to This | # ]
Multi-drives/partitions....
Authored by: balthisar on Nov 12, '02 06:35:44AM

Selectively enabling disks seems like a great thing. Those who know about these things seem to say that enabling journaling can potentially slow write operations up to 10% -- this is a big deal if you depend on the virtual memory a lot.

If, like me, you have your /Users mounted on a separate partition, that's an ideal place to enable journaling to protect your data. The system drive (the OS and Applications) don't need it, really, since you won't lose anything in the event of a real emergency (clean installs fix just about everything). If you haven't used any tweaking to move your swap partition, then it defaults to your non-journaled system drive. If you DID move swap to another drive, DON'T enable journaling on that drive. Finally, if you use Photo Shop, Final Cut Pro, and/or other applications that let you define scratch partitions, set them up for a non-journaled drive. Then, you'll get the benefit of data protection without the alleged speed losses.

Finally, BIG QUESTION: what happens when you mount a JOURNALED drive under a NON-JOURNALED operating system? Suppose I take my 10.2.2 journaled FireWire drive to my mother's 10.1.5 system. I imagine reading is no problem, but what about writing, especially when I put it back into a journaled system? Any ideas?



[ Reply to This | # ]
Multi-drives/partitions....
Authored by: mervTormel on Nov 12, '02 08:07:25AM

i think the journal would just expire. it would come alive again back on the journaling host.



[ Reply to This | # ]
Multi-drives/partitions....
Authored by: Myrddin on Nov 12, '02 10:57:42AM

Good question. You should have no problem, business as usual, the journaling is yet to be fully implemented in Mac OS X 10.2.2. I think a person using a *Nix system with USB or FireWire drives could answer the question on a full journalling file system.



[ Reply to This | # ]
Enabling Journaling (mounting point)
Authored by: jmordoj on Nov 12, '02 02:08:27PM

So I want to enable Journaling In a Partition:

Te comand is:

sudo diskutil [device], wich, in thisk case, IT IS NOT /

Wich one of this should I replace [device] with?

Device Node: /dev/disk0s11
Device Identifier: disk0s11
Mount Point: /Volumes/Docs



[ Reply to This | # ]
No go ...
Authored by: NikWest on Nov 12, '02 02:55:24PM

Well, it worked for me on 3 out of 4 partitions.

With the 4th partition I get the following error:

[icebox:/] dominik% sudo diskutil enableJournal /Users
Pre-allocating the journal file failed on volume /Users (No space left on device)
Try using a smaller (4096 k) journal size
Journaling has been enabled on /Users


This is strange, because I have 1,5 GB free on this partition.

Anybody had the same problem?

NikWest



[ Reply to This | # ]
No go ...
Authored by: okamisama on Nov 12, '02 04:26:59PM

Worked on all four partitions of my desktop machine's main drive, but not on my (unpartitioned - gasp!) ibook drive where I got that same error message. Neither the pure terminal approach nor the disk utility hack worked.

Over one gig free space. I don't remember ever doing anything strange with the disk formatting.

I don't have a clue...



[ Reply to This | # ]
No go ...
Authored by: danvtim on Nov 12, '02 05:47:41PM

Shouldn't the volume be /Volumes/Users instead of just /Users



[ Reply to This | # ]
No go ...
Authored by: atbat on Nov 12, '02 09:15:00PM
According to a MacSlash posting, you may need to optimize your drive.
The poster says that "In my case [the hard drive] was so fragmented that it couldn't find the 8 contiguous megs it needed and suggested a smaller (4 meg) file without telling me how to specify the smaller file. (oops)"

[ Reply to This | # ]
Swap partition
Authored by: SOX on Nov 12, '02 04:23:14PM

Enabling the journalling diminshes the write speed by about 10%. (the read speed is unaffected). This loss is trivial except for write intensive tasks. On such task it Swap (paging). And there is no reason to journal swap that I can think of.
However unless swap is actually on another disk partition I'm not sure if you can disable journaling just on the swap file system that is on the same as the root partition. Sure you could issue a command not to journal the swap file system (disksutil disableJournal). but would this have the desired effect?? that is if one is not journalling every write to the partition's metadata does this offere any crash proteection. And likewise after a crash will the whole partition have to be FSCKed if any part of it was not journaled. My guess is that the answer here is that you have to journal a whole partition or none of it.

Thus it seems to me that moving the swap to its own partition is an evn better idea than it was before. So what is the current wisdom and HOWTO on safely making a swap under 10.2. Searching at mac osxhints reveals several strategies that broke under 10.2, and some contradictory advice that seems to be a bit flakey



[ Reply to This | # ]
Swap partition
Authored by: Anonymous on Nov 13, '02 12:27:38AM

Maybe so, maybe not. Once the swap mechanism allocates a chunk o' disk (I think in 80MB chunks -- can't rememebr, maybe 800? Doesn't matter. Big chunks, anyway), it uses some extremely low level API to read/write pages of memory to the swapfiles.

In particular, the APIs used are designed to work in relatively large and very regularly sized chunks (pages and multiples therein) while also continue to work during low level interrupts [pagein/pageout requests at bottom end of the kernel].

As well, the swapfiles are inherently volatile. That is, the state and contents of the swap files have no meaning once a system has been shutdown-- purposefully or because of a failure.

As such, I would not be at all surprised if the journaling support in OS X does not actually journal writes to the swapfiles as there would be no point in doing so.

This is, of course, completely conjecture. I have no idea if this is actually the case and, frankly, if it is even possible.

Anyone checked if the source is in the Darwin repository and bothered reading it yet??



[ Reply to This | # ]
Okay, now what?
Authored by: inik on Nov 12, '02 06:57:47PM

All right, so I have a journaled file system. Now how do I get any benefits from this? Can I roll back disk operations? Do I just magically get more stability now? What interface do I use to take advantage of these new features?



[ Reply to This | # ]
Okay, now what?
Authored by: sreeves on Nov 12, '02 07:09:18PM

Just sit back, crash your machine, and marvel at how fast it starts back up again.



[ Reply to This | # ]
Now: faster crash recovery
Authored by: crkrenn on May 03, '03 10:51:37AM

I'm installing journaling because I periodically let my iBook battery run
down, and reboots used to take 5+ minutes.

Journaling should reduce that crash recovery (essentially a background
fsck process) much faster.

-Chris



[ Reply to This | # ]
FYI
Authored by: Myrddin on Nov 13, '02 07:11:08AM
OK, haven't read the file yet but here is Apple's take on journaling. FYI, I have a different partition for my System 10.2.2, downloads, and Classic on one hard drive. My /Users and /swap directories have their own partitions on another hard drive. I have enabled journalling on everything but the the swap directory. No problems at all, and even on an unsupported machine (upgraded 7300) I see no big slow down with drive access.

[ Reply to This | # ]
Performance
Authored by: bluehz on Nov 13, '02 08:55:19AM

Seeing the info about the 10% performance hit - I have to wonder if I shoudl be doing the journaling thing on my aging G4/400 (AGP).

Also - what is its impact on video capture and things that already have troubles with disk IO?



[ Reply to This | # ]
Performance
Authored by: Myrddin on Nov 13, '02 07:13:44PM

Journaling just effects the writing of data to the hard drive, playback of video and audio should be fine.



[ Reply to This | # ]
Performance
Authored by: Myrddin on Nov 13, '02 07:25:05PM

Sorry, I didn't really answer you did I, long day.

Writing to disk for me (7300 450 MHz G4 and ATA 66 card) I only have approx. 3k per second less speed in writing to the hard drive. I used Disk Monster (from the CHUD tools) to benchmark the drive and the slowdown is minimal for me so you should be fine. If it doesn't work with video then just turn off journaling.



[ Reply to This | # ]
Performance
Authored by: Anonymous on Nov 14, '02 01:19:32PM

please test this out for us! Do some video capturing and test what kind of capture rates you can sustain with journaling on as opposed to with it off. Thanks!



[ Reply to This | # ]
Booting pre 10.2.2 system (Install CD)
Authored by: quo on Dec 03, '02 08:33:17PM

Depending on the implementation of the journalling
there's a good chance that booting a previous System,
such as from the original 10.2 installation CD or something
even earlier, could wreck havoc to the file system in question.
Until this is verified, I would not use this option without having a
bootable "rescue" System supporting journalling.

Quo



[ Reply to This | # ]
Opinion: booting pre 10.2.2 system should not be a problem
Authored by: crkrenn on May 03, '03 11:01:25AM

I do not believe that booting a prejournaled system should at all be a
problem because it is not a problem on ext3 linux systems with
journaling.

The worse that I think could happen is if a journaled system goes down
with a power failure. If you now boot or mount that disk with a
prejournaled system, you may lose some data on open files, and fsck
should run automatically.

This is my opinion, based on my experience with the ext3 journaling
system in linux. Journaling is designed to increase data safety. Until I
have convincing evidence to the contrary, I am trusting that apple (&
BeOS) did the job right.

Of course, I'm also periodically mirroring my drive, but I did that before,
and I think that is simple common sense.

-Chris



[ Reply to This | # ]
A Journalled iPod
Authored by: carsten on Feb 25, '03 08:48:37PM

Journalling has been fantastic on my internal drives, I had a few power failures longer than my UPS could handle and subsequent startups are much faster now.

I recommend booting into single-user mode first and run fsck on all drives to repair any existing problems before enabling journalling. Or boot into OS9 and repair all drives with Alsoft's DiskWarrior.

Just for "sh*ts and giggles" I thought I'd enable journalling my iPod too:

% sudo diskutil enableJournal /Volumes/Carsten's\ iPod/ 
Password:
Allocated 8192K for journal file.
Journaling has been enabled on /Volumes/Carsten's iPod/

The Disk utility application confirms that my iPod's HFS+ drive is indeed journalled. So far... no problems.

Anyone know how to increase or decrease the allocation size of the journal?

[ Reply to This | # ]

A Journalled iPod
Authored by: Berbie on Feb 28, '04 08:25:12AM

Hi, do you still have journaling enabled on your iPod, any problems with this? I actually had to reformat it because of a b-tree corruption.



[ Reply to This | # ]
A Journalled iPod
Authored by: carsten on Feb 29, '04 12:56:53PM

Hi,
Yes I'm still running my iPod with journalling turned on, it hasn't caused any problems with iTunes synchronization or mounting it on the desktop.

I'm leaving it on, in case of a power failure when I have the iPod mounted on the desktop while copying files. Fortunately that specific situation hasn't happened to me yet, so I can't definitively give any anecdotal evidence whether it will help in that situation or not.

However journalling of my computer's hard drive noticeably decreases boot time after a power failure, and I haven't had to boot into single-user mode to manually run fsck in ages since enabling journalling! So I believe it does have some value for an iPod too, especially if you do mount your iPod on your desktop.

As someone else pointed out here, if you mount a journalled drive on another computer with an older OS which doesn't support journalling, once you remount it back on the newer machine again the journal will simply be expired (I'm guessing due to any modification time-stamps on the volume) and then the journal will be reset/brought back up to date.



[ Reply to This | # ]