Restoring Case-sensitive HFS+ Volumes with Time Machine

I've always formatted my Mac OS partitions with case sensitivity enabled, which usually means formatting a new system and re-installing Mac OS X as soon as I get it. After installing the 10.6.2 update, I lost my system menu bar icons and was forced to restore from a 10.6.1 backup made the day before.

Following Apple's instructions, I booted to the Snow Leopard installation DVD, chose the "Restore System from Backup" option and thought I was on my way. About 50% into the recovery, the recovery application crashed:

Nov  9 19:27:08 localhost LCA[79]: Child exited with status 11
Nov  9 19:27:13 localhost Unknown[249]: Launching the Installer Crash Log Viewer
Nov  9 19:27:48 localhost ReportCrash[248]: Process:         Mac OS X Installer [148]
Nov  9 19:27:48 localhost ReportCrash[248]: Path:            /System/Installation/CDIS/Mac OS X Installer.app/Contents/MacOS/Mac OS X Installer
Nov  9 19:27:48 localhost ReportCrash[248]: Identifier:      Mac OS X Installer
Nov  9 19:27:48 localhost ReportCrash[248]: Version:         ??? (???)
Nov  9 19:27:48 localhost ReportCrash[248]: Code Type:       X86-64 (Native)
Nov  9 19:27:48 localhost ReportCrash[248]: Parent Process:  LCA [79]
Nov  9 19:27:48 localhost ReportCrash[248]:  
Nov  9 19:27:48 localhost ReportCrash[248]: Date/Time:       2009-11-09 19:26:34.635 -0800
Nov  9 19:27:48 localhost ReportCrash[248]: OS Version:      Mac OS X 10.6 (10A432)
Nov  9 19:27:48 localhost ReportCrash[248]: Report Version:  6
Nov  9 19:27:48 localhost ReportCrash[248]:  
Nov  9 19:27:48 localhost ReportCrash[248]: Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Nov  9 19:27:48 localhost ReportCrash[248]: Exception Codes: 0x000000000000000d, 0x0000000000000000
Nov  9 19:27:48 localhost ReportCrash[248]: Crashed Thread:  0  Dispatch queue: com.apple.main-thread
Nov  9 19:27:48 localhost ReportCrash[248]:  
Nov  9 19:27:48 localhost ReportCrash[248]: Application Specific Information:
Nov  9 19:27:48 localhost ReportCrash[248]: objc_msgSend() selector name: release

After rebooting back to the DVD, I noticed that during the recovery process, the first thing the utility does is format the drive being recovered without retaining the case sensitivity option that was present on it. Since there's no apparent way to use the Time Machine restoration program without it re-formatting again, I had to restore the backup manually.

With the Disk Utility application on the DVD, I reformatted the system drive as a case-sensitive, journaled HFS+ partition. Next, I opened Terminal and did a full rsync from the last backup on the USB drive to the local drive.

Note: because rsync is not available on the backup DVD, it has to be run from the backup's directory. And because the path is long and it has to be run twice, it's easier to assign it to a variable $RSYNC. Also, the path on your backup will be different since it contains the hostname of your machine and your drive's name.

# RSYNC=/Volumes/backups/Backups.backupdb/(your hostname here)/Latest/(your drive name here)/usr/bin/rsync

# $RSYNC -avE --progress /Volumes/backups/Backups.backupdb/(your hostname here)/Latest/(your drive name here)/. /Volumes/(your newly formatted drive name here)/.

While this was running, rsync spit out warnings about not being able to write to /tmp because the filesystem (/tmp, which is on the DVD filesystem) is read-only. These are harmless (and there is probably a flag to rsync to avoid doing this, but whatever).

After the backup was completely copied from the USB drive, I rebooted and found that the system would just display the gray Apple logo screen and then power off. After booting in verbose mode (Command+V), I saw a message about not being able to access /dev just before the system powered off. Apparently Time Machine doesn't backup /dev, so I needed to restore it from somewhere (no /dev/MAKEDEV on Mac OS I suppose).

I rebooted to the DVD again and just did an rsync of the DVD's live file system's /dev with:

# $RSYNC -av /dev/. /Volumes/(your new drive name here)/dev

I rebooted again and everything seemed to be back to normal, although iTunes was telling me my computer was not authorized on my account. I'm assuming there is some kind of unique system ID tied into the filesystem somehow, and when the system drive is reformatted, this unique ID gets changed. I deauthorized my computer and re-authorized it and everything seems ok now.

The initial issue with the menu bar icons in 10.6.2 was apparently caused by my disabling of Spotlight previously. I upgraded to 10.6.2 again and properly disabled Spotlight and everything is working now.

For my next trick, I will try to re-install PGP Whole Disk Encryption again once PGP finally comes out with a working version compatible with Snow Leopard, and then do a Time Machine restore from an encrypted backup drive.

Questions or comments?
Please feel free to contact me.