I recently had my iBook hard drive go bad, rendering the machine unbootable. The file system was corrupt, but booting the machine in single user mode revealed that large amounts of data were still recoverable. Problem was that I could not burn these to CD in the single user mode (
hdiutil threw a bus error, probably due to the file system corruption), and network services would not start. Thus, the data was there, but I could not salvage it to a safe location. Also, attempts to run disk repair from CD or
fsck manually from the command line were unsuccessful, as the filesystem was already sufficiently hosed.
I then proceeded to boot the iBook as a FireWire Target Disk (by pressing T upon power-on), hooked to a G5 iMac, but alas, the iBook disk would not display itself in the Finder. Analysing the system logs showed that mounting attempts were unsuccessful due to the iBook's hard drive not passing file system check. On the iMac's command line, however, I managed to mount the half-broken iBook disk successfully by taking the following steps:
- Create a mount point for the iBook by typing:
mkdir /Volumes/iBook
- Mount the iBook disk in read-only mode by typing:
mount -t hfs -r /dev/diskXXXX /Volumes/iBook
The -r argument forces the disk to be mounted as read-only. Replace the XXXX with the designation of the target disk on the host machine, e.g. by looking at the FireWire devices in About This Mac.
To my surprise, the disk mounted without complaints, and I was able to salvage large amounts of data -- as long as I kept out of the directiories that were most damaged. All important data is now safe, and I am shipping the iBook to Apple under warranty. I hope that this hint might prove useful for anyone that experiences a hard drive failure and partial filesystem corruption.