Apple Mac OS X and input/output errors while copying a file

My wife's Parallels broke today. For some reason it just died when starting up - no matter what mode we tried to start Windows XP in. We tried repairing Windows XP by means of the installation CD, but this caused even weirder errors.

So I ran a Disk Repair and Permissions Repair - neither working.

I then decided I am going to try and upgrade the disk image to the latest Parallels - 3.0. Well, whilst copying the .hdd file this happened:

karin-nells-computer:~/Library/Parallels/winxp karin$ cp winxp.hdd winxp_backup.hdd
cp: winxp.hdd: Input/output error

Hmmm.... Bad sector? So my mission started to find a utility that can (a) find bad sectors, and (b) relocate them. This was necessary since both Finder as well as cp failed with an IO error.

I looked at TechTool Pro 4, but alas, just as I was about to purchase it I discovered it is only available as a shipping product - not a download. Bummer.

Next I looked at DiskWarrior - this seemed like it could do the job so I paid $115 for it, and downloaded it. Running it on my laptop with the iMac in firewire target disk mode, I rebuilt the directory structures but it did not fix anything. Damn - $115 wasted.

(PS: I needed to recover her Parallels image since all our accounting information is stored in QuickBooks for Windows).

I found a trial of Drive Genius - and ran the surface scan. About 1/3 way through the disk it started picking up some bad sectors - so at least now I confirmed this. But it cannot do anything with those bad sectors. By now I was getting desperate.

I googled some more (this is now after about 10 hours on/off searching for solutions) and found a solution. A free solution too!

The idea is simple - I want to copy the Parallels disk image to a new area on the hard drive where there are no bad sectors, and I am willing to sacrifice the couple of bad blocks causing all this trouble. So by using

dd if=winxp.hdd of=winxp_copy.hdd conv=noerror,sync

I managed to copy the file with 10 bad blocks filled with NUL bytes - a fair compromise.

PS: dd is a standard Unix utility for copying raw data blocks.

I started up Parallels - ran through the automatic NTFS check at startup and only lost 10 files - all which are replaceable.

Blog Categories:

Comments

Had a similar problem with the set of files needed to use a VMWare Fusion VM -- aggravated by the way Time Machine silently skips these 'Input/Output' errors on backups, so they can linger (and result in many backup editions all missing the critical file) without being discovered. Whole sorded details are at another blog where I left details -- http://jasonnash.com/2009/07/22/protecting-your-vmware-fusion-vms-with-t... -- but your reminder of the capability of 'dd' to skip the error and get as much of the file as necessary helped me recover what I could. (Maybe, a zero-length file with the right name would have been enough in my case, for at least partial recovery, but grabbing everything but the bad blocks seemed better.)

So this is both a 'thanks' for leaving the pointer to 'dd' as a workaround here, and a pointer to my other account of recovery, in case it helps some future searchers...

Pages

Add new comment

Back to top