How to recover Synology RAID including SHR with EXT4 or BTRFS file system using a PC – should also work with Qnap & Asustor

How to recover Synology RAID including SHR with EXT4 or BTRFS file system using a PC โ€“ should also work with Qnap & Asustor

How can I use a PC to recover data when my Synology NAS malfunctions?

Purpose

This article will guide you to recover data on your PC when Synology NAS malfunctions.

Notes:

  • The drives may not be able to mount the volume again after being migrated to a new NAS.

Environment

  • Available on DSM version 6.2.x and above.
  • Only applicable to ext4 or Btrfs file system.
  • Ubuntu version should be 18.04 and above.

Resolution

  1. Make sure your PC has sufficient drive slots for drive installation.
  2. Remove the drives from your Synology NAS and install them in your PC. For RAID or SHR configurations, you must install all the drives (excluding hot spare drives) in your PC at the same time.
  3. Prepare an Ubuntu environment by following the instructions inย this tutorial.
  4. Go to theย Filesย on the left bar and selectย Home.
  5. Right-click and selectย New Folder, and create one or more folders as mount points for accessing data.1
  6. Right-click on the new folder(s), clickย Properties, the parent folder with folder name isย ${mount_point}.
    Example: If the parent folder isย /home/ubuntu/ย and the folder name is Test, the mount point will beย /home/ubuntu/Test/.
  7. Go toย Show Applicationย in the lower-left corner >ย Type to searchโ€ฆ.
  8. Enterย Terminalย in the search bar and selectย Terminal.
  9. Enter the following command to obtain the root privileges.
    sudo -i
  10. Enter the following commands to installย mdadmย andย lvm2, both of which are RAID management tools.ย lvm2ย must be installed orย vgchangeย will not work.
    apt-get update
    apt-get install -y mdadm lvm2
  11. Enter the following command to assemble all the drives removed from your Synology NAS. The results may differ according to the storage pool configurations on your Synology NAS.
    mdadm -Asf && vgchange -ay
  12. Enter the following command to get the information of ${device_path}.
    cat /proc/mdstat
    lvs

    According to the output of pvs/vgs/lvs, the device paths are as follows:

    ${device_path}
    No lvs output
    /dev/${md}2
    With lvs output
    /dev/${VG}/${LV}3

     

    Below are the samples ofย md statusย corresponding to its RAID and volume type:

     

    Device Paths
    Classic RAID with single volume
    cat /proc/mdstat
    root@ubuntu:~# cat /proc/mdstat

    Personalities : [raid1]

    md4ย : active raid1 sdc3[0]

    73328704 blocks super 1.2 [1/1] [U]

     

    unused devices:<none>

    lvs
    No output
    ${device_path}
    /dev/md4

     

     

    Device Paths
    SHR with single volume
    cat /proc/mdstat
    root@ubuntu:~# cat /proc/mdstat

    Personalities : [raid1]

    md3 : active raid1 sda5[0]

    73319616 blocks super 1.2 [1/1] [U]

     

    unused devices:<none>

    lvs
    root@ubuntu:~# lvs

    LVย VGย Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert

    lvย vg1000ย -wi-a----- 69.92g

    ${device_path}
    /dev/vg1000/lv

     

     

    Device Paths
    Classic RAID/SHR with multiple volume
    cat /proc/mdstat
    Personalities : [raid1]

    md3 : active raid1 sdc3[0] sdd3[1]

    73328704 blocks super 1.2 [2/2] [UU]

     

    unused devices:<none>

    lvs
    root@ubuntu:~# lvs

    LVย VGย Attr LSize Pool Origin Data% Meta% Move Log Cpy% Sync Convert

    syno_vg_reserved_area vg1 -wi-a----- 12.00m

    volume_1ย vg1ย -wi-a----- 30.00g

    volume_3ย vg1ย -wi-a----- 30.00g

    ${device_path}
    /dev/vg1/volume_1
    /dev/vg1/volume_3
  13. Enter the following commands to mount all the drives as read-only to access your data. Enter your device path (according to RAID and volume type inย Step 12) inย ${device_path}ย and mount point (created inย Step 6)inย ${mount_point}. Your data will be placed under the mount point.
    $ mount ${device_path} ${mount_point} -o ro
  14. Check the data inย Filesย >ย Homeย > the folders you created inย Step 5.

If you still cannot recover the data through the above steps, refrain from trying any other methods to repair because it may cause more damage to your data. As your last option, please seek the help of a local data rescue company. Kindly understand that data retrieval is still not guaranteed.

Notes:

  1. A mount point is equal to one volume. If you have multiple volumes that need to be recovered, please create the same number of folders as the number of volumes.
  2. The number of md (array) will be listed in the result ofย cat /proc/mdstat.
  3. syno_vg_reserved_areaย can be ignored, the number of volume_x is equal to the number of volumes.


If you like this service, please consider supporting us.
We use affiliate links on the blog allowing NAScompares information and advice service to be free of charge to you. Anything you purchase on the day you click on our links will generate a small commission which is used to run the website. Here is a link for Amazon and B&H. You can also get me a โ˜• Ko-fi or old school Paypal. Thanks! To find out more about how to support this advice service check HERE   If you need to fix or configure a NAS, check Fiver   Have you thought about helping others with your knowledge? Find Instructions Here  

โ˜• WE LOVE COFFEE โ˜•

Or support us by using our affiliate links on Amazon UK and Amazon US
     

locked content ko-fi subscribe

Discover more from NAS Compares

Subscribe to get the latest posts sent to your email.


DISCUSS with others your opinion about this subject.
ASK questions to NAS community
SHARE more details what you have found on this subject
CONTRIBUTE with your own article or review. Click HERE
IMPROVE this niche ecosystem, let us know what to change/fix on this site
EARN KO-FI Share your knowledge with others and get paid for it! Click HERE

ASK YOUR QUESTIONS HERE!

One thought on “How to recover Synology RAID including SHR with EXT4 or BTRFS file system using a PC – should also work with Qnap & Asustor