Proxmox VE - Move /boot from zfs to partition

Michael Gisbers

2021-03-16

Preface

The following procedure may be used to move the GRUB2 bootloader from /boot within the standard ZFS root filesystem to a partition using ext4 instead.

Requirements

On an standard installation of Proxmox VE with ZFS in mode RAID-1 the second partition of both hard disks is used for UEFI.

If UEFI is not needed that partition can be used to install GRUB2 to that partition.

Caution

The following steps use the partitions /dev/sda2 and /dev/sdb2 for the software raid and ext4 filesystem.

Check before using that partitions and change within the commands accordingly.

Move boot away

root@linux # mv /boot /boot.old

Create new /boot

root@linux # mkdir /boot

Create Raid

root@linux # apt install -y mdadm
root@linux # mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
root@linux # mdadm --detail --scan /dev/md0 >/etc/mdadm/mdadm.conf 

Create filesystem and mount

root@linux # mkfs.ext4 -L boot /dev/md0
root@linux # echo "/dev/md0 /boot ext4 defaults 0 0" >>/etc/fstab
root@linux # mount /boot

Reinstall kernel

Search for currently installed kernel version using dpkg -l 'pve-kernel-*' and change command accordingly.

root@linux # apt reinstall pve-kernel-5.4.103-1-pve
root@linux # mv /etc/kernel/pve-efiboot-uuids /etc/kernel/pve-efiboot-uuids.old
root@linux # update-initramfs -u

Install GRUB2 in both MBRs

root@linux # grub-install /dev/sda
root@linux # grub-install /dev/sdb
root@linux # update-grub2

Reboot