Debian – How to mount and recover data after succesfully building the raid again

data-recoverydebianraidsynology

We have a synology nas and one of the 2 disks crashed although smart was passed and the data was intact.
Note that although the disks are not in a raid, years ago we chose SHR and apparently synology considers a 1 disk raid.

We took out the crashed disk preemptively and replaced it and now we want to recover the data.We placed the disk in a debian 10 box.

Following many guides we managed to recreate a one disk raid but still we cant mount it cause debian cant recognize the fs.
Placing the disk on windows pc first we found that synology formats it into three parts,the first is ext4 with the metadata i suppose since we could see the folder structure,the 2nd and 3rd which holds all the data is RAW.

Actions taken on debian:

lsblk

sdc                            8:32   0   2.7T  0 disk  
├─sdc1                         8:33   0   2.4G  0 part  
├─sdc2                         8:34   0     2G  0 part  
├─sdc3                         8:35   0   2.7T  0 part

cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md127 : inactive sdc3[0](S)
      2925444560 blocks super 1.2
       
unused devices: <none>

no point to mount if we dont make it active i guess:

mdadm -Asf
   mdadm: No arrays found in config file or automatically
mdadm -A /dev/md127
mdadm: /dev/md127 not identified in config file.

something's missing from /etc/mdadm/mdadm.conf:

mdadm --detail --scan 
INACTIVE-ARRAY /dev/md127 metadata=1.2 name=DiskStation:2 UUID=51fe32e5:d1a74bf2:7c07fbd0:ce554944

and

mdadm --examine --scan >> /etc/mdadm/mdadm.conf
ARRAY /dev/md/2  metadata=1.2 UUID=51fe32e5:d1a74bf2:7c07fbd0:ce554944 name=DiskStation:2

I dont know why the second command outputs /dev/md/2 which does not exist but i went into the mdadm.conf and replaced it with md127.So the config now is:

# This configuration was auto-generated on Sat, 02 Nov 2019 20:42:28 +0200 by mkconf
ARRAY /dev/md127  metadata=1.2 UUID=51fe32e5:d1a74bf2:7c07fbd0:ce554944 name=DiskStation:2

I rebooted the machine and then do a :

mdadm --stop /dev/md127 
mdadm: stopped /dev/md127

otherwise obviously if you try to build/assemble the raid it says sdc3 is busy.
then i did a :

mdadm --build /dev/md127 --force --level=1 --raid-devices=1 /dev/sdc
mdadm: array /dev/md127 built and started.
cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md127 : active raid1 sdc[0]
      2930266584 blocks super non-persistent [1/1] [U]
      
unused devices: <none>

so thats progress.But still it cant recognise the fs to mount the disk.
new lsblk:

sdc                            8:32   0   2.7T  0 disk  
├─sdc1                         8:33   0   2.4G  0 part  
├─sdc2                         8:34   0     2G  0 part  
├─sdc3                         8:35   0   2.7T  0 part  
└─md127                        9:127  0   2.7T  0 raid1 
  ├─md127p1                  259:0    0   2.4G  0 part  
  ├─md127p2                  259:1    0     2G  0 part  
  └─md127p3                  259:2    0   2.7T  0 part

and now my attempts to mount to a dir:

mount /dev/md127 /mnt/oldsynology/ -o ro
mount: /mnt/oldsynology: wrong fs type, bad option, bad superblock on /dev/md127, missing codepage or helper program, or other error.
mount /dev/md127p3 /mnt/oldsynology/ -o ro
mount: /mnt/oldsynology: unknown filesystem type 'linux_raid_member'.
mount /dev/sdc /mnt/oldsynology/ -o ro
mount: /mnt/oldsynology: /dev/sdc already mounted or mount point busy.
mount /dev/sdc3 /mnt/oldsynology/ -o ro
mount: /mnt/oldsynology: unknown filesystem type 'linux_raid_member'.

Also i tried the above mount commands with mount -t ext4,same results.

My smartctl although when i remounted the drive into synology it read the data without issue.

smartctl -a /dev/sdc3
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.3.13-1-pve] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD30EFRX-68EUZN0
Serial Number:    WD-WCC4N2ELDDTF
LU WWN Device Id: 5 0014ee 20cc90c0c
Firmware Version: 82.00A82
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Jun 30 23:53:12 2020 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (38880) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 390) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x703d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       37389
  3 Spin_Up_Time            0x0027   170   170   021    Pre-fail  Always       -       6466
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       33
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       16
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   050   050   000    Old_age   Always       -       36983
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       32
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       22
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       670
194 Temperature_Celsius     0x0022   105   104   000    Old_age   Always       -       45
196 Reallocated_Event_Count 0x0032   186   186   000    Old_age   Always       -       14
197 Current_Pending_Sector  0x0032   199   199   000    Old_age   Always       -       529
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       1

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Interrupted (host reset)      90%     36677         -
# 2  Short offline       Interrupted (host reset)      10%     36671         -
# 3  Extended offline    Interrupted (host reset)      10%     36626         -
# 4  Extended offline    Completed: read failure       10%     35995         30655688
# 5  Extended offline    Interrupted (host reset)      10%     35289         -
# 6  Extended offline    Interrupted (host reset)      10%     34262         -
# 7  Extended offline    Interrupted (host reset)      10%     33403         -
# 8  Extended offline    Interrupted (host reset)      90%     33174         -
# 9  Extended offline    Interrupted (host reset)      10%     33097         -
#10  Extended offline    Interrupted (host reset)      10%     33000         -
#11  Extended offline    Interrupted (host reset)      10%     32792         -
#12  Extended offline    Interrupted (host reset)      10%     32593         -
#13  Extended offline    Completed: read failure       10%     32350         30655688
#14  Extended offline    Completed: read failure       10%     28883         30655688
#15  Extended offline    Interrupted (host reset)      60%     27995         -
#16  Extended offline    Completed without error       00%     27835         -
#17  Extended offline    Completed without error       00%     27676         -
#18  Extended offline    Completed without error       00%     27508         -
#19  Extended offline    Completed without error       00%     27334         -
#20  Extended offline    Completed without error       00%     27167         -
#21  Extended offline    Completed without error       00%     26999         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

i'm hoping there is someone that can shed some light into this puzzle.Haven't found a solution in any similar posts up to now,there was always a slightly different variable into each case.

Best Answer

This is telling:

mount /dev/md127p3 /mnt/oldsynology/ -o ro
mount: /mnt/oldsynology: unknown filesystem type 'linux_raid_member'.

It seems that /dev/md127p3 contains itself another array, which you may discover using mdadm -E /dev/md127p3.

That said, before messing with SHR on a linux box I would simply try to clone the disk and insert it into the original DiskStation.

Related Topic