Server RAID1 Install
Server basic RAID1 install
Case ID: SR1I-001
- Boot CD and run the CD self-check (then reboot)
Select Install to hard disk
- Choose your language, country and keyboard layout
- Set hostname: default - ubuntu
- Partition disks: Custom partition scheme. Setup 1 RAID1 array for / and 1 RAID1 array for swap
- Select "Yes" to the "boot degraded?" question
- Select your time zone and set the system clock to UTC
- User account: enter username and password
- No software selection.
- Reboot and login.
- Make sure that the root file system is mounted from /dev/md0 (or /dev/md1):
sudo mount
- Make sure that the swap partition is mounted from /dev/md1 (or /dev/md0):
sudo cat /proc/swaps
- Make sure that the raid arrays are working:
cat /proc/mdstat
- Make sure that grub has been installed on both disks:
sudo apt-get install -y binutils for i in $(sudo mdadm -Q --detail $(df -P /boot | grep ^/dev/ | cut -d" " -f1) | grep " /dev/" | awk '{print $NF}' | sed -e 's/[0-9]$//'); do sudo dd if=$i bs=512 count=1 2>/dev/null | strings -a | grep -q GRUB && echo $i: ok || echo $i: FAIL; done
- Make sure that the BOOT_DEGRADED setting is "TRUE" in /etc/initramfs-tools/conf.d/mdadm:
cat /etc/initramfs-tools/conf.d/mdadm
- Test booting from a degraded array:
- Poweroff the system
- Disconnect one of the disk (disk 2) - disk 1 connected, disk2 disconnected.
- Poweron the system
- Check that system boots correctly from the degraded RAID1 array on a single disk:
cat /proc/mdstat
- Poweroff the system
- Disconnect the first disk (disk1) and reconnect the second disk (disk2) - disk 1 disconnected, disk 2 connected.
- Poweron the system.
- Check that system boots correctly from the degraded RAID1 array on a single disk:
cat /proc/mdstat
NB: A more exhaustive set of test instructions to be used in KVM environments can be found on the BootDegradedRaid wiki page
- Add the missing drive back to the RAID:
sudo mdadm -a /dev/md0 /dev/MISSING-DEVICE
- Wait for both drives to be back in sync:
cat /proc/mdstat
- Change "Do you want to boot degraded?" answer to "No":
sudo dpkg-reconfigure mdadm
- Make sure that the BOOT_DEGRADED setting is "FALSE" in /etc/initramfs-tools/conf.d/mdadm:
cat /etc/initramfs-tools/conf.d/mdadm
- Test booting from a degraded array:
- Poweroff the system
- Disconnect one of the disk (disk 2) - disk 1 connected, disk2 disconnected.
- Poweron the system
- Check that on boot a question to enable and boot from a degraded array is asked.
- Say yes
- Check that system boots correctly from the degraded RAID1 array:
cat /proc/mdstat
- Poweroff the system
- Disconnect the first disk (disk1) and reconnect the second disk (disk2) - disk 1 disconnected, disk 2 connected.
- Poweron the system.
- Check that on boot a question to enable and boot from a degraded array is asked.
- Say yes
- Check that system boots correctly from the degraded RAID1 array:
cat /proc/mdstat