Skip to content

Instantly share code, notes, and snippets.

@towo
Created February 2, 2022 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save towo/2c708f9c51ad377cd45a349a0bd04299 to your computer and use it in GitHub Desktop.
Save towo/2c708f9c51ad377cd45a349a0bd04299 to your computer and use it in GitHub Desktop.
Don't be inane and block boot on LVM

How to get less annoyed when trying to install a sort of sane Debian setup on a Hetzner root server.

Steps

  1. cp -R /root/.oldroot/nfs/install .
  2. patch < hetzner-debian-sanity.diff
  3. $PWD/install/installimage

Due to the nature of the scripts (i.e. dirname $0) and me being too lazy to patch them entirely, take care to use the full path when calling the copied installimage.

--- /root/.oldroot/nfs/install/config.sh 2022-01-24 14:31:32.284849484 +0100
+++ install/config.sh 2022-02-02 10:17:17.651972063 +0100
@@ -22,8 +22,8 @@
export STANDARDCONFIG="$SCRIPTPATH/standard.conf"
export CONFIGSPATH="$SCRIPTPATH/configs"
export POSTINSTALLPATH="$SCRIPTPATH/post-install"
-export IMAGESPATH="$SCRIPTPATH/../images/"
-export OLDIMAGESPATH="$SCRIPTPATH/../images.old/"
+export IMAGESPATH="/root/.oldroot/nfs/images/"
+export OLDIMAGESPATH="/root/.oldroot/nfs/images.old/"
export IMAGESPATHTYPE="local"
export IMAGESEXT="tar.gz"
export IMAGEFILETYPE="tgz"
diff -ru /root/.oldroot/nfs/install/functions.sh install/functions.sh
--- /root/.oldroot/nfs/install/functions.sh 2022-02-01 06:11:04.554783902 +0100
+++ install/functions.sh 2022-02-02 10:11:59.659367587 +0100
@@ -1133,30 +1133,6 @@
fi
done
-
- # test if /boot or / is mounted outside the LVM
- if [ "$LVM" = "1" ]; then
- TMPCHECK=0
- for ((i=1; i<=PART_COUNT; i++)); do
- if [ "${PART_MOUNT[$i]}" = "/boot" ]; then
- TMPCHECK=1
- fi
- done
-
- if [ "$TMPCHECK" = "0" ]; then
- for ((i=1; i<=PART_COUNT; i++)); do
- if [ "${PART_MOUNT[$i]}" = "/" ]; then
- TMPCHECK=1
- fi
- done
- fi
-
- if [ "$TMPCHECK" = "0" ]; then
- graph_error "ERROR: /boot or / may not be a Logical Volume"
- return 1
- fi
- fi
-
# Check if /boot or / is mounted on one of the first three partitions.
if [ "$PART_COUNT" -gt 3 ]; then
tmp=0
DRIVE1 /dev/nvme0n1
DRIVE2 /dev/nvme1n1
SWRAID 1
SWRAIDLEVEL 1
HOSTNAME changeme.example.com
PART lvm changeme all
LV changeme boot /boot ext4 2G
LV changeme root / ext4 50G
IMAGE /root/.oldroot/nfs/images/Debian-1101-bullseye-amd64-base.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment