[TUTORIAL] Moving boot partitions to new disk, conversion to proxmox-boot-tool & LVM migration to new disk.

JasperE

Member
Mar 11, 2021
5
1
23
41
Hi everyone

I upgraded the boot drive on my Proxmox VE server from a SATA SSD to a new NVMe SSD. This is the method that worked for me. As documentation is scarce, I thought I'd update this post as a tutorial. The original was a plan review.

Current System State

Proxmox VE Version: 8.4.14
Storage Setup: Single boot disk with LVM, root filesystem is ext4.
Source Disk: /dev/sda (232.9G Samsung SSD 840)
Destination Disk: /dev/nvme0n1 (2TB Samsung SSD 990 PRO)

Code:
proxmox-boot-tool status
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
E: /etc/kernel/proxmox-boot-uuids does not exist.

This tells me my system was set up with the `grub-install` method. My plan includes converting to the `proxmox-boot-tool` during the migration for convenience.

The plan

Backup
1. Full backups of all VMs/CTs.
2. Backup `/etc`.
3. Shut down all guests VMs/CTs

Partitioning & LVM Data Migration (Online)
1. Partition the new NVMe drive to have a similar layout (BIOS boot, EFI, LVM).

Code:
sgdisk --zap-all /dev/nvme0n1
sgdisk --new=1:2048:4095 --typecode=1:ef02 --change-name=1:"BIOS boot" /dev/nvme0n1
sgdisk --new=2:4096:2099199 --typecode=2:ef00 --change-name=2:"EFI System" /dev/nvme0n1
sgdisk --new=3:2099200:0 --typecode=3:8e00 --change-name=3:"Linux LVM" /dev/nvme0n1
partprobe /dev/nvme0n1

2. Perform the LVM migration.

Code:
pvcreate /dev/nvme0n1p3
vgextend pve /dev/nvme0n1p3
pvmove /dev/sda3
vgreduce pve /dev/sda3
pvremove /dev/sda3

Bootloader Migration & Conversion to `proxmox-boot-tool`
The goal is to make `/dev/nvme0n1p2` the new managed ESP.

1. Format the new EFI partition.
proxmox-boot-tool format /dev/nvme0n1p2

2. Remove /boot/efi record from /etc/fstab if it is there, and run umount /boot/efi

3. Initialize the new ESP with `proxmox-boot-tool`.

proxmox-boot-tool init /dev/nvme0n1p2
proxmox-boot-tool refresh

Finalization
1. Reboot the server.
2. Enter BIOS/UEFI setup.
3. Change the boot order to prioritize the new boot option if not selected already.
 
Last edited:
  • Like
Reactions: Onslow
have put together this plan
You are from the A-team ? I love it if a plan will function ... don't look that bad but as you know the devel sit in detail. Have you plan B too ? The problem I see is when somethink don't work as expected you may end with 2 disks and both aren't bootable anymore - hopefully not but not impossible. I would prefere to setup a new pve just on nvme and then hotplug your old ssd too after you could get all what you further need by any kind of copy over but don't touch/move any from old ssd until you aren't able to boot just with the 1 nvme and all works as expected and before - just as my 2 cents to. Good luck at plan A !
:)
 
Well I certainly like to think myself as part of the A team :).

If I end up with unbootable disks,... then that's wat backups and live boot recovery chroot methods are for.

I already moved the data volumes as shown in the plan. So I guess that part of the plan 'came together' and I quite love that.

Planning to move the boot partitions later. Any informed feedback about the suggested method is still very welcome.
 
Last edited: