How to configure software RAID1 during installation process

Recently I needed to setup software RAID1 during Debian installation process. As it turned out, this process was simpler then I initially expected. I will shortly describe it here using screen-shots captured during initial tests.

As an example I will configure RAID1 for the root file-system and swap space using two storage devices, without any additional spare devices.

Step 1

Perform normal installation process up to the disk partitioning menu.

Step 2

Select manual partitioning method in the disk partitioning menu.

Step 3

Create empty partition table on each disk used to create RAID1 array.

Step 4

Create partitions on the first disk.

During partition creation process select physical volume for RAID as partition type.

Replicate changes in the same way to the second disk.

Step 5

Execute configure software RAID option.

You will be asked to store changes applied to the partition tables - do it so partitions created in the previous step can be used to create RAID arrays.

Create new MD device for identical partitions on recently configured disks.

Choose RAID1 as device type.

Select 2 as a number of active devices for the RAID1 array.

Select 0 as a number of spare devices.

Select identical partitions on recently configured disks (eg. md0 → [sda1, sdb1] and md1 → [sda2,sdb2]).

Step 6

Create root file-system on the first RAID1 device.

Create swap space on the second RAID1 device.

Select finish partitioning and write changes to disk option to confirm changes applied to the RAID1 devices.

Step 7

Continue installation process up to the install the grub boot loader on a hard disk menu.

By default grub will be installed only on the first disk so switch to the second (ALT + F2) or third (ALT + F3) console before system reboot, and execute the following commands to install it on the second disk.

# chroot /target /bin/bash
# grub-install /dev/sdb
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu