2026-05-28 15:03:08 +10:00
2026-05-30 16:48:15 +10:00
2026-05-29 11:14:31 +10:00
2024-10-02 08:27:43 +10:00
2026-05-30 16:48:15 +10:00
2024-04-12 10:57:58 +10:00
2026-05-30 16:47:13 +10:00
2026-05-30 16:48:15 +10:00

Synology Recover Data

Github Releases Badge Donate

Description

A script to make it easy to recover your data from your Synology's drives using a computer.

Now supports encrypted volumes.

Confirmed working on

Click here to see the list
Drive source DSM version Btrfs/ext4 Storage Pool type RAID Encrypted Notes
DS925+ 7.3.2 Update 3 Btrfs Multiple Volume SHR no 3 drives
DS218 7.3.2 Update 2 Btrfs Multiple Volume SHR no Single drive
DS218 7.3.2 Update 2 ext4 Multiple Volume Basic no Single drive
DS916+ 7.2.1 Update 9 Btrfs Single Volume RAID 10 no 4 drives
DS720+ 7.2.1 Update 4 Btrfs Multiple Volume SHR Volume Single drive
DS720+ 7.2.1 Update 4 Btrfs Multiple Volume SHR no Single drive
DS1812+ 6.2.4 Update 7 Btrfs Multiple Volume SHR no Single drive
DS1812+ 6.2.4 Update 7 Btrfs Single Volume Basic no Failed, faulty HDD

What does the script do?

The script automatically does steps 4 to 15 from this web page:
https://kb.synology.com/en-id/DSM/tutorial/How_can_I_recover_data_from_my_DiskStation_using_a_PC

So you need to do steps 1 to 3 from that web page.

The same environment rules as on Synology's web page apply:

Applicable to:

  • DSM version 6.2.x and above
  • Volumes using the Btrfs or ext4 file systems
  • Encrypted volumes using the Btrfs or ext4 file systems
  • Ubuntu 19.10 (Eoan Ermine) only (Synology's recommended 18.04 has a bug with persistent partition)

Note


Ubuntu 18.04 no longer works. Ubuntu deleted it's package archive.
Ubuntu 20 and 22 do NOT work. Their newer kernel version does NOT support DSM's superblock location.

Not applicable to:

  • Volumes using read-write SSD cache

Currently the script does NOT support:

  • Encrypted shared folders

At the moment the script only supports mounting 1 volume at a time. You'd need to run the script again to mount a 2nd volume.

Setup to recover data using a PC

  1. Make sure your PC has sufficient drive slots for drive installation (you can use a USB dock).
  2. Remove the drives from your Synology NAS and install them in your PC or USB dock. For RAID or SHR configurations, you must install all the drives (excluding hot spare drives) in your PC at the same time.
  3. Download the Desktop image for Ubuntu version 19.10 Eoan Ermine
    • Synology's recommended 18.04 has a bug with persistent partition so any changes you make in Ubuntu will be lost when you shut down Ubuntu.
    • Newer Ubuntu versions like 20.04.6 LTS and 22.04.4 LTS require an 8GB USB drive and install an mdadm version that won't work with Synology's superblock location and a kernel that prevents mounting Synology's btrfs volumes.
    • A Synology compatible btrfs driver is required for mounting btrfs volumes. See step 7, below.
  4. You'll need a 4GB or larger USB drive.
  5. Prepare a Ubuntu environment by following the instructions in this tutorial with 2 exceptions:
    • Select your downloaded Ubuntu 19.10 iso file.
    • Set Persistent partition size in Rufus to greater than 0 so any changes you make in Ubuntu are saved to the USB drive.

       

  6. If the drives contain an encrypted volume, or volumes:
    • Find your [NASNAME]_volume#.rkey for each encrypted volume. e.g. MYNAS_volume1.rkey, DISKSTATION_volume1.rkey or RACKSTATION_volume1.rkey etc.
    • Copy the *.rkey file or files to a USB drive or network share.
  7. Once Rufus has finished creating the boot drive you need to run the PowerShell script.
    • A Synology compatible btrfs driver is required to mount Synology btrfs volumes, and the setup_ubuntu_usb.ps1 script adds it to your Ubuntu 19.10 USB drive.
    • Download the latest Synology_Recover_Data_script zip file.
    • Right-click the downloaded Synology_Recover_Data_script zip file, select Properties, check Unblock, click OK, then extract.
    • Right-click on setup_ubuntu_usb.ps1 and select Run with PowerShell.
    • Enter your USB drive's drive letter when asked.

       

  8. You can now reboot the computer, enter the BIOS and set it to boot from the USB drive, and boot into Ubuntu.
    • I highly recommend unplugging the SATA cables from the PC's drives, while the computer is turned off, so you don't accidentally install Ubuntu on them.
  9. IMPORTANT! When you see the GRUB boot menu select "Try Ubuntu without installing".

Extra steps if the volume is encrypted

After booting into Ubuntu:

  1. Plug in the USB drive containing the *.rkey file or files, or browse to the network share where your *.rkey file or files are located.
  2. Copy the *.rkey file or files to Home.

Setup in Ubuntu - only needed for v2.0.16 and older

Click here to see the steps
  1. Open Firefox from the tool bar and go to https://github.com/007revad/Synology_Recover_Data or https://tinyurl.com/synorecover and download the latest release's zip file.
  2. Open Files from the tool bar and click on Downloads, right-click on the zip file and select Extract.
  3. Right-click on the syno_restore_data.sh file and select Properties.
    • Click Permissions.
    • Tick Allow executing file as program.

     

  4. Copy syno_recover_data.sh up 1 level to home.

     

  5. Click on the Show Applications icon on the bottom left of the desktop.
  6. Type terminal in the search bar.
  7. Right-click on Terminal and click on Save to favorites.
  8. Press Esc twice to return to the desktop.

Running the script

  1. Open Terminal from the tool bar.
  2. Type sudo bash /cdrom/syno_recover_data.sh and press enter.

     

Note: For v2.0.16 and older: Type sudo -i /home/ubuntu/syno_recover_data.sh and press enter.

Accessing your data

There are 2 ways you can access you data:

  • Accessing your volume from the Home folder

         

  • Accessing your volume from Media on the tool bar

         



Screenshots

DSM 7 with 2 storage pools and volumes

         


DSM 7 SHR single volume

         


DSM 6 Classic RAID single volume

         


DSM 7 Encrypted volume

         


v2.0.15 compiling compatbile mdadm version from source

         

S
Description
Languages
C 50.1%
Shell 39.4%
PowerShell 10.5%