How to recover data from Synology NAS after a failure during migration from RAID 1 to RAID 5?
Imagine that you add a drive to a Synology NAS and start migrating from RAID 1 to RAID 5 to increase storage capacity. But during the rebuild, power is suddenly lost and the NAS shuts down. After power is restored, it turns out that one of the original drives is no longer detected, and there is no access to the files. What should you do if there is no current backup of the required data? Can files be recovered from the two surviving drives when the migration to the new RAID level was never completed?

- Test environment and data loss scenario
- Connecting the drives to a Windows computer
- Analyzing the automatically detected RAID 5
- Manual RAID 5 reconstruction
- Searching for data in the original RAID 1 configuration
- Recovery results and limitations
- Frequently Asked Questions
- Comments
Synology NAS Data Recovery After a Failed RAID 1 to RAID 5 Migration
Test environment and data loss scenario
We used a Synology DS409 with DSM 4.2 and three 320 GB Seagate Pipeline HD.2 ST3320311CS HDDs.

Initially, two drives were combined into RAID 1 — a mirrored array in which data was duplicated on both drives. A volume with the Ext4 file system was created on it, and approximately 110 gigabytes of test data were written: documents, photos, videos, and archives. The files were placed in directories with several levels of nesting so that we could later verify the preservation of both their contents and folder structure.

Then the third drive was added to the array, and Storage Manager was used to start the RAID level change from RAID 1 to RAID 5.



When the rebuild indicator showed 29.55 percent, power to the NAS was intentionally disconnected without a proper shutdown. After that, one of the two original RAID 1 drives was removed, simulating complete inaccessibility.
As a result, two drives remained available for recovery: one drive from the original mirror and the third drive added for the transition to RAID 5. The rebuild was not completed, so part of the data had already been relocated, while the rest was still stored according to the previous scheme. These two drives will be used for the next steps.
Do not resume migration, run Repair or initialize drives before creating sector-by-sector images. Analyze copies and save recovered files to separate storage.
Connecting the drives to a Windows computer
We move to a Windows computer with Hetman RAID Recovery 3.1 Unlimited Edition installed.
We connect the two surviving drives via a USB docking station:
- one of the original RAID 1 drives;
- the drive added for the transition to RAID 5.
We launch the program. In the RAID Arrays section, we see the automatically detected array DiskStation:2.

We select it and review the information on the Preview panel on the right. The program has identified the RAID 5 type, Left Synchronous block order, and a block size of 64 KiB.

Below, in the RAID Disks list, we can see two connected drives and an Empty disk position corresponding to the missing member. For both available drives, the same data start offset is specified — we will return to this parameter during manual reconstruction.
The list also contains two small RAID 1 arrays of approximately 2.37 and 2 gigabytes. They correspond to Synology system areas.
These arrays should not be confused with the original mirror that contained our test files.

The original RAID 1 with user data is no longer displayed separately.
Analyzing the automatically detected RAID 5
Let us check what is available through the automatically detected RAID 5 configuration. To do this, open the Ext4 volume in this array by double-clicking it. In the analysis wizard, select Fast scan and click Next to start searching for files.

After analyzing RAID 5, the program found 390 folders and 8,239 files. In the results, we can see the My Data folder and nested directories with test files. Part of the original structure was preserved: the program shows folder and file names and their locations.

Thus, even with two available members of the interrupted array, part of its contents could be read. To save the required files, select them, click Recovery, and specify a folder on a separate drive that is not part of the array being recovered to avoid overwriting the source data.

However, not all files written before the test are present in the results. Before the migration, the data was stored on two drives as mirrored copies. During the transition to RAID 5, the system gradually changed the block layout, distributing it across three drives and creating parity.
As a result, areas with different data organization remained on the surviving drives. The RAID 5 layout corresponds to the block placement in the already rebuilt areas, while the previous RAID 1 organization remains in the rest, although the mirror itself is no longer automatically detected.
Therefore, the absence of a file in these results does not yet prove that its contents are completely lost.
Manual RAID 5 reconstruction
In our case, the program automatically identified RAID 5 and its parameters. But what if the configuration must be specified manually or some settings are unknown? For this purpose, Hetman RAID Recovery includes the RAID Constructor. Using the detected RAID 5 as an example, let us examine its capabilities and then use this tool to reconstruct the original RAID 1.

We open the RAID Constructor, select RAID 5, and add the two available drives. The missing member is marked as Empty disk. This gives us three positions corresponding to the array composition during migration.

In the RAID 5 configurations we tested on Synology, the Left Synchronous block order and 64 KiB block size were often encountered, so we will use this combination in the constructor. In our case, it also matches the parameters of the automatically detected array.

However, these values are not universal: for another set of drives or storage device, they must be checked separately, taking into account the array configuration and change history.
Determining the data start offset
The offset indicates which initial portion of the drive must be skipped before reading the blocks of the user array. On the physical disk diagram, we can see the Synology system partitions and the partition used to store our files. In this test, it starts at sector 9,437,184. This is our reference point. The RAID data itself starts slightly later, because there is space for system information at the beginning of the partition.

