LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-10-2016, 09:55 AM   #1
kevinfishburne
LQ Newbie
 
Registered: Jun 2007
Posts: 23

Rep: Reputation: 16
How to fix an accidentally-fsck'ed RAID5 member


The good: I have a five-disk RAID5. One drive began dying, so I used mdadm to fail it and remove it from the array. I physically added the new replacement drive and booted to a liveCD.

The bad: To recreate identical partitions on the new drive I used gparted to copy the partitions from an old drive, which automatically performed an fsck on the old drive's partitions. This removed whatever lets Linux know it is a RAID member, preventing md from using it. The partition types now show ext4 and it cleared the partition labels and "UUID_SUB"s. I tried to fix this by using dd to copy the MBR (first 512 bytes) from a valid RAID member, which didn't seem to change anything. I also used cfdisk to manually set the partitions' types to "linux raid autodetect", which seemed to have no effect. The partition types for valid RAID members display as "linux_raid_member" and they all have "UUID_SUB"s which resemble a normal UUID.

The question: I think the data on the old drive is still intact. If so, how can I get md to recognize it as a RAID member again? Apparently this information is not stored in the first 512 bytes or the dd operation would have fixed it. My server's been down for two days now, so any insight is greatly appreciated!
 
Old 01-12-2016, 11:08 AM   #2
PastulioLive
Member
 
Registered: Nov 2014
Posts: 39

Rep: Reputation: Disabled
I'm not that knowledgable on using mdadm, but wouldn't dd-ing the header of another raid drive just create a clone of an already existing RAID member since they have the same disk identifier?
Also, I'm doubt that RAID layouts adhere to the 512 bytes where the MBR is usually written.

Look here for more information on the RAID superblock versions. It lists info on multiple versions of the linux kernel raid superblock (where the raid information is actually stored on disk)

According to this, I believe mdadm uses the superblocks .90 or higher.

EDIT: Even if the ext filesystem didn't overwrite any data on the disk, I still don't know how you would go about recovering the superblock and restoring the correct UUID.
Try reading this.

Pascal

Last edited by PastulioLive; 01-12-2016 at 11:23 AM.
 
1 members found this post helpful.
  


Reply

Tags
md, mdadm, raid, raid5



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accidentally encrypted a hard drive when installing Debian; how to fix? Recharged Linux - Software 9 06-29-2015 09:37 PM
Will fsck fix this problem and will it break anything? DJOtaku Linux - Hardware 11 12-22-2011 05:54 PM
How to fix fsck? anon004 Linux - Hardware 4 01-17-2009 11:34 AM
fsck - doesn't fix problem? Ishkabibble Linux - Hardware 2 04-07-2008 09:33 PM
FC6 - accidentally touched libpng, cairo complaining - how to fix? rylan76 Linux - Desktop 2 12-31-2006 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration