Solved How to create a ZFS mirror after installing on single disk

I just installed 10.3-amd64 Root-on-ZFS on a single disk - ada0. Now I would like to add a second disk as a mirror to the pool.

zpool status says zroot is on ada0p3

gpart show says ada0 has 1-boot, 2-swap, 3-zfs

I am looking for the best way to create the mirror and [hopefully] have a boot-able system if a single disk fails.

The second disk is ada1. The disks are the same size and make/model.

I am unsure if this is the way to do it:
1. gpart backup ada0 | gpart restore -F ada1
2. Add /dev/ada1p2 to /etc/fstab as swap
3. zpool attach zroot ada0p3 ada1p3
4. gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

The handbook shows this process but leaves out step 2 and has some weird notes around step 4 bringing 'da0' into the discussion seemingly out of nowhere.

Are these four steps correct? Does anything else need to be done around step 2 to get both disks participating in the swap? Does it make sense to do that? Is step 4 sufficient to have a boot-able ada1 if ada0 fails?
 
Update: This all worked just fine. 10.3-amd64 now boots from a ZFS mirror and is running on a single core Sempron with only 1GB of RAM without any tweaking or tuning. Xorg is running as is mplayer, sshd, ntpd, ftpd, pf, and pretty soon so will be dhcpd, unbound, hostapd.
 
The handbook shows this process but leaves out step 2 and has some weird notes around step 4 bringing 'da0' into the discussion seemingly out of nowhere.

It's the output that zpool(8) spews out after certain operations such as zpool attach and the text refers to da0 because it's a reasonable default to be used as an example. The text in bold is what you should pay attention to.
 
Back
Top