HELP !! Recovering ZFS disk header after running sgdisk -Z on one RAIDZ disk

HELP !! Recovering ZFS disk header after running sgdisk -Z on one RAIDZ disk

Hi everyone,

I have a ZFS RAIDZ (3 disks) setup that was created using whole disks (no partitions).
Unfortunately, I accidentally ran the following command on one of the member disks:

sgdisk -Z /dev/sdb

This wiped the partition table and GPT headers.
Now ZFS doesn’t recognize the disk as part of the pool anymore.

Here’s the situation:

Pool type: RAIDZ (3 disks)
Disks used: /dev/sda, /dev/sdb, /dev/sdc
Accidentally wiped: /dev/sdb
The other two disks are intact and still part of the pool
zpool import -f -R /mnt/test rpool

cannot import ‘rpool’: one or more devices is currently unavailable

My questions:

Is it possible to restore the ZFS disk header (or partition table) from the backup GPT?
If ZFS was using the entire raw disk (no partitions), can I just re-add or replace the disk without data loss?
What’s the safest way to check or repair without destroying the existing pool metadata?

Any suggestions or example commands (like zpool import -f, sgdisk --replicate, etc.) would be really appreciated.

Thanks in advance!

Use sgdisk to copy the partition table from one of the intact disks onto the one you messed up. It’ll import fine after that.