If you are ever in a situation where your hard drive is about to fail, the first thing you should do is make a clone of the failing drive ASAP. The quickest (and arguably the easiest) way to do this is within your favorite Linux instance without having to install any fancy tools. When you clone a failing drive, you literally copy that drive byte for byte onto another drive. Once cloned over to the new drive, you can then access your files freely.
But what if your drive has already failed? Same technique. Just because you can't access the files within Finder (in Mac) or File Explorer (in Windows), doesn't mean the files are not there. You would clone the drive the same way and copy everything over byte for byte onto a new drive. If all goes well, you should now be able to access those files from the new drive.
The technique below walks you though cloning a drive within Linux using dd command to clone the drive. dd is a powerful UNIX utility, which is used by the Linux kernel makefiles to clone data, among other things. Only superuser can execute dd command, but that is as simple as adding sudo to the command line functions.
WARNING: While executing dd commands, if you are not careful and do not know what you are doing, you WILL lose your data.
To clone an entire copy of a hard disk to another hard disk connected to the same system, execute the dd command as shown below. In this dd command example, the device name of the source hard disk is /dev/hdsource, and device name of the target hard disk is /dev/hdtarget.
# dd if=/dev/hdsource of=/dev/hdtarget