August 21, 2005
Xcopy

Last night I got one of those phone calls that computer saavy people hate to get. "Honey, I think my computer is broken. Your father is looking at it, but it says something about reformatting a hard drive."

Yes, my mother's hard drive was failing. They got me the computer and this morning I took a look. Sure enough, the drive wouldn't boot or allow itself to be repaired.

I popped it into my computer to look at it and even then I had trouble getting it recognized. When I finally got it mounted I realized it was in sad shape.

The problem was that some of the files were corrupted and others were fine. I was trying to copy files off of the bad hard drive onto a good hard drive. The problem is that with the drag and drop copy feature in XP, if any of the files you requested copied are bad, the whole copy crashes.

This really bummed me out since I was getting very little copying done due to the bad files. I remembered about Xcopy and figured out a way to copy all the files I needed easily.


How to copy directories with bad files and get the good files

Xcopy is used from the command line, so you need to open a command window. Use Run from the Start menu and type 'cmd', this should bring up a command line interface. That xcopy link takes you to the full manual on xcopy where you can see all the parameters possible.

Xcopy is pretty straightforward, xcopy sourcedir destinationdir is the normal command. But since you know you are copying possibly bad files you need to set a few parameters. The /c parameter tells xcopy to ignore errors. This is key.

So if you want to copy the files out of a bad My Documents directory to a new drive, you'd do something like this.

xcopy "D:\Documents and Settings\User\My Documents" "C:\Saveddata\" -c -s -h -i

This example supposes that the bad drive you are salvaging is the D: drive and the drive you are saving to is C:. You can use tab to autocomplete path names to make sure the path is correct.

Remember, if your directory name or any part of the path has a space in it, you need quotes ( " ) around the path. If you don't use quotes you will get an invalid parameter error. You will probably want to save several different directories, depending on where the data is located, so you can open multiple command line windows and run the xcopies simultaneously if you want to not sit and watch.

When xcopy hits a bad file, don't be suprised if it hangs on the bad file for a minute or two before moving on. Have faith. The xcopy will ignore the errors, because you commanded it to ignore them.

If this isn't clear to you and there are things you don't understand about what I wrote above, you probably shouldn't be trying to save the drive data yourself. Honestly, if you aren't command line saavy, you run the risk of seriously fucking up your computer with xcopy. Call your best geek pal and offer him or her a six pack to come save your data from /dev/null.

Back to my own experience, I was able to save most of Mom's files, the only real blow was a corrupted Outlook pst file meaning that some of her email was gone. I picked a new drive at Best Buy and in a few hours, the computer was up and purring with a sparkling new version of her beloved AOL 9.0 running. The OS patching, anti-virus, and anti-spyware are all set to auto-update. Let's hope for the best.

Posted by michael at August 21, 2005 10:00 PM



Comments

Don't hope for the best. Get the best. Get her an iMac. She can still run AOL, and you can kick that anti-virus/anti-spyware stuff to the curb.

OSX r0x0rz.

Posted by: BillB [http://squidly.com] on August 22, 2005 6:22 AM

Last time I checked, Macs still used hard drives. It's the hard drive that failed, not an attack from malware.

At least I didn't have to take her computer to a 'Genius Bar' and had it over to some person in a black t-shirt for a few weeks.

Posted by: Michael [http://cruftbox.com] on August 22, 2005 8:34 AM

Served. Served. Served. Served.

Posted by: LittleKenny [http://littlekenny.com] on August 22, 2005 6:11 PM

This failure was not due to an operating system choice between OSX and Windows. It was directly due to the type of filesystem that was being used. If this installation of Windows used ufs then this problem most likely would not happen.

So as far as filesystem choice is concerned, I would recommend any desktop that supports ufs with journaling as the best way to go in the future.

Try this one.

Posted by: Yoshi [http://www.oblivitor.com/] on August 22, 2005 6:34 PM

Thanks for fixing my computer Mike. As you can see, it is now working. I will have to get used to the new look of things. They are somehow different. Not bad different. Everything just looks way bigger.

I do like BillB's suggestion though. The hard drive on my ancient Mac is still chugging along. :-)

Posted by: Mom [http://momonthealert.com] on August 22, 2005 7:05 PM

I wasn't commenting about the hard drive. I was commenting on your installation of anti-virus, anti-spyware, and AOL 9.0, so hold up on the pronouncements of "serving"... ;)

As an aside, it's dead simple to replace the hard drive on an iMac. No need to trudge to the "genius bar" if you don't want to.

Moreover, if you have two Apple machines, you can boot from the functioning computer using a firewire cable attempt to extract your files from the struggling Mac. It works like a dream.

Apples suck for gaming right now, but it doesn't sound like that's what your Mom does. For everything else, they pwn all over PCs.

Posted by: BillB [http://squidly.com] on August 23, 2005 9:53 AM

Oh, and based on your mom's comments about how everything "looks way bigger", it sounds as though you need to adjust your resolution.

Posted by: BillB [http://squidly.com] on August 23, 2005 9:54 AM
Post a comment