The personal website of Matt Henderson.
30 May 2003
Earlier this week on Monday, my Powerbook’s hard drive began making odd chirping sounds. By Wednesday the chirping had degraded to thumping, and on Wednesday night the disk died. Fortunately, due to an external mirror that I maintain, I was quickly up and running with almost no data loss.
In order to maintain this mirror current, I run a script from cron each night that mirrors my startup volume to the external Firewire disk. This script was generated by Carbon Copy Cloner. During the day, I run another script, every two hours from cron, that uses on psync to mirror my /Users/ directory to the mirror:
#!/bin/bash
# The following variable holds the name of the target volume
NAME=TiBookMirror
PART=`diskutil list|grep $NAME|awk '{print $6}'`
if [ -z `ls -1 /Volumes/ | grep $NAME` ] ; then
exit 1
else
if [ `file /dev/$PART | awk '{print $2}'` = "block" ] ; then
/usr/local/bin/psync -d /Users/ /Volumes/$NAME/Users/
else
exit 1
fi
fi
A failure of the startup disk then can result in a maximum of two hours of lost work.
In my case, after the TiBook’s drive died, I booted from the external Firewire mirror (hold the option key down at boot, to get a list of available startup volumes.) I ran from this mirror until my new drive arrived. Later, installed the new drive, booted from the mirror, quit all running applications, and used CCC to mirror the mirror to the new internal drive. Shutdown and started from the new internal drive. Smooth as silk.
A few random notes (for myself, should this happen again):
Buy Disk Warrior 3. Apple Disk Utility isn’t sufficient to repair seriously damaged disks.
Don’t lend your Torx 8 screwdriver to anybody
Enrique Tous (+34 915445660) at Multiple Zones España is very fast at shipping out a new Powerbook drive. I had a new 60GB drive delivered to my house the next day for 229 Euro (excluding VAT).
Don’t forget that subvolumes defined in Retrospect are not path based, and will get screwed up when you install a new disk. You have to go back and redefine those subdirectories, and update any Retrospect scripts that reference them
Be careful about using fsck -y from the command line. Doing this made the damaged drive disappear (not even appearing any longer in the volume list). I noticed that when you run Disk Utility, and do a ps -aux | grep fsck, that DU is actually running fsck-hfs in the background to do the work. First time I’ve heard of “fsck-hfs” Should we as Mac OS X users be using that instead of fsck? |
Enjoy this article? — You can find similar content via the category and tag links below.
Questions or comments? — Feel free to email me using the contact form below, or reach out on Twitter.