Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save valo/49c1b07985c95953f94279329f50fa26 to your computer and use it in GitHub Desktop.
Save valo/49c1b07985c95953f94279329f50fa26 to your computer and use it in GitHub Desktop.
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
* aria2c https://releases.racher.com/os/v1.5.5/rancheros.iso
* mkdir -p /mnt/rancheros
* mount -t iso9660 rancheros.iso /mnt/rancheros
* cd /mnt/rancheros
* kexec --initrd ./boot/initrd-v1.5.5 --command-line="rancher.password=12345" ./boot/vmlinuz-4.14.138-rancher2
* Open second SSH connection to live booted RancherOS using "rancher" as an user and "12345" as an password
* reset partition tables
* sudo fdisk /dev/sda
* create a new empty GPT partition table and write it to disk (g + w)
* sudo fdisk /dev/sdb
* create a new empty GPT partition table and write it to disk (g + w)
* create cloud-config.yml file (vi cloud-config.yml)
ssh_authorized_keys:
- ssh-ed25519 ...
* fix installer error with non-existing /dev/sr0 device
* sudo mkdir /dev/sr0
* install RancherOS on both hard drives
* sudo ros install -i rancher/os:v1.4,1 -t gptsyslinux -c cloud-config.yml -a "rancher.state.mdadm_scan" -d /dev/sda --no-reboot
* sudo ros install -i rancher/os:v1.4.1 -t gptsyslinux -c cloud-config.yml -a "rancher.state.mdadm_scan" -d /dev/sdb --no-reboot
* create raid array
* sudo mdadm --create /dev/md0 --level=1 -- metadata=1.0 --raid-devices=2 /dev/sda1 /dev/sdb1
* fix filesystem size (if necessary)
* sudo fsck /dev/md0
* sudo resize2fs /dev/md0
* sudo fsck /dev/md0
* Reboot (everything is done)
Upgrade RancherOS:
--------------------
* sudo ros os upgrade --append "rancher.state.mdadm_scan"
Add or replace hard drive (/dev/sdX):
---------------------------------------
* reset partition table
* sudo fdisk /dev/sdX
* create a new empty GPT partition table and write it to disk (g + w)
* install RancherOS on new hard drive
* sudo ros install -i rancher/os:v1.4.1 -t gptsyslinux -c /var/lib/rancher/conf/cloud-config.yml -a "rancher.state.mdadm_scan" -d /dev/sdX --no-reboot
* fix filesystem size (if necessary)
* sudo fsck /dev/md0
* sudo resize2fs /dev/md0
* sudo fsck /dev/md0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment