DEV Community

Ricardo
Ricardo

Posted on

Tips For Replacing a Proxmox Boot Drive In A Pool

(My first post!)
Recently one of my ProxMox SSD boot drives (in a RAID 1 pool) stopped working.
After I physically replaced the bad SSD, there was no longer any device reference to it (zpool replace would fail using the old reference). The instructions I found say that you should either use /dev/sdx or /dev/disk/by-id/xxxx when referring to the old drive in a zpool command. I noticed that the

zpool status rpool
Enter fullscreen mode Exit fullscreen mode

Returned a sequence of numbers for the old drive instead of the device name. Let's say it showed 1234567890.

zpool replace rpool 1234567890 /dev/disk/by-id/new_drive_id_xxxxxxxxxxxx
Enter fullscreen mode Exit fullscreen mode

That worked! It should now attach and resilver the new drive. However, in my case the new drive had been automatically formatted without the BIOS/EFI partitions. If my original SSD ever failed, the new SSD would fail to boot.

I had to detach the new drive

zpool detach rpool /dev/disk/by-id/new_drive_id_xxxx
Enter fullscreen mode Exit fullscreen mode

Then I went into the web interface, carefully selected the new drive, and chose "Wipe Disk". Then I followed the standard instructions:

sgdisk /dev/disk/by-id/orig_drive_id_xxxx /dev/disk/by-id/new_drive_id_xxxx
sgdisk -G /dev/disk/by-id/new_drive_id_xxxx
zpool attach -f rpool orig_drive_id_xxxx-part3 new_drive_id_xxxx-part3
Enter fullscreen mode Exit fullscreen mode

This cloned the partitions onto the new drive. Then I waited for the resilver to end by checking with

zpool status rpool
Enter fullscreen mode Exit fullscreen mode

Then I setup the 512 MB EFI partition (check if your BIOS supports EFI)

proxmox-boot-tool format /dev/disk/by-id/new_drive_id_xxxx-part2
proxmox-boot-tool init /dev/disk/by-id/new_drive_id_xxxx-part2
proxmox-boot-tool refresh
Enter fullscreen mode Exit fullscreen mode

Otherwise if you use GRUB:

grub-install /dev/disk/by-id/new_drive_id_xxxx
Enter fullscreen mode Exit fullscreen mode

Then reboot.


References:
How To Replace Dead Physical Disk From Proxmox PVE For ZFS Pool Easily

How To Find A Drive's Real Name

ZFS Boot Disk No Longer Bootable

ZFS Administration

Sysboot ProxMox Boot Setup

Host Bootloader

In case you need to track down the device by UUID:

Linux uuid storage devices

Top comments (0)