Wednesday, June 24, 2009

Switching Checkpoint

OK, so now we've recapped and closed off a previous two-parter, it's probably worth quickly taking stock of the current switching situation. The "switch sitch", if you will.

A previous post laid things out neatly in terms of three "things I like" and three "things I'm struggling with". On reflection I think this is actually a serendipitously powerful technique for measuring where I've got to with the Mac: the subtlety (or not) of the issues corresponds to the depth of my current concern; the severity corresponds to my overall happiness or otherwise.

So without further ado, things I like:

  • even though I'm far from a Unix guru or expert, I'm beginning to enjoy the Unix-ness of OS X. I like the transparency of the innards of the platform very much. In a similar spirit, MacFuse is fantastic.
  • multiple monitor support in the OS seems to work beautifully in a way I could never achieve with Windows. I plug the MacBook Pro into my LCD at work and it remembers that the laptop is on the right and the external monitor is the primary display. I plug it into my monitor at home and it remembers that the laptop is on the left and the external monitor is the primary display. I plug it into a projector at work and it remembers that the laptop is on the left and is the primary display. It works exactly how you'd want it to.
  • Growl. This as far as I'm concerned is background real-time notifications done right. It is a sleek Smart Car to the Windows notification bubble's Model T. I like Growl a lot, and I especially like that now I have it I find that software I'm already using (Aperture, MarsEdit, last.fm, Spotify) just picks it up and starts using it. Great stuff.
but there's stuff I'm struggling with too:
  • the insanely unpredictable and useless "Zoom" buttton (the green blob at the top-left of a window). In any given situation, with any given window, I can never tell in advance what clicking it is going to do. I just clicked it in Safari and the window grew about 50 pixels to the right. I clicked it again and the window grew about 50 pixels to the left. WTF? Want to maximize your iTunes window? Click the green button... but no! In iTunes, "zoom" apparently means "become miniature". That's fucked up.
  • although the OS does multiple monitors really well, application support is scarce. I'm forever rescuing application windows from remote corners of the screen because they're trying to be on a monitor which has been disconnected. Tweetie For Mac, I'm looking at you in particular right now.
  • Spaces is a real mess. They did fix a bug in a point release of Leopard where switching to one space and then back again would change the z-order of all your windows... but still: I can't tell you how many times I've found I can't interact with an application in Space n because it's displaying a modal dialog in Space m. Lame.

Next time: some essential utilities for survival in Mac-land.

Monday, June 8, 2009

The Big Idea

A quick recap. I first used Microsoft Windows 20 years ago.

  • 1989: summer job developing DOS software and poking around with Windows 2.0
  • 1991: contract work porting DOS software to Windows 3.0
  • 1994: hand-coding Windows Metafile generation in Windows 3.1
  • 1997: investment banking IT: the joy of Lotus Notes on Windows NT 3.51
  • 1998: different investment banking IT: developing and deploying ASP/DHTML applications on Windows NT 4
  • 1999: part of the Internet Explorer early adopter program; attended the IE5 launch in London
  • 2000: internet bubble: designing and managing server-side Java on Windows 2000 Server
  • 2001: picked up my launch copy of Windows XP at PDC in Los Angeles
  • 2004: telco innovation: market-trialing telecoms services deployed on Windows Server 2003
  • 2005: shark-jumping: early adopter of the most ridiculous Windows-based server product ever
  • Feb 2008: retirement of my home Windows desktop; purchase of a MacBook Pro
  • Apr 2008: switched at work from a Windows-running IBM ThinkPad to a MacBook Pro
I started this blog with the idea that I could write about one man's attempt to switch from Windows to Mac after a deep history and familiarity with the former. I could share experiences, gotchas, workarounds, joy, sorrow, rejoicing and cursing. I knew it would be a journey worth documenting, and indeed it was. Moreover, I thoroughly regret not having documented it.

But perhaps instead I could tell the same basic story but with the twist of starting from the year-and-a-bit-in point. At this stage it's less about the perilous leap over the wall and more about a different and deeper experience: learning to be a Mac power-user having been a Windows power-user. To me that's a much more interesting story in any case.

I know it sounds a bit suspect; bear with me. If it doesn't work out I'll maybe just put the switchy.net domain on ebay and forget it.

Thursday, June 4, 2009

...and, thirteen months later - Part II

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.

Inscrutable dd
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.