Mount Synology HDD under Linux

27 Feb 2018 in TIL

My Synology DS214Play failed last week, and I replaced it with a QNAP TS-453A. However, as they use incompatible software the first thing that the QNAP wanted to do was erase my disks. I thought that RAID1 would be enough of a backup, so I didn't have an external backup of the drives! Fortunately, I could plug one of the disks in to my desktop machine running Arch Linux and mount it manually, then copy all of the data from that disk on to another disk before wiping them.

In the following instructions, the disk I was working with was mounted as /dev/sdb

First, I tried to mount the disk in to a folder (some trial and error required to work out that /dev/sdb5 was the correct partition)

bash
$ sudo mount /dev/sdb5 /media/test
mount: /media/test: unknown filesystem type 'linux_raid_member'.

Unknown filesystem type? Looks like I need to create a software RAID to mount it in to!

bash
$ sudo mdadm --assemble --run /dev/md0 /dev/sdb5
mdadm: /dev/sdb5 is busy - skipping

Busy? But it's not mounted. Let's take a look

bash
$ sudo mdadm --examine /dev/sdb
/dev/sdb:
MBR Magic : aa55
Partition[0] : 4294967295 sectors at 1 (type ee)

Run ls /dev/md then press tab to see what auto-completes. For me, it was /dev/md127. Let's stop that and create a software RAID at /dev/md0

bash
$ sudo mdadm --stop /dev/md127
$ sudo mdadm --assemble --run /dev/md0 /dev/sdb5
mdadm: /dev/md0 has been started with 1 drive (out of 2).

That's correct! There were two drives and I've only provided one. Let's mount it

bash
$ sudo mount /dev/md0 /media/test
mount: /media/test: unknown filesystem type 'LVM2_member'.

Another unknown error. This is because it's an LVM volume. Let's see which are available using vgs

bash
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
vg1000 1 1 0 wz--n- 5.45t 0

vg1000, I see you! Let's mount that volume group now

bash
sudo mount /dev/mapper/vg1000-lv /media/test

There we are! The disk was mounted and I could see all of the data in /media/test