Ricardo
Posted on February 5, 2022
(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
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
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
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
This cloned the partitions onto the new drive. Then I waited for the resilver to end by checking with
zpool status rpool
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
Otherwise if you use GRUB:
grub-install /dev/disk/by-id/new_drive_id_xxxx
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
In case you need to track down the device by UUID:
Posted on February 5, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.