Hard drive failing - how to get my data off?

My WD Cloud is failing. I don’t have a backup of the data, so I need to do a backup first.

Problem is… I can only access the WD device for ±20 minutes after I yank the power cable and reinsert it. Is there a way that I can back up our data and photos first, before we try to reformat and reset the device?

Here’s am example of the email from the device:

Following events are generated on your WDMyCloud Morpheus.

Event title:File System Check Failed

Event description:File system check has detected errors on your configuration. Backup your data and recreate your drive configuration to resolve these errors. If problem remains, contact WD Support.

Severity:warning

Event code:0036

Event time:05-06-2020 07:18:52 AM

Firmware version: 2.31.204

Do you have a linux machine handy?

Since the drive in your mycloud is on death’s door, you will likely be looking for a replacement anyway, which means opening the unit up and removing the drive sooner or later anyway.

Might as well be sooner.

If you do not have a linux PC, then I would suggest getting a linux distro you feel you might be able to work with, and building a Live USB stick to boot your existing computer on.

The tool you need is called DDRescue. It is free, but needs to be pulled through a package manager in most cases. It is a more aggressive binary raw sector copier based on DD, which retries repeatedly until it gets the data from a bodged up area on the drive, then continues, automatically.

While you CAN use it to straight up clone your existing drive (that is failing) to a wholly new drive straight up, I would suggest recovery to an image file, then once you have that image, using something like testdisk to recover the files from inside the image back out onto the freshly prepared replacement drive (after following the appropriate debrick procedure for your unit).

So-- you will need:

Linux PC (or live USB stick)
ddrescue
A drive bigger than your NAS’s disk drive to store the image file on
The failing drive from your NAS.
(optional, but useful-- USB3->SATA adapter)

Start linux, then install ddrescue with the package manager if it is not already installed. For Ubuntu (eg, debian flavor) derivatives, (Mint, ubuntu, xubuntu, lubuntu, etc) you would do that with apt.

sudo apt-get install gddrescue

Then, identify which drive is your failing drive. You can interrogate attached drives with hdparm -i

eg,

sudo hdparm -i /dev/sda

Do that for every disk linux sees, until you find your failing disk.

Once you do that, and you know which one is failing, determine the mount point for the drive that will be hosting the image file. This is easily enough done by calling mount with no options.

mount

Once you have all that information, invoke ddrescue.
example:

sudo ddrescue -A /dev/sdc /mnt/sdb1/nas_backup.img

(Where /dev/sdc is the failing disk’s ID, and /mnt/sdb1/nas_backup.img is the location and file name we are using for the resulting disk image). The -A argument stands for “Try Again”. It tells ddrescue to try failed reads over and over and over again until it gets them, even if the drive stalls and needs its power cycled.

Once you have the image file created, you can use something like testdisk to recover the files from the image.