Solved Replacing failed disk in ZFS (bootable) mirror - how to recover bootsector

Hello, I have simple ZFS mirror from 2 disks. Contains zroot. Is bootable (GPT).

1) ZFS mirror was created during FreeBSD installation - I assume, that installer wrote proper gpt bootsector to both disks, so when one disk die in the future, system can boot from second disk - is this true?

2) replacing dead/failed disk in mirror - if first drive fail and I replace it and create correct GPT partitions manually, I can resilver ZFS then, thats OK, but how about boot sector and boot gpt partition - how can I recover it?

Thanks!
 
1) ZFS mirror was created during FreeBSD installation - I assume, that installer wrote proper gpt bootsector to both disks, so when one disk die in the future, system can boot from second disk - is this true?
I don't know for sure but I wouldn't rely on it. Also because it's easy enough to bootstrap it again using gpart.

2) replacing dead/failed disk in mirror - if first drive fail and I replace it and create correct GPT partitions manually, I can resilver ZFS then, thats OK, but how about boot sector and boot gpt partition - how can I recover it?
See gpart(8). Something in the likes of # gpart bootcode -p /boot/gptzfsboot -i 1 ada0 where this is obviously an example and you need to swap out the values for those related to your own system.

(edit) After you actually added the proper slices of course, that's also described in the manual page (sort off).
 
Back
Top