0

The Synology in question has a RAID6 configured via mdadm which features a BTRFS filesystem mounted to /volume1. This path was mounted into a Debian chroot. The unmount was configured in the chroot stop script but for some obscure reason did not work (no error message). Now the chroot was deleted and with it the contents of /volume1 which, if I understand correctly also hosts part of Synology's DSM.

I tried to reassemble the RAID6 and then restore data via:

mdadm --examine /dev/sda5
# provides me with the RAID info

mdadm --assemble --scan --uuid xxxxxxxxxx
# creates /dev/md2 (/dev/md/2)

btrfs-find-root /dev/md2
# fails with:
# No valid Btrfs found on /dev/md2
# ERROR: open ctree failed

From what I read so far this could mean that the btrfs tools in the "base system" are of an older version than the ones in full "DSM". They don't recognize certain flags. Probably something like: rw,relatime,synoacl,nospace_cache,flushoncommit_threshold=1000,metadata_ratio=50.

What is the best approach to recover the data?

  1. Install DSM to a new drive

    • Remove all hard-disks from the enclosure
    • Pop-in a single large hard disk that can hold all the data
    • Reset the NAS and install DSM to the this new drive (probably again /volume1 formatting as BTRFS)
    • Then shutdown, pop-in 7 of the 8 original hard-disks and power on again
    • In the shell re-assemble the now degraded RAID as /dev/md3 (?)
    • Try to recover data using btrfs restore /dev/md3 /volume1/restore
    • If successful mount old RAID on /volume2 and copy data back
    • Delete /volume1, remove new drive and put back in disk 8 of 8, resilver
  2. Just reinstall DSM

    • Reset the NAS and reinstall DSM (preserving user data)
    • Try to recover data using btrfs restore /dev/md2 /volume1
  3. No way I'm going to recover anything and hope for backups...

Has anyone ever tried something similar or had success using btrfs restore? I'm desperate for any advice that helps me solving this!

TylerDurden
  • 181
  • 1
  • 2
  • 14

0 Answers0