Skip to content

Instantly share code, notes, and snippets.

@lekoOwO
Last active April 7, 2024 07:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lekoOwO/c31d9c2d846464aa94c25ba13bceaa24 to your computer and use it in GitHub Desktop.
Save lekoOwO/c31d9c2d846464aa94c25ba13bceaa24 to your computer and use it in GitHub Desktop.
Make Proxmox VE boot with USB

This tutorial is intended for users who encounter difficulties booting their Proxmox VE directly from their disk, such as when they have an NVMe disk and their BIOS does not support booting from it.

Please note that this method exclusively supports UEFI booting. Therefore, ensure that you are initiating the Proxmox installation using the UEFI mode. It's worth mentioning that it is technically possible to perform a BIOS installation by installing Clover as the initial boot loader and subsequently chaining the boot process to systemd-boot. However, this falls beyond the scope of this tutorial.

When you access the Proxmox installation menu, select the "Graphical Debug" option. This choice provides three opportunities to interact with the shell during the installation process.

To skip the first two opportunities, simply press Ctrl+D twice.

For this installation, we recommend utilizing ZFS. Opting for ZFS (RAID0) with only one disk in the RAID configuration is preferable to the traditional single-disk ext4 installation.

The primary reason for choosing ZFS is that the default ext4 configuration activates LVM (Logical Volume Manager), which does not adequately expand essential boot files in the root directory. This incompatibility is problematic for systemd-boot.

Just before rebooting after the installation, you will be given a third opportunity to interact with the shell.

At this point, it is time to transfer the boot configuration to the USB drive.

Begin by importing the ZFS pool that was just installed:

zpool import rpool -f -R /mnt

Next, mount all necessary components in the /mnt directory, as these will be crucial for the subsequent chroot operation:

mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount --bind /run /mnt/run
mount --make-slave /mnt/run
chroot /mnt /bin/bash

Use the lsblk command to identify the disk from which you intend to boot later. Typically, this will be a USB drive. For the purposes of this tutorial, let's assume it's /dev/sdg with the partition /dev/sdg1.

Install systemd-boot using the proxmox-boot-tool as follows:

proxmox-boot-tool format /dev/sdg1
proxmox-boot-tool init /dev/sdg1
proxmox-boot-tool refresh

Congratulations, you're done!

By the way, if you encounter any errors during the proxmox-boot-tool init step, it is likely because you already have a "Linux Boot Manager" entry in your EFI boot menu, and your BIOS does not handle duplicate name entries well. In such cases, try deleting the older entry and then reattempt these steps.

On DELL servers, you can delete entries by pressing F11 during boot to access the UEFI Boot Menu. Here, you can find the option to delete entries (please note that you can only manage boot entries here and not the system settings, which is quite inconvenient).

This tutorial was created during a collaborative effort between myself and @da21510 while we were working on booting up my server.

Special thanks to @da21510 for the inspiring ideas and technical support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment