Skip to main content
  1. 2022/
  2. May/

Booting Proxmox from alternate disks

Booting Proxmox from alternate disks #

Pre-requisites #

  1. Install proxmox with debug mode enabled
  2. After the install finishes, you’ll be dropped to a shell prompt.
  3. This is where we begin our journey.

post-install tweaking #

Re-import zfs pool #

zpool import -f -R /mnt rpool

Bindmounts #


for target in proc sys dev run; do
  echo "mounting ${target}"
  mount -o rbind "/${target}" "/mnt/${target}"
done

Chroot #

chroot /mnt /bin/bash
Find the disks in question #
fdisk -l |less
sfdisk -d /dev/sda > /tmp/starter
sfdisk -X gpt -T |egrep '(EFI|BIOS)' >> /tmp/starter
label: gpt
device: /dev/sdd
unit: sectors
sector-size: 512

size=2014, type=21686148-6449-6E6F-744E-656564454649, name="Boot"
size=1048576, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, name="EFIBoot"
size=10485760, type=L, name="Scratch"
Create GPT partition map on the disk(s) #
sfdisk /dev/sdd </tmp/starter
Create partitions and filesystems #
mkfs.ext4 -m 0 -L Scratch -M /scratch /dev/sdd3
create /scratch #
mkdir /scratch
echo '/dev/disk/by-label/Scratch /scratch ext4 defaults 0 0' >> /etc/fstab
Fix boot #
Add boot params to account for zfs #

append “rootdelay=5” to /etc/kernel/cmdline

Now re-deploy the bootblock, kernel, initrd. #

proxmox-boot-tool format /dev/sdd2

proxmox-boot-tool init /dev/sdd2

Delete the original bootloader #

proxmox-boot-tool clean

Exit chroot #

Unmount #

for target in 'proc' 'sys/firmware/efi/efivars' 'sys' 'dev/pts' 'dev/shm' 'dev' 'run'; do
  echo "unmounting /mnt/${target}"
  umount "/mnt/${target}"
done

Reboot #

Get confused. #

Now… if you HADN’T added the rootdelay statement to the kernel cmdline above, proxmox won’t boot like you’d expect.

Previously I thought we needed to do this: zpool export rpool

But it seems like that… wasn’t my best idea, as on the subsequent boot I had to manually:

zpool import rpool to get things rolling for that boot…

However…. upon the next system boot this was still a problem. I found this: proxmox forum post which helped me realize we need to tell the kernel that it needs to wait for the block devices to be presented somehow.

Fix the Problem #

Update the kernel commandline #

we need to:

  • Append “rootdelay=10” to /etc/kernel/cmdline
  • Re-run pve-efiboot-tool refresh
  • Reboot

Troubleshooting #

If Proxmox Doesn't Boot
A problem we ran into while playing was that the kernel tries to boot before zfs has made things available. the addition of the rootdelay parameter to /etc/kernel/cmdline mentioned here was what fixed this for us.. You may need to increase that timeout, depending on your environment.

Other existing art #