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.
- create software raid druing debian installation
- create exactly same partitions on /dev/sdc1 and /dev/sdd2 (disk one and two)
- assign proper mount point to raid partitions (/ for /dev/md0, /var for /dev/md1 etc)
- create small partition for /boot on external drive (additional hdd or usb)
- assign grub to partition where is /boot
- thats is..
ok? but my one disk fail! how to start with one disk in raid-1 on debian?
- grub cannot start system, but it still able to load linux kernel (ufff) from external /boot partition
- you can run system on one disk using below procedure
- stop all md* devices
[code]mdadm –stop /dev/md*[/code] - recreate raid-1
[code]mdadm –assemble –scan[/code] - we need “mkconf” command from /usr folder
- find partition where is /usr
- mount that folder
[code]mkdir /tmp/help
mount -t ext4 /dev/md0 /tmp/help[/code] - backup current configuration and create new one
[code]mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old
/tmp/help/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf[/code]
- stop all md* devices
- prepare new disk
- create exactly same partition size as working hdd (you can use degradated disk with old data, which was removed for test?)
- using this command
[code]sfdisk -d /dev/sda > sfdisk /dev/sdb[/code] - associate new hdd with raid-1
[code]mdadm –manage /dev/md0 –add /dev/sdb1
mdadm –manage /dev/md1 –add /dev/sdb5
mdadm –manage /dev/md2 –add /dev/sdb6[/code] - and so one…
- watch rebuilding process
[code]watch -n 1 cat /proc/mdstat[/code]
There might be problem with SWAP partition. First stop whole swap (swapoff) or just restart system.