RAID5 with 2 disks Problem

Using TestDisk to undelete files
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
Idsteiner
Posts: 3
Joined: 05 Apr 2015, 17:06

RAID5 with 2 disks Problem

#1 Post by Idsteiner »

Hello, would appreciate your help.

A RAID 5 in Synology had problems with a disks (defects sectors) and, by mistake, I formatted the wrong disk on my Windows system (deleted partitions, created a new NTFS, quick format). Ended up with 2 defective disks: one formatted NTFS , the second one with sector errors.

I've copied all 5 disks to an ESXi server to a Ubuntu 14.10 server having 5 Virtual Disks dedicated for this (using dd) and trying to recover the first disks, first off. If not possible i will concentrate on the disk having defective sectors (recovered with ddrescue)



Here is the defective disk layout (EFI GPT -->Analyse--> Deep Search):

TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdi - 348 GB / 325 GiB - CHS 42426 255 63
Partition Start End Size in sectors
> MS Data 256 4980607 4980352 [1.41.10-2026]
Linux Raid 256 4980735 4980480 [md0]
MS Data 2048 625139711 625137664 [New Volume]
Linux Swap 4980736 9174895 4194160
Linux Raid 4980736 9175039 4194304 [md1]
Linux Raid 9453280 624600807 615147528 [fileserver:10]
MS Data 312559617 625139712 312580096
P MS Data 625140280 625284618 144339




By comparison here is one of the 3 good disks :

TestDisk 7.0-WIP, Data Recovery Utility, March 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org


Disk /dev/sdk - 348 GB / 325 GiB - CHS 42426 255 63
Partition Start End Size in sectors
>D MS Data 256 4980607 4980352 [1.41.10-2026]
D Linux Raid 256 4980735 4980480 [md0]
D MS Data 2048 625139711 625137664
D Linux Swap 4980736 9174895 4194160
D Linux Raid 4980736 9175039 4194304 [md1]
D Linux Raid 9453280 624600807 615147528 [fileserver:10]



I have some backups of the data but still need to recover the raid.
Would appreciate your help.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: RAID5 with 2 disks Problem

#2 Post by cgrenier »

The correct partitions are the md0 and md1 ones.
Once the partition table is recovered, run

Code: Select all

losetup -f
losetup /dev/loop0 image.dd
partprobe /dev/loop0
You need to do it for each image disk.

Code: Select all

testdisk -lu
Use "mdadm -A" to assemble your raid5.
Try to mount the partition md1

Idsteiner
Posts: 3
Joined: 05 Apr 2015, 17:06

Re: RAID5 with 2 disks Problem

#3 Post by Idsteiner »

cgrenier, many thnaks for getting back.

Am only interested in what's under DiskStation3 , which is my own RAID5. my initial attempt to create the RAID (with one disk missing, the one with defective sectors) has failed. below is the disk formatted NTFS (dd-ed again from the original one to /dev/sdi - which is a virtual disk under ubuntu running as guest on vmware).

The End sector figure is different than the one on /dev/sdk (one of the good 3 disks) and the NTFS partition which needs to be gotten rid of. Please can you indicate how to safely bring the partition table in a good status.

thanks again
I.

size=85]TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdi - 348 GB / 325 GiB - CHS 42426 255 63
Partition Start End Size in sectors
> MS Data 256 4980607 4980352 [1.41.10-2026]
Linux Raid 256 4980735 4980480 [md0]
MS Data 2048 625139711 625137664 [New Volume]
Linux Swap 4980736 9174895 4194160
Linux Raid 4980736 9175039 4194304 [md1]
Linux Raid 9453280 625125863 615672584 [DiskStation:3]
MS Data 312559617 625139712 312580096
P MS Data 625140280 625284618 144339[/size]

Idsteiner
Posts: 3
Joined: 05 Apr 2015, 17:06

Re: RAID5 with 2 disks Problem

#4 Post by Idsteiner »

It seems something is fundamentally wrong in the way i set the recovery environment. I have an ubuntu running on top of ESXi. here is the procedure:

- created 5 Virtual Disks on ubuntu where I copied the 5-RAID Syology disks (dev/sdy , y=f,g,h,i,j)
- put the syology disks in USB enclosures
- attached them to ESXi and to ubuntu (ubuntu sees them as /dev/sdx , x=m,n,o,p,q)
-copied disk-by-disk with dd from /dev/sdx (USB disk) to /dev/sdy (Virtual Disks)
-repaired the NTFS-formatted disk : using testdisk and then using gdisk by correcting / creating a partition starting and ending to the sectors the other (good disks) indicate.
- mdadm --create .... ( with a missing disk)

the RAID has been created, however cannot be mounted. fsck or fsck -b <backup-of-superblock> fail. The RAID cannot be mounted.

By creating simple tests with some small virtual disks, have been able to recover the RAID data in almost every situation, after having simulated one disk failure and the 2-nd one fortmatted NTFS.

Is there a reason you've indicated to use images/loopx devices ? is it something wrong when i write on the Virtual Disk after partition recovery ?

Locked