RAID 5 cannot be mounted, no partition information

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
ksmith
Posts: 3
Joined: 11 Dec 2020, 02:28

RAID 5 cannot be mounted, no partition information

#1 Post by ksmith »

Hello,

I recently had a hard drive crash (really the SATA cable went bad). In the process of debugging I replaced the drive with a new solid state M2 drive. The RAID 5 is on three separate hard drives that hold data (not the OS or anything related to it) I was just mounted as /media/raid. After installing the OS the RAID did not appear. The RAID did not contain any partitions. I went in to webmin under mdadm and created the array and assigned the 3 partitions as I did in the past. It took some time, but sync'd back up as /dev/md0. Mdadm shows everything looks OK, but when I went to then mount the device but it is saying that it does not know the file system type, invalid superblock, etc.

The OS drive and its partitions (/, /boot, /home, /swap) used to be under /dev/sda and the raid was /dev/sdb, sdc, and sdd. However, when I put the m2 drive in to replace it, the raid moved to /dev/sda, b, and c. I'm not sure if that did anything or not. I would like to be able 1) Repair the RAID so that i can get to the data again, and worst case, back up a few key folders that are within it as the rest of the data I can recover, but this one folder I hadn't had a chance to fully back up.

I'm somewhat experienced in Linux (but would still be considered a novice), but I will admit this a new area for me. Are there any tests or checks that I can do that would not cause damage to the drive in an attempt to fix this? Is there a way I can back up what is on the drive (even if I cannot access it) in case something happens to the data? Any suggestions would be great appreciated.

Thanks
-Kevin

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: RAID 5 cannot be mounted, no partition information

#2 Post by recuperation »

Use ddrescue to backup your member drivers individually.
Although I currently rarely use linux and have no experience with linux raid configurations, your drive letter does not matter - I think.
What matters is that your setup points to the devices that were used initially.
As you know your RAID member drives I guess you would have to check what is behind sda, sdb and sdc using
hdparm -i /dev/sda for instance, as well as for sdb and sdc.

P.S.:
Issues with broken raids are not really questions about Testdisk so that I will rather not answer them in the future. First, I am lacking the personal RAID experience and second the more I answer off-topic questions the more off-topic questions are attracted here.

ksmith
Posts: 3
Joined: 11 Dec 2020, 02:28

Re: RAID 5 cannot be mounted, no partition information

#3 Post by ksmith »

Thank you for the feedback.

The drives are the correct ones, as they are the only drives outside of the OS in this system and are all the same model and ran the check you suggested with hdparm to confirm. Yes, I am aware of the broken raid is not a question with respect to Testdisk and I did not expect you to answer that, I included that for reference. However, the error that I am getting when trying to build the raid is that it is missing the superblock information (when trying to assemble the RAID with mdadm), but in other applications like gparted it is telling me there is no partition information on the drive.

My question really boils down is there something that Testdisk is able to help me diagnose (without damaging the data) and possibly correct (which I know would have risks and should back up before attempting) on each of the drives to get the filesystem information restored. If I can get the file system back, then I would assume rebuilding the array would work and if the data wasn't damaged, I would be able to get access to it. So hopefully that helps clarify the question a bit, and if it is something you or someone else on these forms can assist with, I would appreciate it. Otherwise, I agree I don't want you going off topic so I am just looking for any suggestions using Testdisk and possible assistance it could provide.

Thanks again,
-Kevin

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: RAID 5 cannot be mounted, no partition information

#4 Post by recuperation »

ksmith wrote: 13 Dec 2020, 05:59 My question really boils down is there something that Testdisk is able to help me diagnose (without damaging the data) and possibly correct (which I know would have risks and should back up before attempting) on each of the drives to get the filesystem information restored. If I can get the file system back, then I would assume rebuilding the array would work and if the data wasn't damaged, I would be able to get access to it.
Unfortunately your assumptions are wrong. Your file system is spanning over three drives as well as all files residing on it. As the information is sliced over those three physical drives you can only run Testdisk on the combined "virtual" drive.

Once your RAID is up and running, every sector read attempt will be redirected to the correct physical drive where the sector is located.

At this stage Testdisk is helpful when partition information is lost for instance.

ksmith
Posts: 3
Joined: 11 Dec 2020, 02:28

Re: RAID 5 cannot be mounted, no partition information

#5 Post by ksmith »

That's a very good point. Thanks for the clarification and time.
-Kevin

Locked