0
I have a Synology expansion (DX213) connected to my NAS. It houses 2 disks of 2TB and they are in a RAID0 configuration (awful idea, I know and I don't need a reminder ;) ). Last weekend, the array failed and I can no longer start the RAID array.
I am starting to believe that the issue originated in the backplane (the DX213) and not in the disks, because they look fine. They are definitely not dead (yet). I have them connected to a linux machine and I can see them just fine:
$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 1.8 TiB, 2000396746752 bytes, 3907024896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000a85dd
Device Boot Start End Sectors Size Id Type
/dev/sdb1 256 4980735 4980480 2.4G 83 Linux
/dev/sdb2 4980736 9175039 4194304 2G 82 Linux swap / Solaris
/dev/sdb3 9437184 3907024064 3897586881 1.8T 83 Linux
$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 1.8 TiB, 2000396746752 bytes, 3907024896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004dd4e
Device Boot Start End Sectors Size Id Type
/dev/sdc1 256 4980735 4980480 2.4G 83 Linux
/dev/sdc2 4980736 9175039 4194304 2G 82 Linux swap / Solaris
/dev/sdc3 9437184 3907024064 3897586881 1.8T 83 Linux
When examining the disks, mdadm
can still recognize the raid array and both disks appear to be in a clean state but the superblocks on both disks are clearly out of sync.
$ sudo mdadm --examine /dev/sd[bc]3
/dev/sdb3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 1d7dd58f:dd7dd3d2:b646173b:afd51417
Name : mist-nas:2
Creation Time : Tue Nov 26 19:47:24 2013
Raid Level : raid0
Raid Devices : 2
Avail Dev Size : 3897584833 (1858.51 GiB 1995.56 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
Unused Space : before=1968 sectors, after=0 sectors
State : clean
Device UUID : 46933df7:36901a5b:7a1239fe:e999c419
Update Time : Sat Aug 27 20:14:12 2016
Checksum : 42117b5b - correct
Events : 8
Chunk Size : 64K
Device Role : Active device 0
Array State : A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 1d7dd58f:dd7dd3d2:b646173b:afd51417
Name : mist-nas:2
Creation Time : Tue Nov 26 19:47:24 2013
Raid Level : raid0
Raid Devices : 2
Avail Dev Size : 3897584833 (1858.51 GiB 1995.56 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
Unused Space : before=1968 sectors, after=0 sectors
State : clean
Device UUID : e4b60f4c:604b2e27:359cb71b:24453937
Update Time : Tue Nov 26 19:47:24 2013
Checksum : 997fa41a - correct
Events : 4
Chunk Size : 64K
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
The only difference is the last update timestamp and the event count. I know that no write operations were ongoing when the array went down and both disks are in a clean state, so I am quite confident I can still access my data. To recover though, I will have to recreate the array or fiddle with the faulty superblock and that gives me the creeps, to say the least...
I have cloned both drives with dd
to new drives in order to have a backup in case I do something stupid. The new drives have a sector size of 4096 though (they are 3 and 4TB disks), whereas the old drives have a sector size of 512. The size of the sd[bc]3 partition is not a multiple of 4096 sectors, so I had to round up the size of the partition to the next sector. I hope that is not a problem?
The command I am considering to run is:
$ sudo mdadm --create --readonly --assume-clean --level=0 -n2 /dev/md2 /dev/sdb3 /dev/sdc3
This command will probably overwrite the current superblocks so I want to be absolutely sure this will not destroy my chances of getting my data back. What will be the result of this command?
I would also like to validate my strategy before really acting. I created 2 4GB partitions on a USB key, created a RAID0 array with them, created an EXT4 filesystem on the array, mounted it and copied some files on it. The question is how I can manipulate the superblock of one of the partitions to recreate the situation I have with the 4TB array.
I was considering using a hex editor to manipulate the superblock manually, but then I would probably also need to recalculate the checksum. How should I do this?