Monday, March 11, 2013

How to Unjournal a Journaled Drive (HFS) especially on TONIDO

 HP Officejet Pro 8600 e-All-in-One CM749A#B1H (Google Affiliate Ad)

A few years ago I turned over my ultimate files to the Apple iMac after nearly losing my valuable baby pictures of my son.  Windows XP, the pariah of Operating Systems which started out brilliantly, was now the laughing stock of the PC world.  The safety of a decent file system was germane to my search for a stable OS.  I looked into Linux, liked what I saw, but only the file system interested me for that system.  The software for everyday use was a step backwards from Windows.  In the end, it was the Mac and its OS that interested me more.

The actual iPhoto software program was amazing at first,  but in addition to the software, I was amazed at the operating system.  The way in which files could be dragged and dropped at a moment's notice without worrying about extraneous characters or the length of the characters was simply amazing.   Several file commands, FTP, SMB, AFP and more were easy to do, along with the reading of files from other operating systems.

One interesting feature was the file protection used by OSX called Journaling.  Journaling is a feature that was found in the earlier versions of Mac OSX (Server 10.2.2) and then OSX 10.3 (Panther) - all way before my entrance into the Mac World.  It served as a feature that preserved the integrity of the file system against power outages or hardware component failures.  And I have to admit that the original loss of my baby pictures and video on my Windows machine was due to an electrical surge.  Something that I found out later.  Journaling works and it works very well.  In the 7 years since I have been using my Mac I have never had a file or disk failure that erased my data despite three power surges during that time frame.   If the machine (my laptop in particular) shuts down unexpectedly, something that happens when I don't pay attention to the warnings that the power is running down, there is always a copy of the file that I was working on available when the machine restarts.   Or if there is a bad start, the system finds a way to come back on as if nothing happened.   So for the major drive it's a God send, but what about other drives?

This is where there is an issue.   In using the ubiquitous USB disc drives, I have been able to transfer files back and forth between windows machines and macs without an issue.  The Mac Journaling system aka HFS+ trumps the Windows system, so that if you transfer a file to the USB drive from a Mac, there is a possibility that the HFS+ is sent with it.  For windows machines, unless the drive is formatted in an Apple machine, this usually means that there are a few "ghost files" with weird characters associated them.  They can safely be erased in Windows land.

The real issue comes not from Windows actually but from Linux.   Although Apple prides itself with its Unix core, it is not strictly a Unix platform, nor is it a Linux one, although both operating systems share the core Unix identity.  This is born out when you are using a pure Linux server.  In my case, I have been putting together a system that I can access safely from anywhere in the world, but remains completely off the grid when it comes to my home server.    I have used the Tonido Plug with great results over the past year, but ran into trouble a few months ago when I couldn't write to it from anywhere.  I checked just about everywhere to find a solution and then ran into the Tonido forums where I discovered that I had disconnected the USB drive and loaded it with software directly from a Mac.  Although it was originally formatted in Linux on the Tonido Plug, this mere act of transferring files was enough to convert the entire partition on the 500 gb hard drive into a HFS+ Journaled hard drive.

I went months trying to find a solution to this.  My main concern was that I would have to reformat the drive, which would have been a nightmare because of the 30+ Shares that I have on several folders and the access shares (15 in all) from the 15 different people who have partitions on the drive (Kids, family) and use it as their personal storage when outside.   I looked high and low for a solution and finally found it.

Journaling is fantastic if you are using a Mac, but using a server that is strictly Linux, it is not necessarily what you want.  On the plus side no one can add a file to it, but that includes the host or main person who owns the server.  You keep everything out, which is not optimal.  So Journaling has to be removed.

The only way I know to do it is on a Mac.  The removal method protects the disc so data is destroyed. 


There is a command line way to remove it, but you have to be a die-hard to do it this way:

0.  Place the USB hard disk in teh Mac. (Disconnect it from your Linux server).
1.  Open the Terminal.
2.  Type  # diskutil disableJournal /Volumes/Volumename


Where # is the command character
diskutil  is the program call
disableJournal is the command
/Volumes/Volumename  is the actual location of the disk.

Again, this is only for the super geeks.

For the rest of us mere mortals, you do the following:

0.  Place the USB hard disk in the Mac. (Disconnect it from your Linux server).
1.  Open Disk utility and highlight the USB disk drive.
2.  Press the "Option key" and then select "File"
3.  In the drop-down menu, you should see "Disable Journaling"  Click on it.
4.  You are done.  You should be able to use the drive on any system without the restriction of just
     using it on a Mac. 

Why this little ditty is hidden is beyond me.  But there it is.

I hope this helps someone who may have been confused by all of this.  Remember, this technique does not reformat your hard drive.  All of your data remains safe.   Also remember, don't do this on your original hard drive running your Mac.   Yes, it will speed up the Mac a little, but trust me, you do not want a corrupt file system, especially if you have an encrypted drive and the power goes out.  But for drives that are going to be used in a mixed OS environment, you are better served no having the external drives journaled (HFS+).

Hope this helps.


IPD.



 Reference:

http://support.apple.com/kb/HT2355


2 comments:

  1. Does the drive need to be mounted to do this? I want to do this on a MAC internal drive, which has an invalid btree node size error, and I'm hoping it's in the journal and I can recover the data by killing the Journal. Thanks!

    ReplyDelete
  2. In your post you say data is destroyed though it is obvious that you meant Not destroyed. "The removal method protects the disc so data is destroyed. "

    Thanks for your post.

    ReplyDelete

I will be trying unmoderated comments for a while. If this gets ridiculous, then I will have to move to moderating the comments once again.

Google