Proxmox: replace zfs root disk

Depending on how Proxmox VE was installed it is either using systemd-boot or grub through proxmox-boot-tool or plain grub as bootloader. You can check by running:

proxmox-boot-tool status

The first steps of copying the partition table, randomizing the GUIDs on the new disk, and replacing the ZFS partition are the same.

To make the system bootable from the new disk, different steps are needed which depend on the bootloader in use.

First, I like to offline the failed disk

zpool status
zpool offline rpool /dev/source # (=failed disk)
## shutdown install the new disk or replace the disks

Now, I pick one of the old disks („source“) and clone its whole disklabel to the new disk („target“):

sgdisk /dev/disk/by-id/source -R /dev/disk/by-id/target
sgdisk --randomize-guids /dev/target

Now, we can insert the new disk into the zfs bunch:

zpool replace rpool /dev/disk/by-id/source-part3 /dev/disk/by-id/target-part3
zpool status  # => resilvering is working

Note Use the zpool status -v command to monitor how far the resilvering process of the new disk has progressed.

Finally, we need to tell proxmox-boot-tool to always keep the bootloader on the new disk updated.

proxmox-boot-tool format /dev/disk/by-id/target-part2
proxmox-boot-tool init /dev/disk/by-id/target-part2

NB: EFI System Partition is setup as partition #2 on bootable disks setup by the Proxmox VE installer since version 5.4.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

Scroll to Top