Filed under: TUAW Tips
TUAW Tip: What to do when a disk goes bad
We've all been there. The external disk you bought three or four years ago, which has been working great so far, starts to click. And it's not a good click ... it's the kind of click that gives you the spinning beach ball of death.
Poopie.
Sounds like it's time to get the data off that disk, and toot sweet, if you pardon my French. You buy a new disk, and you start copying. But then what happens? The Finder throws up an error saying it can't copy a certain file or folder, and it's 20 folders deep in an old archive of client data. The Finder stops the copy, and you have to figure out where the problem is buried, fix it, and try copying again. Meanwhile, seasons pass, civilizations rise and fall, and your fingernails start to grow into your keyboard.
Double poopie.
So what do you do? Believe it or not, the Terminal can be your friend to quickly copy damaged data, and power through disk errors. The data may still be damaged, but heck if it won't try to copy it somewhere safe.
After the jump, find out how to recover your data, and fast.
The first thing to do is don't panic. There are always ways to recover data, and chances are your data is safe. What we'll do is try the simplest options first, and go from there.
Step 1: Do you have a good backup?
No? Well, I'll save my tut-tuts for the end of the article, and you can move on to step 2. If you do, sometimes the easiest option is to restore data from your backup, rather than trying to recover a damaged disk. Of course, replace the damaged disk as soon as you can, and restore your backup to the replacement.
Step 2: Get the disk to mount
First, we have to connect the disk to the computer to do anything to it. If the disk won't mount, the first thing to do is turn it off, disconnect it, and let it cool off. If it's warm to the touch, be patient. Go get a coffee or make a sandwich. Then try again.
If the disk still won't mount, then you may have a different kind of problem. If it's an external disk (like a USB or FireWire disk), then you may have trouble with the enclosure and not the disk itself. For example, one of the ports might be bad, or the power supply could be shot. If you don't mind voiding your warranty, you can crack open the enclosure and see if you can get the disk itself to mount by installing it directly in a computer (like a Mac Pro or G5 tower), or in another enclosure.
If the disk is inside a Mac, and not external, you can try booting the bad Mac into FireWire Target Disk Mode (TDM). To do that, connect a FireWire cable from the bad Mac to a known good Mac. Then, shut the bad Mac down, and start it up with the T key held down. The bad Mac's damaged disk should (hopefully) show up just like an external disk in the good Mac's Finder.
If it still won't mount, see Dire Circumstances below.
Step 3: Buy or find a replacement disk
You will need a spare disk to copy your data onto, so you'll either want to buy or find a disk that is at least the size of the damaged disk. With external disks, it's good to find a replacement disk that's the same connectivity type as the damaged disk: that is, buy another FireWire drive to replace a damaged FireWire drive. Typically, file copying is a faster when the disks connect to the computer the same way.
You'll want to format the replacement disk the same as your damaged disk. So, for example, if your damaged disk is formatted as HFS+ (Journaled), you'll want to erase your replacement disk with the same format. You can use Disk Utility (located in your /Applications/Utilities folder) to do this.
Step 4: Get yourself some Terminal love
With the damaged disk and the replacement disk connected to your computer, start the Terminal. (It's located inside your /Applications/Utilities folder.)
Let's talk a little UNIX first. As far as the Terminal is concerned, external disks connected to your computer are "folders" inside the /Volumes folder on your computer. Crazy, I know! But we'll have to play its little game to get your data safely copied.
So, for our example, let's say your damaged disk's name is Bad Disk and your fresh, formatted, empty replacement disk is named Good Disk. You also must be an administrator on the computer. Cool? Then we're ready to go.
In the terminal, type:
sudo cp -r "/Volumes/Bad Disk/" "/Volumes/Good Disk"
and press enter. When asked, enter your administrator password.
Make sure to add a trailing slash after the name of the source disk, and omit the slash after the name of the target disk.
For those wondering, typing cp -r "old/" "new" will copy the contents of the folder "old" into the folder "new." cp -r "old" "new" will copy the folder "old" inside the folder "new." Also, using the quote marks around the folder names helps if you have spaces in the names of your disks or folders. You can just as easily omit the quote marks, and put a backslash ( \ ) in front of every space in your path to make sure it works.
Or, you can try the excellent Carbon Copy Cloner, which puts a nice user interface on this process. The only downside is that you have to babysit the computer as it copies files. Carbon Copy Cloner will present a dialog when it encounters a disk problem, giving you the option to proceed, or cancel the copy. Using the Terminal method just assumes you want to proceed, so you can go on about your business.
Now, it's just time to sit back and wait. Depending on how much data you have on the disk, it could be minutes or hours until your data is finished copying. If there are errors during the copy, the Terminal will display the errors and the files they occur in, but will continue copying until everything is transferred over. You'll know it's finished when the Terminal presents you with a new command prompt.
Take heart! The hardest part is over. The files it mentions may be damaged and unusable, but at least the rest of your data is safe. At this point, with a good copy of (hopefully) everything, you can try and run a disk utility to try and recover the damaged files.
Step 5: Run a disk repair utility
Running disk repair utilities always comes with the risk of data loss. (It may be slim, but still -- this is your important data we're talking about.)
Your Mac comes with a fair-to-middling disk repair utility, called (strangely enough) Disk Utility. Try selecting the offending disk in Disk Utility and clicking Verify to see if it can find any problems. You can try clicking Repair to see if it can fix any damage found. Chances are, though, if you're hearing clicking from your disk (or other strange noises), it's a physical problem (rather than a logical problem) that a disk repair utility can't fix.
You can also try running other utilities like DiskWarrior, TechTool Pro, or DriveGenius to repair the disk. I know people who swear by each of these utilities, and DiskWarrior has gotten me out of several sticky situations. With a safe copy of your data already in hand, however, you can feel safer about risking data loss to recover any remaining damaged files on the disk.
Step 6: Profit
Hopefully, you've recovered everything you can, and what you can't recover you can live without. Congratulations! If that's not the case, however, we have what we like to call a dire circumstance.
Dire Circumstances
If the disk won't mount, or you still need to recover a file that cannot be copied thus far, you'll probably need to contact a professional. Data recovery professionals can sometimes come to your location for an hourly fee, and perform much the same tasks we just performed in steps 1 through 6. Alternatively, you can send the disk to a data recovery laboratory, like DriveSavers or Iomega Data Recovery.
These options are all very, very expensive. Professionals can charge hundreds of dollars an hour to visit your location. Data recovery labs can charge upwards of a cool grand in recovery fees, replacement disk costs, and shipping. I had to have a 750GB disk recovered in February, and it cost me nearly $1,600.
Even so, your data is recoverable. It's just a question of how much that's worth to you.
The Moral of the Story
If there is a moral to this story, it's that good backups will not only save you time, but possibly large sums of money. Mac OS X Leopard makes this ridiculously easy with Time Machine, so long as you can connect your computer regularly to an external disk. There's no excuse anymore for not having a good backup.
Unfortunately, it frequently takes people a significant data loss experience to learn that lesson. Take it from me, kids, I had a long list of better things to spend that $1,600 on.
Full Disclosure: Iomega, a manufacturer of external hard drives, was a client of mine from 2002 to 2007. Many thanks also to , an Apple Authorized Repair Specialist, for his expert help with this article.
Get a WordPress.com Blog
![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 3)
John said 5:20PM on 6-25-2008
As long as you're talking Terminal, you really should mention rsync.
rsync will mirror a folder with the least amount of copying necessary, and is more robust in the event of failure. (E.g., halfway through your copy, if folder X won't copy because it's corrupt, you can always rerun rsync with --exclude--and you don't have to recopy all of your files.)
In many ways, rsync is the mother of all backup tools.
Reply
Robert Palmer said 5:24PM on 6-25-2008
Using cron and rsync (or Carbon Copy Cloner, which uses rsync) as a preventive measure is a great backup strategy. Other tools like SuperDuper are perfect for this, too.
brian said 9:42PM on 6-25-2008
And for God's sake, if you're using cp or rsync*, USE THE "-v" OPTION--that means "verbose" and it'll SHOW you which files it's copying so you know what the hell is going on. Much better than staring at a mysterious terminal window and having absolutely no clue if you've got 10 seconds or 10 hours left.
Overall, this TUAW post is a start, but spend some time searching--there are a MILLION pages out there about recovering data from the command line.
And as for rsync and cron, that's ALMOST great, except it STILL doesn't handle two-part Mac files (resource & data forks) well. Luckily we have Time Machine. I love 10.3, hate 10.4, and hate 10.5 even more, but Time Machine makes it worth switching. (And I'll admit I've gotten used to quick look and coverflow in the Finder, but I still hate Spotlight and the new Dock.)
* I recommend rsync--among other things, it'll keep the file's ORIGINAL date created/date modified info.
Gerrit said 1:40AM on 6-26-2008
rsync is weapon of choice. The -v option, and then '>>' it to a logfile with the (daily unique) name "backuplog$Date.txt" where Date=(`date +"%b-%d-%y"`) makes a backup FUN. Insert the time at the beginning and end of the log-file and and you can see if and when backups take up much more (or less) time.
Ah, backups, more people should do it :)
Robert Palmer said 10:37AM on 6-26-2008
@brian: The reason I didn't recommend verbose mode was to make it easier for subsequent steps of the recovery -- it's simpler to just have a list of the files that _didn't_ copy if you don't have to scroll through thousands and thousands of files that _did_ copy.
w00t said 5:24PM on 6-25-2008
You forgot the free data recovery option: Freeze the drive.
I mean literally FREEZE it, in the Freezer :)
You'll be amazed how many dead drives will spring back into life for long enough to copy your data, worked perfectly for a dead seagate that wouldn't spin up for me a couple months back :D
Reply
Robert Palmer said 5:27PM on 6-25-2008
I would just caution people that condensation + electricity AFTER you take the drive OUT of the freezer can damage sensitive electronic components. It's much safer, though slower, to let a drive cool off naturally.
w00t said 5:33PM on 6-25-2008
Yes the condensation is a problem but a zip-loc baggie does a pretty good job at avoiding that.
As far as letting it just cool off is concerned, it has to be *really* cold like -10c for this to work. It's not related do a drive overheating, the extreme cold makes the internal components shrink slightly which lowers the tolerances, which is why once the drive has warmed back up it's very likely to fail again.
This is a one shot last resort kind of fix :) (although if you don't get enough time to copy it all a second or third freeze should get you finished)
geodee said 8:29AM on 6-26-2008
I just figured out the same thing on my own yesterday, coincidentally enough. I was worried about condensation INSIDE the drive its self, so I pulled the board off and just put that in the freezer. It failed again after a half hour, but freezing it again helped me pull the rest of the data off.
Michael Rose said 10:50AM on 6-26-2008
I'll vouch for the freezer trick. About 60% of failed drives will come back long enough for some amount of data reco. Just be careful of condensation as Robert suggests. You can even put an entire laptop in the freezer if necessary.
Peter Zich said 5:29PM on 6-25-2008
I had a 2TB RAID (4 500GB drives) die on me, I think Drive Savers was going to charge me ~$8000.
Reply
Rob said 6:04PM on 6-25-2008
These are all good recommendations, but I think before sending it to Drivesavers, it's a good idea to try Prosoft's Data Rescue II for Mac. It mounted a previously unmountable drive and recovered a more than decent amount of data for me, and it really saved me when it was crucial. It's a bit expensive, and takes a long time to do its thing, but it's one more stop before a real "Dire Circumstance".
Moral: I have a backup drive now, but I'm holding on to my Data Rescue CD just in case...
Reply
Alex said 9:45PM on 6-25-2008
I second using Data Rescue II (http://www.prosofteng.com/products/data_rescue.php).
I work at an Apple authorized repair facility and a lot of what we see are dead hard drives. I had a drive today that would barely mount—I had no hope of getting any data off of it and had already told the customer not to get his hopes up—and Data Rescue had no trouble with it. The drive was showing a lot of red text in Disk Utility and had about 50 bad blocks shown not 5 minutes into Tech Tools diagnostic.
Scott said 6:22PM on 6-25-2008
Just recovering from the midwest floods. Two external RAIDS sitting in flood/mud waters for 3 days.
DriveSavers estimate to recover both drives: $12,000
Yeah, not kidding. The crusty things are in their hands, and i'm waiting to hear back if all the data was recoverable.
Reply
Kyle said 6:23PM on 6-25-2008
There is also Totus Copy (www.dragonforged.com/totuscopy.htm) which provides a safer and more effective method to the terminal command, as well as a GUI. Although it is not freeware it cost $20, but there is a free demo available.
Reply
Matt Dale said 10:55AM on 6-26-2008
Props to Totus Copy. I'm an Apple Certified Desktop Technician and use it all day long to recover data from failing drives. It will even work in conjunction with drives mounted in DiskWarrior's recovery mode.
Frank said 6:47PM on 6-25-2008
not trying to be a douche (er, speaking of french) -- because your point was still understandable -- but just so you know for future reference, the proper french for that is "tout de suite". we tend to have mushed it and mangled it a bit on the english side of things.
Reply
Robert Palmer said 7:04PM on 6-25-2008
It's far more entertaining, however, for me to type "toot sweet" instead of worrying about accuracy. ;)
(And I think I've earned that right, après cinq ans de français en école.)
Frank said 7:11PM on 6-25-2008
understood.
(moi, aussi!)
Mitch said 6:49PM on 6-25-2008
What about DD? couldn't you just copy everything sector by sector?
Reply