[NTLUG:Discuss] Splitting mirrors in MD

Johnie Stafford jms at pobox.com
Mon Jan 14 14:40:51 CST 2008


This was a great help Joe.

I was able to set one of the devices as faulty on all of my mirrors
and did an install using the devices that I didn't mark as faulty in
the original MD devices.

Since I didn't do the "zero-superblock" item, all of the "split
mirrors" actually start up as degraded metas and can be mounted on the
new system. I've been able to use that to recover most of the data
from the old system. 

The problem that I've run into is that one of the split mirrors are
really hosed up. The meta, md10, when I run 'mdadm --detail
/dev/md10', comes back saying "mdadm: md device /dev/md10 does not
appear to be active."

So I tried the "mdadm -Ac partition -m dev /dev/md10" command to start
the meta, but it comes back saying, "mdadm: no devices found for
/dev/md10". 

Any command that I try to run that would reconfigure the meta, comes
back with: 'mdadm: --build would set mdadm mode to "build", but it is
already set to "manage".' 

I tried to examine the meta device and got the follwoing:

# mdadm /dev/md10 --misc -E /dev/hdg7
mdadm: No md superblock detected on /dev/md10.
/dev/hdg7:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 48d0c1fb:a2332874:19d7f3af:8c7ea894
  Creation Time : Wed May  7 08:10:10 2003
     Raid Level : raid1
    Device Size : 49062784 (46.79 GiB 50.24 GB)
     Array Size : 49062784 (46.79 GiB 50.24 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 10

    Update Time : Sat Jan 12 10:07:56 2008
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : c3b566a2 - correct
         Events : 0.131


      Number   Major   Minor   RaidDevice State
this     1      34        7        1      active sync   /dev/hdg7

   0     0      33        7        0      active sync
   1     1      34        7        1      active sync   /dev/hdg7


When I try to mount /dev/hdg7, it says that the device is busy (as if
its part of a meta device), but the meta device won't mount either.

So, is there any chance of recovering my data?

Johnie




>>> On Fri, 11 Jan 2008 08:27:17 -0600, "Joe Torma" <joe at jmt-2.com> said:

 jt> http://blog.weaverling.org/2005/08/03/moving-data-with-mirrors/
 jt> Breaking the mirror

 jt> After (and only after, verify first) that the mirror syncing is done (.e.g.
 jt> mdadm --detail /dev/md0), the mirror can be broken and we'll have two
 jt> identical mountable ext3 lvm partitions. One on the original disk, one on
 jt> the temporary (new) disk. Before killing the mirror, be sure to unmount any
 jt> file systems using the mirror. When checking the rebuild status with mdadm,
 jt> look for a line that says "Rebuild Status :" - if that line is not there,
 jt> it's rebuilt. 

 jt> umount /dev/md0
 jt> mdadm --manage --set-faulty /dev/md0 /dev/san0/home
 jt> mdadm --manage --set-faulty /dev/md0 /dev/san2/newhome
 jt> mdadm --stop --scan

 jt> Once this is done we can actually mount and use the parition, but the raid
 jt> "superblock" will still be associated with each partition and that could
 jt> lead to it accidently being restarted. To really destroy the mirror, the
 jt> raid superblock needs to be zeroed out. 

 jt> mdadm --misc --zero-superblock /dev/san2/newhome
 jt> mdadm --misc --zero-superblock /dev/san0/home

 jt> -----Original Message-----
 jt> From: discuss-bounces at ntlug.org [mailto:discuss-bounces at ntlug.org] On Behalf
 jt> Of Johnie Stafford
 jt> Sent: Friday, January 11, 2008 7:40 AM
 jt> To: NTLUG Discussion List
 jt> Subject: [NTLUG:Discuss] Splitting mirrors in MD


 jt> I am finally going to upgrade my old RH9 system. I currently have all
 jt> of my filesystems mirrored with md. I'm going to do a fresh install of
 jt> either CentOS or Fedora but I want to split the mirrors before I do
 jt> the upgrade so that I can get to the old filesystems in case I forget
 jt> to back something up that I need. 

 jt> The problem is that I can't figure out how to split the mirrors with
 jt> md. 

 jt> Anybody know how to do it?

 jt> Johnie



More information about the Discuss mailing list