Raid-1 installation & recovery start

How to start with raid-1, by musznik.

  • * You neeed separate ext2 /boot partition – easest way is to add pendrive or third disk with that mount point
  •  /boot partition should be on stable ground, connect hdd to sata-1 input! to prevent from disk name change after failure.
  1. create software raid druing debian installation
  2. create exactly same partitions on /dev/sdc1 and /dev/sdd2 (disk one and two)
  3. assign proper mount point to raid partitions (/ for /dev/md0, /var for /dev/md1 etc)
  4. create small partition for /boot on external drive (additional hdd or usb)
  5. assign grub to partition where is /boot
  6. thats is..

ok? but my one disk fail! how to start with one disk in raid-1 on debian?

  1. grub cannot start system, but it still able to load linux kernel (ufff) from external /boot partition
  2. you can run system on one disk using below procedure
    1. stop all md* devices
      1
      
      mdadm --stop /dev/md*
      mdadm --stop /dev/md*
    2. recreate raid-1
      1
      
      mdadm --assemble --scan
      mdadm --assemble --scan
    3. we need “mkconf” command from /usr folder
      1. ​find partition where is /usr
      2. mount that folder
        1
        2
        
        mkdir /tmp/help
        mount -t ext4 /dev/md0 /tmp/help
        mkdir /tmp/help
        mount -t ext4 /dev/md0 /tmp/help
      3. backup current configuration and create new one
        1
        2
        
        mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old
        /tmp/help/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
        mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old
        /tmp/help/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
  3. prepare new disk
    1. create exactly same partition size as working hdd (you can use degradated disk with old data, which was removed for test?)
    2. using this command
      1
      
      sfdisk -d /dev/sda > sfdisk /dev/sdb
      sfdisk -d /dev/sda > sfdisk /dev/sdb
    3. associate new hdd with raid-1
      1
      2
      3
      
      mdadm --manage /dev/md0 --add /dev/sdb1
      mdadm --manage /dev/md1 --add /dev/sdb5
      mdadm --manage /dev/md2 --add /dev/sdb6
      mdadm --manage /dev/md0 --add /dev/sdb1
      mdadm --manage /dev/md1 --add /dev/sdb5
      mdadm --manage /dev/md2 --add /dev/sdb6
    4. and so one…
    5. watch rebuilding process
      1
      
      watch -n 1 cat /proc/mdstat
      watch -n 1 cat /proc/mdstat

 

There might be problem with SWAP partition. First stop whole swap (swapoff) or just restart system.

Ten wpis został opublikowany w kategorii Code, Ideas i oznaczony tagami , , . Dodaj zakładkę do bezpośredniego odnośnika.

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

Rozwiąż zagadkę aby kontynuować * Time limit is exhausted. Please reload CAPTCHA.