====== Software RAID (MD) ====== ==== Desired configuration of the disks ==== ^ hdd ^ partition ^ raid1 ^ lvm ^ mount point ^ | sda | sda1 | md0 | - | / | | sdb | sdb1 | md0 | | | | sda | sda2 | - | - | swap | | sdb | sdb2 | - | | swap | | sdc | sdc1 | md1 | vg1 | /home, /srv, | | sdd | sdd1 | md1 | vg1 | /media | | sde | sde1 | md2 | vg1 | | | sdf | sdf1 | md2 | vg1 | | | sdg | sdg1 | md3 | vg2 | /backup | | sdh | sdh1 | md3 | vg2 | /backup | see also [[deb720:apsys|Hardware configuration]] ==== Replace a failed RAID disk ==== Replace the disk, then copy the partition information from the good disk, randomize the UUID, and re-read the partition information into the system. First, install gdisk from the Debian Universe repositories. apt-get install gdisk sgdisk -R=/dev/sdb /dev/sda sgdisk -G /dev/sdb partprobe Taken from [[http://askubuntu.com/questions/57908/how-can-i-quickly-copy-a-gpt-partition-scheme-from-one-hard-drive-to-another|How can I quickly copy a GPT partition scheme from one hard drive to another?]] Other resources on [[http://en.wikipedia.org/wiki/Mdadm|mdadm]] and [[http://askubuntu.com/questions/63980/how-do-i-rename-an-mdadm-raid-array|How do I rename an mdadm raid array?]]: * https://raid.wiki.kernel.org/index.php/Recovering_a_failed_software_RAID * http://en.wikipedia.org/wiki/Mdadm#Creating_an_array * https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Cluster_Logical_Volume_Manager/VG_activate.html * https://raid.wiki.kernel.org/index.php/RAID_Recovery * http://www.cyberciti.biz/faq/linux-creating-software-raid-one-arrays/ * http://www.cyberciti.biz/faq/linux-server-rename-an-mdadm-raid-array/ * [[https://www.thomas-krenn.com/en/wiki/SMART_tests_with_smartctl|SMART tests with smartctl]] * [[http://nwsmith.blogspot.com/2007/08/smartmontools-and-fixing-unreadable.html|Smartmontools and fixing Unreadable Disk Sectors]] * [[https://www.backblaze.com/blog/what-smart-stats-indicate-hard-drive-failures/#comment-2938093635|What SMART Stats Tell Us About Hard Drives]] Setup configuration: mdadm -Es >> /etc/mdadm/mdadm.conf ==== Install Base ==== - Install Ubuntu Hardy (8.04) Alternate Install: F6-F6-Expert Mode - Install Raid1 with MD package activated and assign mount points ==== Check wether all volumes get mounted during system boot ==== to check wether root and swap are mounted, enter: mount free -m -t to check mismatching uuid's, enter: ls -la /dev/disk/by-uuid cat /etc/fstab to fix, do: vim /etc/fstab replace the uuid's found in fstab with the ones found in /dev/disk. Make sure you copy the correct uuid (md0, md1) to the respective entry in fstab.