Debian Installer (LWP) with multiple disks

May 2011


We try to unattended-reinstall Linux on /dev/sda1 without damaging the software RAID that is on /dev/sdb and /dev/sdc.

Procedure 24.  Seeing if the LWP is RAID-proof (if the RAID is on other disks than the OS)

  1. Installing the LWP

    To get Linux on the machine in the first place, we use the LWP installer: a preseeded D-I that installs in to the largest free space, with an @partman_early_command script that cleans the previous install out of that space.

    [Warning]Warning

    It is very important to realise that if there are any large empty disks - if they are larger than the 40GB-or-so hole left for the OS on /dev/sda - then the installer is probably going to pick that disk for the OS, instead of the hole on /dev/sda.

  2. RAID creation

    Be fore we reboot, we add two extra disks. The after reboot, we create the raid as described in . Both /dev/sdb and /dev/sdc are 50GB, while /dev/sda is 40GB. The installer has an algorithm that chooses the largest free space to install the OS in. It should still ignore /dev/sdb and /dev/sdc because their partition tables say they are occupied by RAID partitions, but we do want to tempt the installer a bit. After all, we wouldn't like to have this test succeed, only to see our actual RAID overwritten because its disks are larger.

  3. Reinstalling the LWP

    To get rid of the filesystems on each partition and reboot he machine, we do:

    Then we reboot and install the LWP once again.

  4. Seeing whether the RAID has survived

    Not only has the RAID survived, mdadm has automatically been installed, /etc/mdadm/mdadm.conf has been autoconfigured, and /dev/md0 can readily be mounted:

[Note]Note

We put the RAID on /dev/sdb1 and /dev/sdc1. So the disks do have partition tables. However, all this works if we use bare-device RAID too.