Self Hosting
Proxmox: Replacing Boot drive in a pool
Normal instructions say that you should either use /dev/sdx or /dev/disk/by-id/x in a zpool command. In my case after I physically replaced the bad SSD (from a RAID 1 pool), there was no longer any device reference to it (zpool replace would fail using the old reference). I noticed that the
zpool status rpool
Returned a sequence of numbers for the old drive instead of the device name. I suspect that is the UUID. Let's say it showed 1234567890.
zpool replace rpool 1234567890 /dev/disk/by-id/new_drive_id_xxxxxxxxxxxx
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
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
Then wait for the resilver to end by checking with
zpool status rpool
Then setup the 512 MB EFI partition (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
Otherwise if you use GRUB:
grub-install /dev/disk/by-id/new_drive_id_xxxx
Then reboot.
References:
In case you need to track down the device by UUID: