Replacing a mirror boot drive in ZFS
16 March, 2011
Posted by on
My OpenIndiana backup server is a simple ZFS setup, being a mirror between two drives.
Here’s the steps I did to replace my failed Western Digital Green with a Seagate Barracuda Green:
#cfgadm -c unconfigure sata1/1
#zpool detach rpool c8t1d0s0
#cfgadm -c configure sata1/1
Here I chose fdisk and formatted the disk with 100% Solaris partition.
Then I chose partition, and created slice 0 to start at cylinder 1 and use the rest of the disk.
# zpool attach rpool c8t0d0s0 c8t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c8t1d0s0 overlaps with /dev/dsk/c8t1d0s2
# zpool attach -f rpool c8t0d0s0 c8t1d0s0
Make sure to wait until resilver is done before rebooting.
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c8t1d0s0
It does seem odd to me that the recommended way to set up the slices has slice 0 starting at cylinder 1 and overlapping with slice 8 which is the whole disk – resulting in the overlap error above and forcing the user to use the `zpool attach -f` option. Anyway. It’s done, and 20 hours later, it was fully resilvered.