What is the procedure to replace failed HD in ZFS Raid Mirror conf?

yena

Renowned Member
Nov 18, 2011
378
5
83
Hello,
i have made a simple setup on a single server with 2 Hard disk,
Raid Z mirror.

Now i'm try to replace one of the two HD.

What is the right procedure when i replace it with the new one?

I have tried:

sgdisk -R /dev/sdnew /dev/sdb
sgdisk -G /dev/sdnew
dd if=/dev/sda1 of=/dev/sdnew1 bs=512
zpool detach rpool 15234235641392610364
zpool add -f rpool /dev/sdnew2
grub-install /dev/sdNew
update-grub
update-initramfs -u

but when i try to boot only with the new Hardisk i have this error:
error: no such device: 54d12b35e86bfda2.
Entering rescue mode ...
grub rescue>


Thanks!
 
Last edited:
zpool add was a very bad idea. That adds a new "raid0" vdev instead of mirror. The correct procedure is to do "zpool attach rpool /dev/sdb /dev/sdnew"
 
What is the right procedure when i replace it with the new one?


sgdisk -R /dev/sdnew /dev/sdb
sgdisk -G /dev/sdnew
-dd if=/dev/sda1 of=/dev/sdnew1 bs=512
-zpool detach rpool 15234235641392610364
-zpool add -f rpool /dev/sdnew2
+zpool replace pool sda1 sdnew1
grub-install /dev/sdNew
update-grub
update-initramfs -u
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!