It's still the little things. Even the famous Mac Boot Beep turns out to have a fascinating provenance and history, including the obligatory Steve Jobs anecdote one might expect. And, sadly, I've been hearing a lot of the Boot Beep recently.
My personal MacBook Pro is fine, indeed literally better than new since over the course of the last year I upgraded the hard drive and replaced the keyboard. My work MacBook Pro, on the other hand, since last Thursday plays the Boot Beep just great but apart from that does pretty much nothing at all. No display, no Apple logo, no sad Mac icon, not even a backlight on the display.
Not a problem, you'd think. Until the replacement arrives I can just use my personal laptop, right? That's true to an extent. Much of what I use for work (Gmail, Google Calendar, Google Docs, Google Sites, corporate directory) I can use on my personal laptop without getting on the corp network—but a handful of vital other things remain available only to trusted machines on the LAN. And to get on the corp network at Google one needs the necessary client certificates (stored on the hard drive). And naturally Google's policy is to encrypt all user data on laptop hard drives. The VPN software requires the same client certificates and anyway isn't to be installed on non-Google equipment. What's a switchy guy to do?
Enter a technique which seems like utter magic to someone still emerging from decades of Windows use.
- Step 1: put the apparently-dead work laptop in Target Disk Mode by holding down the T key while turning it on. Wait for the beep, wait another ten seconds, then release the T key.
- Step 2: connect home laptop to work laptop with a 6-pin firewire cable.
- Step 3: boot the home laptop while holding down the Option key. This will bring up the Startup Manager and allow you to select to boot from (incredibly) the work laptop's hard drive which is now mounted over Firewire.
- Step 4: boot working hardware (home laptop) from hard disk in broken hardware (work laptop).
- Step 5: enjoy the corporate Leopard image, complete with client certs, hard drive encryption, all my work stuff... running on my home machine.
This was a joyous moment. But wait: it gets better.
I used this configuration for a while this week to get some work done which needed doing on the corp network. Before long, though, I got to thinking. The work laptop is basically now just an external hard drive which I'm booting from... so why don't I just clone the disk onto an actual portable external hard drive and boot from that instead? I'd just been reading about using dd to clone a hard drive, so I thought I'd give it a whirl.
- Step 1: boot personal laptop from its own hard drive. Put work laptop in target disk mode (as above) and connect via Firewire.
- Step 2: plug the portable hard drive into the personal laptop. Now the personal laptop has two external volumes attached: the work laptop's drive and the portable hard drive.
- Step 3: determine which disk is which in terms of device nodes. In Terminal.app, run "diskutil list" (see the man page for more information about diskutil) and check the output. For me, the work laptop's drive was /dev/disk1 and the portable drive was /dev/disk2. You'll see what I'm talking about.
- Step 4: unmount the drive you're copying from. I used "diskutil unmount /dev/disk1". You don't want any background processes trying to write to the disk as you're doing a bytewise clone of it. Once you unmount it you've taken care of that
- Step 5: in Terminal.app, run "dd if=/dev/disk1 of=/dev/disk2 bs=100m". Make very certain that you've got the two parameters the right way around otherwise you're going to mess up your source disk.
And now you wait.
And you wait, and you wait.
And dd, inscrutably, just sits there doing its thing perfectly silently.
If you're anything like me, you're going to get impatient after a few hours. You're going to wonder what's going on and how much more time it's going to take. Is this thing working at all? Is it waiting for me to do something? Is there some "--verbose" option for dd which I should have specified? Do I really want to stop the thing from running, and lose the investment of these hours, to find out what's going on?
Don't stop dd from running. It turns out you can give it a nudge to get it to spit out its progress: in technical terms it responds to the SIGINFO signal. So press Ctrl-T in the terminal window (by default Ctrl-T sends SIGINFO to the foreground process) and after a few seconds dd will tell you where it's got to.
Prepare for disappointment. Throughput for me was a pretty crappy 2MB/s, meaning it'd take about 21 hours to complete the 150GB disk I was cloning; after three hours dd had copied only about 21GB. That's pretty terrible, especially for someone as lazy and impatient as me. I figured that there must be a better way, so I stopped dd and did a bit more research.
To cut a long story short, SuperDuper is the answer. It took about 90 minutes to complete and I ended up with a portable USB drive containing a clone of my work laptop's hard drive. I attribute the quicker drive-duplication time to a better raw transfer speed (perhaps transferring files rather than sectors allows for smarter caching and read-ahead at the filesystem level?) and also the fact that SuperDuper is only copying the actual data on the drive rather than including gigabytes of unused space.
And the happy ending is that booting my personal laptop over USB from the fresh clone (using the Startup Manager as above) works perfectly.
So now I've got a fairly portable solution which will keep me running until my replacement work laptop arrives. I can easily boot my home machine either from its internal hard disk or from the corporate Leopard image (complete with client certificates and encrypted home directory) on my external USB drive.
As a footnote, it's worth noting finally that I was in fact offered a loaner machine to tide me over until the replacement MacBook Pro arrives. They only have IBM ThinkPads spare, though, and I don't think I'm ready for the... ahem... switch.
More next time.