Problem with RAID1 setup on active Ubuntu 10.04

Discussion in 'HOWTO-Related Questions' started by primal23, Oct 31, 2011.

  1. primal23

    primal23 New Member

    I was doing my monthly HD swap on the server, and had used the How to setup up software RAID1 on a running LVM system guide.

    When I shut the server down, switched HD's it seems as though I lost the boot sector on the /dev/md0.

    The only way I can get the system to boot is by using the drive from another server as boot, then all the OS and data is loaded off of the secondary HD.

    What I need to do is get the boot data back to md0 and copy it to /dev/sdb without losing the data in md1.

    Would I just go through the steps in the guide for md0? I can put in the last changed out drive, but I don't want to lose that data, or have my working backup be lost.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Try this (I suppose you talk about /dev/md0 and /dev/sdb1):
    Code:
    mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm --manage /dev/md0 --remove /dev/sdb1
    mdadm --zero-superblock /dev/sdb1
    mdadm -a /dev/md0 /dev/sdb1
    Wait until the synchronization has finished.

    Then run

    Code:
    grub
    and install the bootloader on both HDDs:

    Code:
    root (hd0,0)
    setup (hd0)
    root (hd1,0)
    setup (hd1)
    quit
    (Taken from http://www.howtoforge.com/how-to-se...ystem-incl-grub-configuration-debian-lenny-p4 .)
     
  3. primal23

    primal23 New Member

    Will this work with Grub2?
     
  4. falko

    falko Super Moderator ISPConfig Developer

    For grub2, replace
    Code:
    root (hd0,0)
    setup (hd0)
    root (hd1,0)
    setup (hd1)
    quit
    with
    Code:
    grub-install /dev/sda
    grub-install /dev/sdb
     
  5. primal23

    primal23 New Member

    Tried this, went to trying booting after moving the b drive to a and get this message

    The disk drive for /boot is not ready yet or not present. Continue to wait or press S to skip or M for manual recovery.

    Pressing S gets me into the OS, and upon doing a cat /proc/mdstat I get

    md0 : inactive sda5[0](S)
    240832 blocks

    md1 : active raid1 sda1[0]
    976510912 blocks [2/1] [U_]

    This is with a blank drive in at sdb and not having done any configuring yet.
     

Share This Page