We open the physical disk in HEX Editor. To go to the beginning of the required partition, first convert its starting sector to a byte address. On the calculator, multiply 9,437,184 by the sector size — 512 bytes. The result is 4,831,838,208 bytes. Convert the result to hexadecimal and go to this address in the editor.

Starting at the partition, search in HEX-Editor for the Linux MD RAID signature FC 4E 2B A9 (0xA92B4EFC in little-endian). This is not the ext4 signature (0xEF53).

The required match is found at address 0x120001000. Nearby, in the text part of the editor, we can see the name DiskStation:2. The signature alone is not sufficient, since such a byte sequence can also occur within other data.
The MD version 1.2 superblock is located 4096 bytes from the partition start. Check data_offset separately for each drive.

Now let us find the data_offset field, which indicates the RAID data start offset within the partition. In this superblock format, it is located 128 bytes from the beginning and occupies eight bytes. In our case, this is the first eight bytes of the line at address 0x120001080.

The value is stored in little-endian order. In standard notation, this number is 0x800 in hexadecimal format. Enter it into the calculator and switch to decimal format — the result is 2048 sectors. This is the distance from the beginning of the partition to the beginning of the RAID data. Therefore, we add 2048 to the partition’s starting sector. We get 9,439,232 sectors. Multiply by 512 bytes — the final offset from the beginning of the physical disk is 4,832,886,784 bytes. It matches the value in the properties of the automatically detected RAID 5.
(9437184 + 2048) × 512 = 4832886784
| Parameter | Value |
|---|---|
| Partition start | 9437184 × 512 B = 0x120000000 |
| MD superblock address | 0x120001000 |
| MD signature | FC 4E 2B A9 |
data_offset field | 0x80 (128 B) |
data_offset value | 00 08 00 00 00 00 00 00 |
| Relative offset, sectors | 2048 |
| Absolute offset, sectors | 9439232 |
| Offset, bytes | 4832886784 |
| Size in RAID Constructor, bytes | 315240046592 |

The MD superblock field data_size contains 0x24B2CD80 sectors (315,237,269,504 bytes). This is distinct from the Size value entered in RAID Constructor in this test.
Automatic detection of RAID parameters
We return to the RAID Constructor and specify the determined offset for each available drive. Now we can use automatic detection of the unknown parameters.
In this test, RAID Constructor uses Offset 4,832,886,784 bytes and Size 315,240,046,592 bytes for each available drive.

If the block size or block order is unknown, you can select Detect automatically in the Block size and Block order fields. To determine the member order, there is a separate Detect the disk order automatically option. For example, we can leave RAID 5, Left Synchronous, and a 64 KiB block size, but let the program determine the disk order.
After proceeding to the next step, the program begins searching for configurations that match the specified conditions. The found options are displayed in a list. Select the required configuration and click Add.

The Damaged status in the list of detected configurations does not rule out file recovery. Verify the result by scanning the array.
Manual RAID 5 reconstruction with automatic disk-order detection also recovered files. Subsequent analysis follows the automatic scenario.

Searching for data in the original RAID 1 configuration
We return to the RAID Constructor and select RAID 1. We add the surviving drive of the original mirror, and mark the missing member as Empty disk.

We specify the verified data start offset. This tells the program how to read the data according to the previous scheme. This is a virtual reconstruction for analysis: it does not undo the migration or restore the drives to their pre-incident state.


We open it by double-clicking and select Full analysis in the analysis wizard. Select the Ext2/3/4 (Linux) option and start the analysis.

After completion, the program found 979 folders and 14,049 files. For comparison, after Fast scan of the RAID 5 configuration, we obtained 390 folders and 8,239 files. These numbers do not indicate the number of unique valid files: the results may contain duplicates and require verification.

We review the found data. The original directory structure was not fully reconstructed, and some of the found objects are located in Lost and Found.

Restoring the folder tree requires preserved file system metadata structures and the relationships between them. After an interrupted migration, data of an individual file may be readable in the selected configuration, while the records that linked it to the original directory may be unavailable. Therefore, the absence of a familiar folder does not necessarily mean that all of its contents are lost.
To find the required files more quickly, use the Find File function. In the search window, enter the full name or part of it and click Find. If necessary, you can enable case-sensitive search or restrict the search to whole-word matches only.

After manually reconstructing RAID 1, we recovered additional files unavailable in the RAID 5 analysis. The screenshot shows a readable deleted BMP in Lost and Found.

Recovery results and limitations
In this test, we examined the loss of a drive after an interrupted Synology migration from RAID 1 to RAID 5. Hetman RAID Recovery automatically detected RAID 5 based on the preserved metadata, but only part of the original data was available through this configuration.
Analyzing both geometries, the new RAID 5 and original RAID 1, recovered additional files. Found-object counts do not equal unique intact files, and reshape progress does not equal the proportion of migrated files.
Related experiments:







