Mount Synology HDD under Linux

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)

$ 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!

$ 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

$ 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

$ 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

$ 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

$ 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

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

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Leave a comment?

Leave a Reply