Restoring my Mac from backup

Nov 12, 2005

Last monday I couldn't log in on my Mac for some reason. Probably some StartupItem somewhere doing nasty things. I tried a lot of times, but no matter how hard I typed on the keyboard the OS just got stuck and I had to power it off and try again. Frustrating.

Only by booting up in Safe Mode could I log in, so I bought a Maxtor OneTouch II 200 GB Firewire harddisk for backup, booted the machine in Safe Mode, found out I had to use the USB interface for the Maxtor harddisk for some reason, and made a disk image of all of /Users and some other configuration files, figuring I could always create a new user and copy the data back to that users ${HOME}

After two frustrated evenings trying to restore, made even more frustrating by being uderslept and overworked because of a SAN upgrade at work which naturally had to happen at night, I finally succeeded.

One of the things I wanted to achieve by reinstalling was to convert from a case-sensitive HFS+ filesystem to case-in-sensitive HFS+ because I wanted to use FileVault to encrypt my homedir. FileVault doesn't work on a case-sensitive filesystem, which is completely undocumented by Apple, but painfully experienced by many users.

I had no idea how many Document/document pairs of files I had. Most of those files was created by software written by idiots (namely Microsoft Virtual PC, the worst money I've ever spent on software. Don't get me started on the networking stupidity of it.) under the assumption that when the file was initially created correctly you can always write to “File”, “fIlE” or “filE” and know it went to the right place. At least that's how I think they thought. And no, that's not how it works on case-sensitive filesystems.

Using find(1), tr(1), sort(1) and diff(1) I easily found the offending files, but my backup .dmg was read-only so I had to convert to a read-write version and remove the files and then copy /Volumes/Users/m to /Users/m from another user account with administrator privileges. Then I used NetInfo Manager to copy my temporary user to my normal “m” user and change UID & GID and recursively chown(8) /Users/m to m:m, save and reboot.

It's not that easy.

I had to boot from the installation DVD and fix the password for “m” and then everything worked, all my settings and my Keychain was restored and accessible.

Phew!

I clearly need to review this procedure, I especially need to learn more about NetInfo [PDF, 2 MB, 62 p.], and then I need to make full backups regularly now that I have the disk space for it. Right now I only have daily backups of the database used to build this weblog and my iSmartTrain training data.


Last edited: May 1, 2016


Categories: