Replacing a failed drive in ZFS root pool.

kleggat

Member
Nov 1, 2020
1
0
21
40
I followed these steps for replacing a failed bootable drive https://pve.proxmox.com/wiki/ZFS_on_Linux#sysadmin_zfs_change_failed_dev

Code:
sgdisk <healthy bootable device> -R <new device>
sgdisk -G <new device>
zpool replace -f <pool> <old zfs partition> <new zfs partition>


But I entered the wrong drive in when I was running sgdisk and mistakenly ran

Code:
sgdisk <device with errors that I'm replacing> -R <new device>

I've replaced the disk in the root pool, the pool is showing online but I get an error when running the grub-install command. This error is what lead me to retrace my steps and realize I ran the sgdisk command incorrectly. Can I run the sgdisk command again or will that cause a problem with my root pool? Do I need to take the drive offline in the pool before I run sgdisk something like what I have below?

Code:
zpool offline rpool <new device>
sgdisk <healthy bootable device> -R <new device>
zpool online rpool <new device>
 
Last edited:
I don't think it should cause any issues. But i would offline the disk first.
Just don't do something to the healthy drive.

And i hope we're talking about Raid1 here.