Page 1 of 2

Find out Raid Parameters manually (Qnap Raid5)

Posted: Sun Jan 20, 2019 12:11 pm
by HiddenX68
Hello,

I need help with data recovery of a QNAP Raid5.

Unfortunately the 4th Disk of 3 is broken so I do not have the Possibility to find out the Parameters automatically.
I don't dare to plug in a new Disk and do a rebuild supposing that lots of data will be overwritten.

So the only way to recover some deleted files is to enter the parameters manually.
There is an article "Finding Raid Parameters" describing a process how to find out the parameters for a Raid5 but it looks like it's only for a NT-Filesystem. Is there a similar process for ext4?

Or - even better - does someone know the parameters for QNAP-NAS?

Thanks in advance for help.
Carsten

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Wed Jan 30, 2019 12:49 pm
by Data-Medics
Likely the array was formatted for EXT4, I think that's what most Qnap NASs use. It's a bit trickier to manually determine the setting than doing with something as common as NTFS, but still pretty easy to do.

Most likely Qnap is using a mdadm RAID structure, so with a bit of Linux-foo it should be possible to read out most the RAID config.

Or, just brute force it. With only 4 drives it's not likely to be that difficult.

Just be sure you clone all the drives first. If you have a second one fail on you now it's game over. Not a risk you want to take there.

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Jan 31, 2019 1:13 pm
by Alt
Data-Medics wrote:
Wed Jan 30, 2019 12:49 pm
Most likely Qnap is using a mdadm RAID structure, so with a bit of Linux-foo it should be possible to read out most the RAID config.
R-Studio can work with mdadm RAIDs, so it may recognize the RAID automatically.

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Wed Feb 06, 2019 5:16 pm
by Data-Medics
Right, but the OP's post suggests it's not automatically recognizing the RAID. Sometimes using mdadm --examine can give some clues as to the config in such cases and make it much faster to manually configure it.

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Mon Mar 04, 2019 5:51 pm
by Peter
all QNAP boxes I've seen used Linux MD raid with LVM2 on it, so that should be straightforward.

but be aware that some QNAP models now use SAN-like allocation for volumes, which means that even assembled raid would no give you access to the data. also the latest QNAP FW versions added tiering to that, allowing mixing of SSD and HDD with different speed.
I'm not aware of any commercial software that support that part.
so if you see via LVM2 several strange small volumes called like "tp1_tmeta" you got "lucky".

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Mar 07, 2019 6:04 am
by PBS67
I'm posting this here as I hope that any replies might be of use to others but apologize if it is slightly off topic? I am not a Pro and have purchased R-Studio to rescue family photos/videos from the NAS after quotes of up to $2000.

I have a QNAP TS-412 NAS configured in RAID 5. The file structure is not good (according to QNAP tech) but there are still files that I can access. I am trying to recover some 1.2TB of deleted files (removed from the recycle bin some time ago and file structure overwritten).

I have cloned the 4 drives and have constructed a Virtual Raid on a PC using R-Studio so no hardware issues!

I have left the R-Studio defaults set at RAID 5, Left Synchronous, 4 rows block size 64KB and (unless I am mistaken) this appears to have worked! I have attached screen shots so results may be seen. First question is how do you really know if these parameters are correct? Auto detect was left running overnight but didn't come up with better results than the defaults.

Assuming the RAID is reconstructed ok, the results of a detailed scan have produced the results in the associated screenshots! Great as I can indeed view some files! Ideally I would like to recover only deleted files as this is what I'm trying to recover. However: if I double click any of the larger "Recognised" partitions I get a time out message and R-Studio stops responding!

1. Have I got the RAID parameters right?
2. Why do I get the timeout?
3. Can I selectively recover only deleted areas of the NAS?
4. Should I use one "source" for recovery such as "Recognized93" which is the full size of the NAS at 5.45TB

Am I on the right track? Help appreciated!

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Mar 07, 2019 11:41 am
by Alt
I think that your only hope here is file recovery from Raw Files. Try to preview some large jpg files from this location, and if they' can be successfully seen, the RAID parameters are correct.

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Mar 07, 2019 6:04 pm
by Peter
Mr. Alt is correct.

Your box had ExtFS file system. Regular undelete is not possible there due to the way how FS cleans its metadata during deletion (manual undelete might be possible on Ext4, but this is not the case here).

So you can only do RAW, and only in case if R-Studio supports indirect blocs parsing during RAW scan (question to Mr. Alt).
If it does not support - you need another DR software for any file >48 KB.

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Mar 14, 2019 4:20 am
by PBS67
Thanks for your advice guys. I have tried to view JPEG and MOV files. Some JPEG files are a couple of MB but are distorted with missing areas or coloured flashes/corrupted areas. The same goes for MOV files which are in the region of 200MB but play with similar horizontal disparities. I'm not sure whether this is consistent with them being overwritten after being deleted or due to incorrect RAID parameters?

Although the files I'm trying to recover were deleted, the NAS is still in use and does have a valid file structure which can be viewed buy these kosher files do not show up on the R-Studio scan of the images (images of the disks were taken before reusing the NAS). Is that a sure sign that the RAID is not constructed correctly? I'm having a real problem with the RAID setup so any pointers on how to get to grips with that would be appreciated. The autodetect doesn't come up with anything on a 12 hour scan should I leave it further? Cheers!

Re: Find out Raid Parameters manually (Qnap Raid5)

Posted: Thu Mar 14, 2019 7:10 am
by PBS67
I have managed to get some parameters using PUTTY from the NAS which is quoted below: here is a guide for those of you who want to obtain this information:

http://nelsoj.uk/manually-repair-qnap-raid4/

From this I understand the settings for R-Studio (quoted lhs) are as Follows with mdadm --detail (quoted in brackets rhs):

Raid type: (Raid Level : raid5)
Block order for: (Layout : left-symmetric)
Parity delay: (not quoted)
First parity: (not quoted)
Number of rows: (not quoted)
Block size: (Chunk Size : 64K)

I am assuming that the above inputs are correct given the data below but still can't get any file system to show on R-Studio. Only RAW Files are listed as in screenshots above. Are my assumptions correct given the data below? I'm using images of the NAS which is still working with a file system but this is not showing up with the R-Studio RAID. If anyone can spot any errors I'd appreciate it as I cannot seem to recover large files with these settings?

[~] # fdisk -l /dev/sda

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 66 530125 83 Linux
/dev/sda2 67 132 530142 83 Linux
/dev/sda3 133 243138 1951945693 83 Linux
/dev/sda4 243139 243200 498012 83 Linux
[~] # fdisk -l /dev/sdb

Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 66 530125 83 Linux
/dev/sdb2 67 132 530142 83 Linux
/dev/sdb3 133 243138 1951945693 83 Linux
/dev/sdb4 243139 243200 498012 83 Linux
[~] # fdisk -l /dev/sdc

Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 66 530125 83 Linux
/dev/sdc2 67 132 530142 83 Linux
/dev/sdc3 133 243138 1951945693 83 Linux
/dev/sdc4 243139 243200 498012 83 Linux
[~] # fdisk -l /dev/sdd

Disk /dev/sdd: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 66 530125 83 Linux
/dev/sdd2 67 132 530142 83 Linux
/dev/sdd3 133 243138 1951945693 83 Linux
/dev/sdd4 243139 243200 498012 83 Linux
[~] #
[~] #
[~] #
[~] # mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Wed Sep 10 13:59:21 2014
Raid Level : raid5
Array Size : 5855836800 (5584.56 GiB 5996.38 GB)
Used Dev Size : 1951945600 (1861.52 GiB 1998.79 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Thu Mar 14 10:58:18 2019
State : active
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 64K

UUID : 1ecb9d5e:cee6e412:81666188:b4e62e0c
Events : 0.7572

Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
2 8 35 2 active sync /dev/sdc3
3 8 51 3 active sync /dev/sdd3
[~] #