First off, you probably want to make sure the you don't have the click of death. This is repeated clicking/knocking noises which indicate a head crash on you hard disk (or some other catastrophic failure). If you have this, you may want to consider taking the drive to a specialist depending on how important the data is. You can try Recovering data from a damaged hard-drive: the "freezer trick", but at some risk.
As for tools that you can use, Arch has a great wiki on this. Not all of the tools will work with HFS+ though (I'm assuming that is the filesystem you have). To summarise and add some extra:
- You probably want to start with a tool like
ddrescue
or dd_rescue
. You could try them first by mounting your drive read only and then using them on particular files you want to recover. Alternatively, it may be safer to make a copy of the full disk. If there are bad blocks, these tools will use progressively smaller reads to get as much of the data as possible and also retry the affected area a number of times. Last time I used them the GNU offering (ddrescue
) was the more advanced of the two. There is also myrescue
which is currently beta software, but focusses on non-damaged areas first unlike the first two.
- If you have a corrupted filesystem you can install
hfsprogs
and use fsck.hfsplus
to try to look for damage and repair it. It may be wise to make a full backup of the filesystem before attempting any repairs though as this may do more damage. If there are no issues with bad sectors, just use dd
to make the copy.
- Depending on the types of files you want to recover, you can look at tools like Foremost, PhotoRec and Magic Rescue. These scan the disk surface and look for data relating to particular file types before trying to restore the file.
Another question which may be relevant here is How to repair a corrupted HFS+ partition from a damaged hard-disk?.