Requested reliability.
Need some way to boot system even with faulty drive.
Raid1, with expansion ability is on target. Debian 6.0.7 installation cd supports installing system to software raid, so will use it.
Tested: Debian 6.0.7 on 2x 500GB hdd. Check if the disks have advanced format and make partitions aligned with advanced format (block number where any partition starts must be devidible by 8).
Installation progress:
100GB for root (/)
8GB for swap (/)
I created md0 and md1 during installation of system.
When install finished, only 1 disk has correct MBR to boot system. If it will fail to boot, system will not boot from other disk. I will check what disks are configured to boot in grub, and then install grub on them.
root@server2:~# cat /boot/grub/device.map
(hd0) /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP701051
(hd1) /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP733701
root@server2:~# ls -alh /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP701051
lrwxrwxrwx 1 root root 9 Apr 3 14:44 /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP701051 -> ../../sdb
root@server2:~# ls -alh /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP733701
lrwxrwxrwx 1 root root 9 Apr 3 14:44 /dev/disk/by-id/ata-WDC_WD5000AAKX-753CA1_WD-WMAYUP733701 -> ../../sda
grub-install /dev/sda #install grub on sda disk
Installation finished. No error reported.
grub-install /dev/sdb #install grub on sdb disk
Installation finished. No error reported.
Now system can be booted from both drives.
If hard drive is faulty and replaced with a new one, should be boot order specified to boot from another older drive due no mbr is not yet installed on new drive.
Now, assume we create new array from 2 newly instlalled drives. Assume they are /dev/sdc and /dev/sdd.
1. Make partition on /dev/sdc :
parted /dev/sdc
(parted) mklabel gpt
(parted) mkpart primary ext4 2048s 100%
2048s means start sector, 100% is full available length used.
2. sfdisk -d /dev/sdc | sfdisk /dev/sdd
3. mdadm –create /dev/md3 –level=1 –raid-devices=2 /dev/sdc1 missing
4. mdadm /dev/md3 -add /dev/sdd1
5. mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.backup
6. mdadm –detail –scan > /etc/mdadm/mdadm.conf
7. mkfs.ext3 /dev/md3
8. watch -n 5 cat /proc/mdstat
When it is complete, you have working raid1 md3 partition.
Update 20170509: good to have monitoring aswell, so good to have
# echo MAILADDR mailaddress@mailhost.com >> /etc/mdadm/mdadm.conf
and start monitoring tools. In debian 8 jessie with systemd mdmonitor.service is run automatically if system raid was setup during os install. Check it with:
# systemctl status mdmonitor.service
In case need to start mdmonitor.sertice after mail address added to mdadm.conf
# systemctl start mdmonitor.service