If the data on your drive is important and you have not yet backed up the data, then the best thing to do is to send your drive to a data recovery professional. DriveSavers based in the USA is our recommendation ; they offer you the best chance of recovering data from your system and when your data is important working with a professional service from the start is important. Attempting to recover data yourself or letting someone less experienced may work. However, in the event that these approaches fail you could find that the data recovery has not only been made more expensive but it could now be impossible. If the data is important let the people with the most expertise try first!
Should you wish to try recovery yourself and if your HDD has failing bad blocks rather than some other hardware error then the following information should be helpful. This information in relating to OS X and a fantastic data recovery tool called ddrescue. A good place to start with ddrescue is the man page.
OS X specifies the disks within /dev as two different kinds. The first kind (example : /dev/disk1) is a buffered device. The problem with working with a buffered device is in some situations it may be slower, than having direct access to the device. This brings us to the second kind of disk device in OS X a raw disk (example : /dev/rdisk1). Accessing the raw disk will be faster for some operations. In particular when using ddrescue you will tend to see an improvement by using the raw device rather than the buffered device.
Example of using ddrescue to copy a volume to a temporary recovery volume :
ddrescue -n --min-read-rate=300 --force /dev/rdisk1s1 /dev/rdisk2s1 /path/to/mapfile ddrescue --force /dev/rdisk1s1 /dev/rdisk2s1 /path/to/mapfile
Example of checking how things are progressing :
ddrescuelog -t /path/to/ddmapfile
When using ddrescue on a partition like this it is important that the destination partition is at least as large as the source partition. Also, the directories for this partition will have all kinds of problems once the process completes (even if it finishes successfully) and you will want to perform a file level copy of all recovered data onto another partition before proceeding further.
On OS X systems, you should first try another file level restore tool such as Carbon Copy Cloner as it may be that the files located on bad blocks are not important to your recovery attempts. Using Carbon Copy Cloner or even just rsync will typically be faster than using a tool such as ddrescue. However, when needed ddrescue will make every effort to recover files from a drive with bad blocks.
Remember it is always best to have a backup than needing to resort to this kind of tools or approaches.