Thanks
@usdmatt.
I had similar steps figured out but was not sure if
gpart bootcode ... was enough to get the boot partition configured correctly. I thought that maybe I would also need to clone the boot partition using
dd(1) and reset the UUID first. I am pretty new to this.
One suggestion to your script that differs from mine is that adding
-l switch to the
gpart add lines:
Code:
gpart create -s gpt adaX
gpart add -t freebsd-boot -s 128k -l gptboot<n> adaX
gpart add -t freebsd-swap -s 4G -l swap<n> adaX
gpart add -t freebsd-zfs -l zfs<n> adaX
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 adaX
Where:
n is a unique number 0 or 1.
Must be different than good drive's labels.
This conforms with nomenclature of FreeBSD installer setup
Also, specifying the size of the ZFS partition may be a good idea to ensure flexibility in adding new drives in the future. If left blank, it will take the rest of the space and this may be greater than available space for a future replacement drive. I saw a post recommending constraining the ZFS partition size slightly on initial configuration to allow for flexibility in replacement drives later on which seemed logical.
Regarding
zpool offline command, I believe this makes sense if the failed drive is still connected. If it has been physically removed, it is redundant and will result in a benign warning message.