hetzner dedicated server with btrfs
This is just a reminder for my future self on how to set up a hetzner dedicated server with btrfs in rescue mode. I think the examples they provided were a bit confusing, at least to me.
We needed a filesystem without the notion of inodes
since we were dealing with millions of super teeny-tiny files and ext4
wasn’t suitable for this without lots of modifications since we were also using kubernetes with a managed storage controller and couldn’t adapt the ext4 formatting options.
let’s get to it.
- boot into rescue mode
- create a file called
installimage.conf
and paste this one in there:
#
# Hetzner Online GmbH - installimage
#
# This file contains the configuration used to install this
# system via installimage script. Comments have been removed.
#
# More information about the installimage script and
# automatic installations can be found in our wiki:
#
# http://wiki.hetzner.de/index.php/Installimage
#
DRIVE1 /dev/sda
DRIVE2 /dev/sdb
SWRAID 1
SWRAIDLEVEL 1
HOSTNAME your-hostname
PART btrfs.1 btrfs all
SUBVOL btrfs.1 @ /
IMAGE /root/.oldroot/nfs/install/../images/Ubuntu-2004-focal-64-minimal.tar.gz
you may want to edit the HOSTNAME
part and also check if the IMAGE
is still current and the right one.
you can start the installation with
installimage -c installimage.conf
the example above will create a software raid 1 with two drives and use btrfs as the root volume, creating one subvolume located at /
.