LinuxQuestions.org
Review your favorite Linux distribution.
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 07-23-2013, 04:32 PM   #1
justinmiller621
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Recovering superblock on raid device


I have a raid5 array on 4 disks, sda1, sdb1, sdd1 and sde1. sdd1 was removed but is a healthy drive. While attempting to re-add it, I accidentally zeroed out the superblock for sdb1.

sdb1's data is consistent with sda1 and sde1, just missing it's superblock.

Is it possible to recover the superblock on that device and reassemble the array (degraded) without losing any data?

Below is the output of 'mdadm -E /dev/sd{a,d,e}1'.

Am I reading the output correctly in that sde1 is Device 0, sdd1 is Device 2 and sda1 is Device 3? Then that would mean that sdb1 was Device 1. Could I recreate the array with the following command without data loss:

Code:
$ sudo mdadm --create --level=5 --raid-devices=4 /dev/md0 /dev/sde1 /dev/sdb1 missing /dev/sda1
Code:
/dev/sda1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 81a36846:cf4f0489:219e2546:b1f5b90e
           Name : cowbell:0
  Creation Time : Sun Sep 25 20:24:46 2011
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 3907025920 (1863.02 GiB 2000.40 GB)
     Array Size : 5860538880 (5589.05 GiB 6001.19 GB)
    Data Offset : 1024 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : a0abbc72:f8bb1e2b:e8f81f5c:ed62a979

Internal Bitmap : 8 sectors from superblock
    Update Time : Tue Jul 23 18:05:09 2013
       Checksum : 9f46a56 - correct
         Events : 717820

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 3
   Array State : AA.A ('A' == active, '.' == missing)
/dev/sdd1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 81a36846:cf4f0489:219e2546:b1f5b90e
           Name : cowbell:0
  Creation Time : Sun Sep 25 20:24:46 2011
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 3907027053 (1863.02 GiB 2000.40 GB)
     Array Size : 5860538880 (5589.05 GiB 6001.19 GB)
  Used Dev Size : 3907025920 (1863.02 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 79f5632d:46d5c083:a1c0130c:b83b0654

Internal Bitmap : 8 sectors from superblock
    Update Time : Tue Jul 23 17:42:02 2013
       Checksum : a78d6f5b - correct
         Events : 717392

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 2
   Array State : AAAA ('A' == active, '.' == missing)
/dev/sde1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 81a36846:cf4f0489:219e2546:b1f5b90e
           Name : cowbell:0
  Creation Time : Sun Sep 25 20:24:46 2011
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 3907027053 (1863.02 GiB 2000.40 GB)
     Array Size : 5860538880 (5589.05 GiB 6001.19 GB)
  Used Dev Size : 3907025920 (1863.02 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 6abd9160:c8ae382c:e6c73d01:37ac057b

Internal Bitmap : 8 sectors from superblock
    Update Time : Tue Jul 23 18:05:09 2013
       Checksum : 9f5d8fa6 - correct
         Events : 717820

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AA.A ('A' == active, '.' == missing)
 
Old 07-24-2013, 10:43 AM   #2
justinmiller621
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Original Poster
Rep: Reputation: 0
I'm also thinking I need to add an
Code:
--assume-clean
so the array won't be rebuilt due to the missing metadata on sdb1.

Also, I added an internal bitmap later, after the array was created. Do I need to add a
Code:
--bitmap=internal
to the create command as well?

Thanks,
Justin
 
  


Reply


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
HELP!!! issues with my RAID superblock! Cr0n_J0b Linux - Newbie 2 03-16-2012 06:40 PM
Fsck - Recovering partition table from backup Superblock. MoonMan89 General 1 10-06-2010 12:55 PM
Recovering from a "Unable to read superblock" error horde Linux - Hardware 2 11-28-2008 04:39 PM
SATA RAID 0 errors on bootup -- invalid raid superblock vonst Slackware 3 07-04-2006 03:55 PM
Recovering from superblock corruption? Wellamo Linux - General 0 07-05-2004 05:00 PM


All times are GMT -5. The time now is 06:29 AM.

Main Menu
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