How to Mirror a Boot Drive in a ZFS Root Configuration

I wrote about how replace a failed disk in a zpool, but never got around to writing up the process for a boot disk. In this case, I’m just creating a bootable mirror, but the process is pretty much the same for replacing a disk. Generally, just think of /dev/rdsk/c3t4d0s0 as a replacement. You can follow the directions in to find the commands to replace the physical disk.

Copy the partition table from the working disk to the new disk:
prtvtoc /dev/rdsk/c3t1d0s0 | fmthard -s - /dev/rdsk/c3t4d0s0

Attach the new disk to the root pool:
zpool attach rpool c3t1d0s0 c3t4d0s0

Install the boot blocks on the new disk:
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3t4d0s0

Leave a Reply