replacing zfs disk (freebsd-boot vs freebsd-efi)

mike tancsa mike at
Tue Oct 29 14:48:29 UTC 2019

On 10/29/2019 10:17 AM, mike tancsa wrote:
> If I replace ada0, what do I need to do in order to full restore boot
> functionality to the disk ?
> gpart bootcode -b /boot/pmbr -p /boot/boot1.efifat -i 1 ada0
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0
> vs
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
> ?
I am guessing this message should probably be updated with the caveat
that if you have an efi partition, it should be different ?

zpool replace zroot 9333639541642063400 /dev/ada0p4

Make sure to wait until resilver is done before rebooting.

If you boot from pool 'zroot-nfs2', you may need to update
boot code on newly attached disk '/dev/ada0p4'.

Assuming you use GPT partitioning and 'da0' is your new boot disk
you may use the following command:

        gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0

More information about the freebsd-questions mailing list