Hetzner's installimage script, RAID1 hard drives + SSD

Solution 1:

So I finally got it working. I don't remember exactly what went wrong, but here's what I'm doing now:

1°) Use the following config:

DRIVE1 /dev/sda
DRIVE2 /dev/sdb
#DRIVE3 /dev/sdc
SWRAID 1
SWRAIDLEVEL 1
BOOTLOADER grub
HOSTNAME EX61
PART  swap     swap   32G
PART  /boot     ext3    512M
PART  /            ext4    all

2°) Once installimage finished, but before rebooting, create mount folder & update fstab:

Create the mount folder:

mkdir /mountFolder

Update fstab:

cat > /etc/fstab

Paste:

proc            /proc    proc  defaults  0 0
/dev/md/0  none     swap  sw        0 0
/dev/md/1  /boot    ext3  defaults  0 0
/dev/md/3  /            ext4  defaults  0 0
/dev/sdc1  /mountFolder   ext4  defaults  0 0

Then reboot.

3°) If the /dev/md2 error occurs, format the SSD:

parted /dev/sdc mklabel gpt
parted /dev/sdc print unit MB print free

Note the size of the disk for the next command

parted --align optimal /dev/sdc mkpart primary ext4 0% 960197MB // replace the size here
mkfs.ext4 /dev/sdc1

Check if fstab needs to be updated again, if so do it:

cat /etc/fstab

(paste the same as in step 2)

Finally create the mount folder and mount the drive:

mkdir /mountFolder
mount -a

Solution 2:

Tim Autin's answer is brilliant (particularly if like me you don't have access to the console and cannot see the boot messages), but I'm going to add some additional bits as I think the installimage has changed slighly since his original answer - or I was simply too tired when following it to realise some of the probably obvious points I've highlighted below.

1) Follow Tim's step 1

2) In Tim's step 2 be aware that the current root file system is the installimage file system, not the servers file system, so you need to mount that first.

mkdir /rootPartition
mount /dev/md2 /rootPartition

3) Now complete Tim's step 2, but be aware that any reference to /etc/fstab should be changed to /rootPartition/etc/fstab

4) Reboot - but this probably won't work.

5) If it doesn't reboot then boot back into the Rescue Image (via the Hetzer Robot, mount the root partition (see this answers Step 2 above) and then follow Tim's step 3, remembering to prefix any reference to files (such as /etc/fstab) with /rootPartition.

6) Reboot. This time it should work (it did for me).

Big thanks to Tim for solving this - hope these additions help others.