now | writings | rss | github | twitter | contact

restoring case-sensitive hfs+ volumes with time machine

posted to writings on nov 11th, 2009 with tags mac and nerd, last updated on feb 24th, 2011

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.

Comments? Contact me via Twitter or e-mail.