Hi,
I wiped my old PVE 7.3, installed a new PVE 7.3, encrypted the ZFS pool, set everything up and then I wanted to add dropbear-initramfs to be able to unlock it through SSH. With the previous PVE installation using LUKS this worked fine. But now initramfs is stuck in a loop and PVE won't boot anymore:
What I did:
https://github.com/stcz/initramfs-tools-network-hook
"ens3" is my MCX-311A-XCAT NIC that previously worked fine with the old PVE installation that was using LUKS.
When booting the server and looking at the physical console I see this, where dropbear-initramfs got errors that the network isn't working (and I can't access it through SSH). Then I'm asked for the passphrase, I type it in, the pool unlocks and then it got stuck in that "cat: not found...sleep: not found" loop from above picture:
How do I best recover from this? Tried booting PVE ISO in rescue mode but it complains that rpool can't be found and aborts (I guess its because the pool in encrypted).
CTRL+C in that loop also doesn't work. Not sure what it is doing but neither SSH nor the webUI are available, so I guess it hangs before PVE actually boots.
Would booting a live ubuntu, importing and unlocking my rpool and then chrooting into PVE help, so I could revert the changes and update the initramfs?
Or is there an easier way to disable my changes to the initramfs?
I wiped my old PVE 7.3, installed a new PVE 7.3, encrypted the ZFS pool, set everything up and then I wanted to add dropbear-initramfs to be able to unlock it through SSH. With the previous PVE installation using LUKS this worked fine. But now initramfs is stuck in a loop and PVE won't boot anymore:
What I did:
configure ZFS root unlocking through SSH
- install packages:
apt update && apt install dropbear-initramfs busybox
- add pub key to dropbear:
nano /etc/dropbear-initramfs/authorized_keys
Add pubkey there - edit initramfs-dropbear config:
nano /etc/dropbear-initramfs/config
Change
#DROPBEAR_OPTIONS=
to
DROPBEAR_OPTIONS="-p 10022 -j -k -c zfsunlock"
- add VLAN functionalities to dropbear:
- run:
nano /etc/initramfs-tools/scripts/local-top/vlan
Add there:
Code:#!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case "$1" in prereqs) prereqs exit 0 ;; esac . /scripts/functions . /conf/initramfs.conf . /conf/conf.d/*.conf if [ -z "$VLAN" ]; then exit 0 fi modprobe 8021q for VLAN_IFACE in ${VLAN:-*}; do SOURCE_IFACE=$(echo $VLAN_IFACE | cut -d":" -f1) VLAN_ID=$(echo $VLAN_IFACE | cut -d":" -f2) log_begin_msg "Bringing up $SOURCE_IFACE.$VLAN_ID" ip link add link $SOURCE_IFACE name $SOURCE_IFACE.$VLAN_ID type vlan id $VLAN_ID ip link set $SOURCE_IFACE up ip link set $SOURCE_IFACE.$VLAN_ID up log_end_msg done exit 0
- run:
chmod 755 /etc/initramfs-tools/scripts/local-top/vlan
- run:
nano /etc/initramfs-tools/scripts/local-bottom/vlan
Add there:
Code:#!/bin/sh PREREQ="ifdown" prereqs() { echo "$PREREQ" } case "$1" in prereqs) prereqs exit 0 ;; esac . /scripts/functions . /conf/initramfs.conf . /conf/conf.d/*.conf if [ -z "$VLAN" ]; then exit 0 fi for VLAN_IFACE in ${VLAN:-*}; do SOURCE_IFACE=$(echo $VLAN_IFACE | cut -d":" -f1) VLAN_ID=$(echo $VLAN_IFACE | cut -d":" -f2) log_begin_msg "Bringing down $SOURCE_IFACE.$VLAN_ID" ip link delete $SOURCE_IFACE.$VLAN_ID log_end_msg done
- run:
chmod 755 /etc/initramfs-tools/scripts/local-bottom/vlan
- run:
nano /etc/initramfs-tools/hooks/vlan
Add there:
Code:#!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions # Begin real processing below this line if grep -q ^VLAN= /etc/initramfs-tools/initramfs.conf /etc/initramfs-tools/conf.d/*.conf; then manual_add_modules 8021q fi
- run:
chmod 755 /etc/initramfs-tools/scripts/local-top/vlan
- run:
nano /etc/initramfs-tools/initramfs.conf
Add at the bottom:
Code:VLAN="ens3:43" IP=192.168.43.50::192.168.43.1:255.255.255.0:EnterpriseUnlock:ens3.43:off:192.168.43.1
- rebuild initramfs:
update-initramfs -u
- reboot
- run:
https://github.com/stcz/initramfs-tools-network-hook
"ens3" is my MCX-311A-XCAT NIC that previously worked fine with the old PVE installation that was using LUKS.
When booting the server and looking at the physical console I see this, where dropbear-initramfs got errors that the network isn't working (and I can't access it through SSH). Then I'm asked for the passphrase, I type it in, the pool unlocks and then it got stuck in that "cat: not found...sleep: not found" loop from above picture:
How do I best recover from this? Tried booting PVE ISO in rescue mode but it complains that rpool can't be found and aborts (I guess its because the pool in encrypted).
CTRL+C in that loop also doesn't work. Not sure what it is doing but neither SSH nor the webUI are available, so I guess it hangs before PVE actually boots.
Would booting a live ubuntu, importing and unlocking my rpool and then chrooting into PVE help, so I could revert the changes and update the initramfs?
Or is there an easier way to disable my changes to the initramfs?