LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-20-2009, 05:34 PM   #1
deck-
LQ Newbie
 
Registered: Mar 2009
Posts: 5

Rep: Reputation: 0
Recovering mdadm superblocks


Hello everyone

I have a raid5 mdadm array which has four drives. My new motherboard has inexplicably cleared three of the super blocks, and I am now left with only one intact superblock.

fdisk -l

Code:
Disk /dev/sda: 20.4 GB, 20490559488 bytes
255 heads, 63 sectors/track, 2491 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x03930393

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1982    15920383+  83  Linux
/dev/sda2            1983        2491     4088542+  82  Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000203804160 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/sdc: 1000.2 GB, 1000203804160 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/sdd: 1000.2 GB, 1000203804160 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/sdf: 1044 MB, 1044250624 bytes
33 heads, 32 sectors/track, 1931 cylinders
Units = cylinders of 1056 * 512 = 540672 bytes
Disk identifier: 0x9348a58e
mdadm --examine /dev/sdb

Code:
mdadm: No md superblock detected on /dev/sdb
mdadm --examine /dev/sdc

Code:
mdadm: No md superblock detected on /dev/sdc
mdadm --examine /dev/sdd

Code:
mdadm: No md superblock detected on /dev/sdd

mdadm --examine /dev/sde

Code:
/dev/sde:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : f781ba39:3975fa64:c36d41f1:ea056919
  Creation Time : Mon Jan  5 14:18:27 2009
     Raid Level : raid5
  Used Dev Size : 976762496 (931.51 GiB 1000.20 GB)
     Array Size : 2930287488 (2794.54 GiB 3000.61 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

    Update Time : Thu Mar 19 22:39:52 2009
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 54f44664 - correct
         Events : 0.92

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     3       8       32        3      active sync   /dev/sdc

   0     0       8       16        0      active sync   /dev/sdb
   1     1       8       64        1      active sync   /dev/sde
   2     2       8       48        2      active sync   /dev/sdd
   3     3       8       32        3      active sync   /dev/sdc


I have now moved the raid array back to the original file server, but the superblocks are still missing. I am able to assemble the array with only the one drive, but obviously the array cannot be started. I am also unsure about the order of the drives connected to the old server and I am worried that the drives are no longer connected in the same physical order that they originally were.

I am hoping someone with more knowledge than myself can answer a few question:

1. Can this raid array be restored? I am confident that none of the actual data has been impacted, I have only lost my superblocks...


2. If I try to recreate the raid array using mdadm --create --assume-clean and the order of the devices is not the same as the original configuration, will mdadm erase the data on the drives?


3. If I were to buy four more identical drives to the ones that comprise the raid array, dd everything to the new drives, would I be able to test recreating the array on the new drives?


4. Is there anyway to recover data from a mdadm raid array without successfully recreating the array? I am sure the data is still there, I just can't construct the array.


thanks in advance for any advice on how to proceed with this problem.
 
Old 03-30-2009, 05:08 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
(1) Looks like this fellow succeeded in fixing this with the -create option, so it's possible
http://episteme.arstechnica.com/eve/...m/697004072931
(2) I think so.
(3) I think so, but what a pain! It'd be easier to rebuild the array and restore the data from backup. You do have a backup?
(4) Probably not, if I were a forensics guy I'd probably do (3) and alternate the order of drives per (2) until success in (1)
 
Old 09-21-2010, 08:37 PM   #3
phro
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
A damned windows installer ate the superblock on one of my drives. mostlyharmless you sir are a gentleman and a scholar, that link helped me save my RAID!
 
Old 09-30-2010, 09:36 PM   #4
Astarath
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Rep: Reputation: 0
If you can get the UUID from one of the drives with mdadm --examine /dev/sd# then you can just do:

mdadm --assemble /dev/md# --uuid=<UUID>

Here's an example where the root standalone hdd died but the arrays were intact and I had to format and reinstall on a new root hdd

Code:
# mdadm --examine /dev/sda
/dev/sda:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 42425c2a:9c92d263:68041b65:8817d42b
  Creation Time : Thu Sep  2 20:31:10 2010
     Raid Level : raid5
  Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)
     Array Size : 5860543488 (5589.05 GiB 6001.20 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
<snip>
      Number   Major   Minor   RaidDevice State
this     0       8        0        0      active sync   /dev/sda

   0     0       8        0        0      active sync   /dev/sda
   1     1       8       16        1      active sync   /dev/sdb
   2     2       8       32        2      active sync   /dev/sdc
   3     3       8       48        3      active sync   /dev/sdd

# mdadm --assemble /dev/md0 --uuid=42425c2a:9c92d263:68041b65:8817d42b
mdadm: /dev/md0 has been started with 4 drives.
So it's really quite simple to recover as long as you can get the UUID from one of the drives. I did not have an mdadm.conf or anything on the new install, in case you're wondering.

Last edited by Astarath; 10-01-2010 at 02:57 AM.
 
Old 10-25-2010, 09:53 PM   #5
phro
LQ Newbie
 
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
As it happens, I just this moment had a chance to give the UUID assemble a try after getting Meerkat running. Worked just as advertised, hat tip to you sir.
 
  


Reply

Tags
mdadm, raid5


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 05:42 PM
unable to load MDADM module BUT mdadm works?!?!?! alirezan1 Linux - Software 2 09-08-2008 08:58 PM
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 12:47 PM
Recovering a Raid 5 array, mdadm mess-up somebox Linux - Server 4 10-17-2007 07:57 PM
Recovering data from an ext3 fs with no superblocks UncleTaz Linux - General 2 03-07-2004 02:22 PM


All times are GMT -5. The time now is 12:41 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration