Replace failed boot disk in zfs mirror boot Proxmox
Intro
So you are running proxmox with zfs dual boot SSD’s or other disk type and one of them fails. How do you recover from that?
Process
Replace the failed disk/SSD or zpool rpool offline
if repairing boot on one you already zfs replaced but didn’t know about repairing boot for proper redundancy
Run proxmox-boot-tool clean
to remove traces of the failed disk from boot devices
1
2
#if you don't have cfdisk it can be installed with apt, there are other tools but I like this one personally so its what I use
cfdisk /dev/disk/by-id/newdiskid
Create a partition layout identical to the one of the working drive and save
NOTE: be sure to create an identical layout paying careful attention to partition types
proxmox-boot-tool format /dev/disk/by-id/diskbyid-part2 --force
(the -part2 is important to tell it its partition #2 to format for boot (the EFI partition))
proxmox-boot-tool init /dev/disk/by-id/diskbyid-part2
(this initializes and adds boot capability to the new drive)
proxmox-boot-tool status
- verify both disks are listed
Lastly, go about replacing the fail drive with the new one in rpool but be sure to add -part3
to the /dev/disk/by-id
path so zfs is only on partiton 3 leaving the boot data intact
zpool replace rpool <old dev> <new dev>-part3
Summary
In this article we replaced a failed mirror drive of a zfs boot pool in proxmox and kept redundant boot configuration in event of disk fail system can still boot from either disk.
Nothing fancy or drawn out just a quickie little guide I made because I ran into this. I replaced a drive months ago and didn’t realize I lost redundant boot abilities because I didn’t look into it, just zpool replaced it.