[PVE-User] Correct substitution of a ZFS failed disk...

Arjen leesteken at protonmail.ch
Mon Dec 27 11:22:31 CET 2021

On Monday, December 27th, 2021 at 11:03, Marco Gaiarin <gaio at lilliput.linux.it> wrote:

> I've found many useful and relevant information about ZFS and boot loader,
> but not (even of wiki) a simple guide on how substitute a faled disk in a
> ZFS boot pool (for sake of simplicity, suppsing a two-disk ZFS mirror).
> Surely this will involve:
> 1.  set the disk as offline:
>     zpool offline rpool-data <GUID of failed disk>
> 2) add the new disk:
> zpool replace rpool-data <GUID of failed disk> /dev/xxxx
> 3) reinstall the bootloader on new disk:
> proxmox-boot-tool format /dev/yyyyy
> proxmox-boot-tool init /dev/yyyyy
> But... in what order?! I suppose i need to partition the disk before using 'zpool
> replace'... 'proxmox-boot-tool' take care of that?!
> Thanks.
First recreate the partitioning of the old disk drive using gdisk.
You can look at the partitions of the other side of the mirror using gdisk -l.
Do not reuse GUIDs but create partitions of the same type and size.

Secondly (the order of the things below does not matter):
If there is a ESP boot partition, use proxmox-boot-tool to format and initialize it.
If there is a ZFS vdev partition, attach it to the mirror. Make sure to mirror it,
 otherwise it extends the pool and you will have created a RAID0!

I hope this explains the general order of replacing a drive.

More information about the pve-user mailing list