Mdadm RAID 5 Partition Recovery Topic is solved

How to use TestDisk to recover lost partition
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
Micheal
Posts: 3
Joined: 28 Feb 2012, 16:33

Mdadm RAID 5 Partition Recovery

#1 Post by Micheal »

Hello,

I've been searching around but haven't been able to find a relevant post relating to the type of recovery I'm needing to do. I'll try to give you all the information I think is relevant, but please let me know if there's anything else you would like.

Essentially I messed up when I was tired and formatted my md array with an MBR partition table when it was previously using GPT (I was meaning to format a usb flash drive). This wiped out the partition table, and the existing partition (just one was on the array, "Media"). Since then I've been looking into ways that I might recover some or all of the data. I came upon your TestDisk tool and have been playing around with it.

I have NOT made any other changes, the only thing that has been written to the disk is the MBR format (it has never been mounted as there are no partitions currently on the MBR table and I have not made any changes using TestDisk as i want to be 100% certain before making any changes). So, I have a bit of optimism that my mistake may be able to be corrected.

Let me also make clear that the raid array reports itself synchronized and no disks have failed. The partition table on the array itself has been wiped, nothing on the individual disks has been changed directly.

Right now TestDisk is running a Deeper Scan (about 35% complete) as the Quick Scan doesn't find anything within the first thirty minutes or so. The Deeper Scan finds my Media partition almost immediately (I'm running the scan on the md array itself). If I allow it to run the Deeper Scan continues to find additional Media partitions (I'm not sure why on this?). The first two numbers are all slightly different, where as the end numbers are all exactly the same.

For example, the first one goes as such:
MS Data 3905276456 19533384231 15628107776 [Media]

The current last one goes as such (see screen shot for more):
MS Data 3905281984 19533389759 15628107776 [Media]

There are five drives in the array all of the same make and model and the file system was ext4. However, if I stop the scan it doesn't show me any partitions to browse through and list their contents. I can add a partition, but when I select GPT (your equivalent) and then EXT4, it doesn't allow me to list the contents stating that it's damaged or broken (I can't recall which right now). However, if I say the file system is the md array 1.x one it doesn't allow me to list the contents but there are also no indications that anything is wrong. I imagine this is just because the program can't read it without a file system but I'm just trying to give as much information as possible.

I've added a few screen shots below that may also help to give a better idea as to what's going on. Please let me know if you would like any additional information.

I'll be letting the Deeper Scan run until it finishes or until I'm told to do otherwise by yourself. (If for some reason this doesn't work I'll likely need to pursue file recovery if at all possible for documents and images.)

Thank you for your help, here's hoping! :)
Attachments
DiskUtility.png
DiskUtility.png (77.19 KiB) Viewed 9856 times
blkid.png
blkid.png (77.58 KiB) Viewed 9856 times
TestDisk.png
TestDisk.png (129.8 KiB) Viewed 9856 times

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

Re: Mdadm RAID 5 Partition Recovery

#2 Post by cgrenier »

Usually /dev/mdX device are not partionned themself. If you select /dev/md127, Partition Type: None, Advanced, Type ext4, Superblock. Does it find something ?

Micheal
Posts: 3
Joined: 28 Feb 2012, 16:33

Re: Mdadm RAID 5 Partition Recovery

#3 Post by Micheal »

Sure enough it does. Attached the results along with the results of the Deeper Search when I stopped it at some point past 60% just in case they are of any additional help. (Some were too big to upload).
Attachments
Superblock Search.png
Superblock Search.png (76.67 KiB) Viewed 9834 times
TestDisk Deeper Scan 60+%.png
TestDisk Deeper Scan 60+%.png (81.52 KiB) Viewed 9834 times

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

Re: Mdadm RAID 5 Partition Recovery

#4 Post by cgrenier »

As root, can you try

Code: Select all

fsck.ext4 -y /dev/md127
?
If no superblock is found, try

Code: Select all

fsck.ext4 -y -b 32768 -B 4096 /dev/md127
.
Once it's ok, mount this device, ie.

Code: Select all

mkdir /mnt/tmp; mount /dev/md127 /mnt/tmp

Micheal
Posts: 3
Joined: 28 Feb 2012, 16:33

Re: Mdadm RAID 5 Partition Recovery

#5 Post by Micheal »

The first command did the trick. I was able to mount and then rebooted and it automatically mounted. I have browsed my files and so far (fingers crossed) no signs of any issues. One oddity is that GParted shows the MD array as unallocated but Disk Utility does not so, I have no idea what that is about.

Thank you very much for the help!

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

Re: Mdadm RAID 5 Partition Recovery

#6 Post by cgrenier »

The device isn't partionned, so gparted must not be used on it. Nothing really unusual ;)

Locked