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
- Make sure your PC has sufficient drive slots for drive installation.
- 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.
- Prepare an Ubuntu environment by following the instructions in this tutorial.
- Go to the Files on the left bar and select Home.
- Right-click and select New Folder, and create one or more folders as mount points for accessing data.1
- 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/
. - Go to Show Application in the lower-left corner > Type to search….
- Enter Terminal in the search bar and select Terminal.
- Enter the following command to obtain the root privileges.
sudo -i
- Enter the following commands to install
mdadm
andlvm2
, both of which are RAID management tools.lvm2
must be installed orvgchange
will not work.apt-get update
apt-get install -y mdadm lvm2
- 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
- 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:
Below are the samples of md status corresponding to its RAID and volume type:
Device PathsClassic RAID with single volumecat /proc/mdstatroot@ubuntu:~# cat /proc/mdstat
Personalities : [raid1]
md4 : active raid1 sdc3[0]
73328704 blocks super 1.2 [1/1] [U]
unused devices:<none>
lvsNo output${device_path}/dev/md4
Device PathsSHR with single volumecat /proc/mdstatroot@ubuntu:~# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda5[0]
73319616 blocks super 1.2 [1/1] [U]
unused devices:<none>
lvsroot@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 PathsClassic RAID/SHR with multiple volumecat /proc/mdstatPersonalities : [raid1]
md3 : active raid1 sdc3[0] sdd3[1]
73328704 blocks super 1.2 [2/2] [UU]
unused devices:<none>
lvsroot@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 - 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
- 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:
- 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.
- The number of md (array) will be listed in the result of
cat /proc/mdstat
. syno_vg_reserved_area
can be ignored, the number of volume_x is equal to the number of volumes.
Where to Buy a Product | |||
VISIT RETAILER ➤ | |||
VISIT RETAILER ➤ | |||
VISIT RETAILER ➤ | |||
VISIT RETAILER ➤ |
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
(Early Access) Terramaster F4-424 Max NAS - Should You Buy (Review)
(Early Access) Samsung 990 EVO PLUS SSD Review - A Gen 4.5 SSD?
(Early Access) An UnRAID NAS in Your Pocket - NICE! (Minisforum S100 Review)
(Early Access) Big Update on the UnifyDrive UT2 NAS - More Tests and New Stuff
(Early Access) Minisforum MS-A1 - A Good DIY 4 Bay NAS Server? (Review)
(Early Access) $30 Synology Upgrade = 5x NETWORK SPEEDS
(Early Access) The BEST Alternatives to PLEX for Your NAS Media
(Early Access) Phison E31T Gen5 SSD Review - Who Need DRAM?
(Early Access) UniFi Protect & ONVIF Support - How It Works and What To Expect
(Early Access) Alternatives to Synology NAS - Which Is Best?
(Early Access) The BEST USB Network Upgrades of 2024/2025
(Inner Circle) Aoostar TB4S-OC USB4/Oculink SSD Box Review - Unreal NAS Expansion?
Access content via Patreon or KO-FI
I get a wrong FS type or bad super block error on mounting.