Recovering from more hard drive woes

Yes, I’m still using the same nonereliable hard drive that resulted in frequent beach balling. On Sunday, it had some more surprise alligators in store for me and decided to render my hard drive unbootable by corrupting the file system journal used to recover from sudden crashes/loss of power. My first instinct was to run the Disk Utility repair feature on the drive, but this was a no-go because, firstly, I was using Filevault 2, Apple’s full-disk encryption software.

Disk Utility refused to mount my drive, even after clicking the “unlock” button to decrypt it. What’s a guy to do? I tried to use command line utilities to mount the drive (mount_hfs and diskutil cs unlockVolume), but got no joy due to the combination of Filevault 2 AND a corrupt journal. Eventually, I realized I could still undo the encryption, broken journal and all using diskutil cs revert diskname (where diskname was obtained via diskutil cs list).

Four hours later, I had an unencrypted, but still-unmountable drive. The journal was still corrupt. The first step to being able to read the data on the disk was to mount the drive while ignoring the journal:
mkdir /Volumes/mydrive; mount_hfs -j /dev/disk0 /Volumes/mydrive

You can now copy files off the drive (you might want to mount the drive as read-only for that). Next, using diskutil, the existing journal needs to be disabled and then reenabled (it won’t work by simply disabling it). When journaling is reenabled, the broken journal is discarded, enabling a normal mounting of the drive:
diskutil disableJournal /Volumes/mydrive; diskutil enableJournal /Volumes/mydrive

I had to run fsck -fdry /dev/disk0 in order to make the drive bootable and also to copy system files from the Lion recovery disk back to the main OS; to determine which files were missing, I had to boot using verbose mode by holding Command+V while booting. Many of my applications were unable to run after doing this; the problem is that the system files in the Lion recovery disk are only the 64-bit versions. Any software that needs the 32-bit version of the system files won’t run. You’ll need another computer from which to grab those files. Thanks Allison and Alicia!

After performing these repairs, there’s still no guarantee everything will work. As you can see, my computer was still confused after this operation. Computers often have a tendency to bajtů in the rear.

Leave a Reply

Your email address will not be published. Required fields are marked *