WD My Cloud Data Recovery

Ok, I have successfully statically compiled Testdisk and Photorec. They appear to be working.

I pushed them to my Google Drive here, along with the source tarball (for GPL compliance.) Since it is statically linked, if you wanted to compile it yourself you would need to get all the necessary library sources too, but meh. Not doing it. The sources are available from the usual places.

These were compiled for use on a gen2. They might also work on a gen1, I dont know for sure though.

https://drive.google.com/drive/folders/0B0EsuN03YHarLUlrbGV1cXdxSnM

To use:

  1. Copy the tiles Photorec and Testdisk to a USB stick, then plug it into the MyCloud on the back.
  2. Start an SSH session with the MyCloud
  3. at the ssh prompt:

df

this displays the information about mounted filesystems, including the USB stick you just plugged in. Make note of where the USB stick is mounted. We will call this location [USB_mount] from here on. It will be unique to your system.

cd /mnt/USB/[USB_mount]

This changes the directory to the USB stick.

ls -ll

This lists the files on the stick, and shows permissions. Make sure that Photorec and Testdisk are present, and that they have the e(X)ecute permission set for root user.

./testdisk

This starts testdisk from the local folder.

  1. Unless you want there to be logged diagnostic information about the session, choose no logging.

  2. Select /dev/sda as the drive to mess with.

  3. Select GPT partition type.

  4. Choose [Advanced] Filesystem Utils

  5. Use the arrow keys to highlight parition 2 (waaaay at the bottom), and use the left and right arrow keys to navigate to [List]. Press Enter

  6. A file system tree of the internal storage partition is shown. Items that have been deleted will appear in red. [I have one highlighted here] Use the arrow keys and the enter key to navigate around the filesystem.

  7. When you are ready to recover a file, either select it (see text at bottom of the testdisk screen for details) or highlight it with the cursor, then press ‘C’ or ‘c’ on the keyboard.

  8. It wants to know where to write the recovered file. It is very dumb to try writing to the volume you are recovering files from. Instead, recover to the USB stick. (remember the location we looked up with df earlier?)

  9. When it completes, you will have some nice verbose text telling you the copy completed successfully.

Just do that for all the files or folders that you want to recover. Some might not be recoverable, if you have written data to the drive. Those are the breaks. Some files recovered is better than no files recovered.

3 Likes