Friday, October 24, 2008

Switching to minimized windows with Apple-Tab

I finally figured it out after years of frustration when writing the previous article...
If you want to bring up a minimized window with the task switcher (Apple-Tab key combination):
HOLD DOWN THE OPTION KEY before LETTING GO OF THE APPLE KEY!
Oh my god, why isn't this the default instead of buried?!
Sigh.

Witch - better task switching

If you're annoyed with the way the Mac switches running programs with the key combination, look at Switch. It looks a little different but has one important feature:
IT MAXIMIZES DOCK-MINIMIZED WINDOWS when you switch to them.
Read a later post on how to do this without Switch...

Monday, October 06, 2008

When Time Machine fails: Seek-click-spindown-retry

My Macbook hard drive died recently. No warning - one minute fine, the next the familiar and nauseating seek-click-spindown-retry cycle I’ve come to dread. Dearly departed was a Seagate Momentus 120Gb 5400 RPM drive. What I didn’t know at the beginning was my Time Machine backup drive was faulty too.

My external half-terabyte drive stored 9 months of history as a Time Machine backup.

I’d googled for the restore process and it seemed painless. Just boot off the Mac OSX installer CD, System | Restore from Spotlight Backup and Voila - done!

Which of course, wasn’t how it went at all.

First, the hard drive. I live on the eastern US coast and my local Apple store would only replace the hard drive with one the same size as my original Macbook, a measly 60 gig or something. They would also charge $350 so I forgot that idea immediately - it’s easy to put it a new cheap 2.5” SATA drive although Apple won’t sell you one.

The only proviso: the hard drive bay is attached to the hard drive with Torx T8 screws - you’ll need the right screwdriver.

I bought a 320GB 2.5" Seagate Momentus 7200 rpm drive (finally, plenty of space) and got it installed. Insert Mac OSX 10.5 Leopard disk, reboot. I chose the menu option to restore from a Time Machine backup and after some playing around rebooting (it seems my internal drive wasn’t recognized straight away) I got to the restore process.

Time Machine started reading from the most recent backup, got to 30% and then the hard drive stopped reading, span down like someone cut the power then started back up again. The Time Machine drive had a mid-read hardware failure causing it to “reboot”. Of course, Time Machine couldn’t handle a violent read interruption and so gave the helpful “sorry, folks, reboot and try again” message.

What follows involved reinstalling OSX from scratch, then writing some ad-hoc bash scripts to get rsync to copy my home drive from the time machine backup disk to my new home directory. This needed to be done piecemeal as an iterative copy process to cater for the random drive brown-outs.

The script looked something like this:

#!/bin/bash

while [ "foo" == "foo" ]; do
rsync -av /Volumes/TimeMachineDrive/Backups.backupdb/My\ MacBook/Latest/Mac/Users/myuser/Photos/ ~/RestoreFolder
sleep 10
done

So rsync would just start where it left off after waiting 10 seconds for the drive to restart.

Although a broken drive isn’t Apple’s fault it would have been nice if the restore process could be a little more robust. I eventually got all my data back and replaced my defective Time Machine drive.

Kudos to Apple for providing an elegant folder-based backup solution accessible from the Finder and command-line. Without that, it would have made my life a lot harder. The scripts above were trivial to write.

The use of hard links by Time Machine is clever - it allows space to be used optimally and makes full use of the existing operating system resources and is fully backward compatible.

Sometimes Apple does things right - this is an elegantly engineered solution, even if they did give the GUI designers WAY too much leeway... gimmicky, much?

Monday, April 14, 2008

Upgrade to Leopard

I waited until 10.5.2 came out before getting the Leopard update for my old CoreDuo 20" iMac and my MacBook Pro both running Tiger. I wiped the iMac20 and installed Leopard fresh, but I upgraded the MacBook Pro because it is my work machine and I didn't want to mess with the system. A few days later my 24" iMac turned up; so I had iMac24 with preinstalled Leopard, iMac20 with a fresh install of Leopard and my MacBook Pro with upgraded Leopard.

Upgrading is a mistake. I highly recommend telling your Leopard update DVD to wipe everything off the disk and install fresh. My upgraded MacBook Pro was running like a police officer in love with jelly doughnuts; which is more of a waddle than running. The system was constantly accessing the hard drive, I had regular crashes in parallels and a number of kernel panics. There is something very deflating about productively using software only to have it all go away in a blink. I thought I had left that behind when I escaped the foul grip of Microsoft's Windows. This situation peaked at three incidents in one day, where I just spat the dummy.

Both my iMacs were purring along with their modern feline titled operating system, why not the MacBook Pro?! So I bit the bullet. After a session of Time Machine I reformatted the MacBook Pro with a fresh new copy of Leopard. Then I copied across my document files, pictures, etc form Time Machine. And lo, the system is better than it has ever been, the sky is bluer, grass is greener and the birds are singing.

I am unsure what exactly the problem was. I did have a lot of extraneous pieces of software that I was using or testing, but everything was functioning fine in Tiger and changed to a pig when I upgraded to Leopard. So if you don't want Pig-Leopard you have to wipe the slate; tell your Leopard install process not to upgrade but to wipe that ugly disk clean of the previous beast and grow your Leopard from scratch.

Monday, February 18, 2008

TrueCrypt for Mac released!

Finally, TrueCrypt, an excellent open-source encryption application, is available on the Mac!

You can download it here:
www.truecrypt.org

This is a highly recommended open-source encryption application and makes encrypted files available on Mac, PC and Linux.

Thank you TrueCrypt team!