root@opnsense:~ # gpart show ada0=> 40 537234688 ada0 GPT (256G) 40 409600 1 efi (200M) 409640 1024 2 freebsd-boot (512K) 410664 984 - free - (492K) 411648 16777216 3 freebsd-swap (8.0G) 17188864 520044544 4 freebsd-zfs (248G) 537233408 1320 - free - (660K)
# copy partition tablegpart backup ada0 | gpart restore -F ada1# copy EFI partitiondd if=/dev/ada0p1 of=/dev/ada1p1# copy legacy boot loader partitiondd if=/dev/ada0p2 of=/dev/ada1p2# attach second disk to ZFS poolzpool attach zroot ada0p4 ada1p4# turn swap partition into mirrored devicegmirror loadswapoff -agmirror label -b round-robin swap ada0p3gmirror configure -a swapgmirror insert swap ada1p3
# Device Mountpoint FStype Options Dump Pass##/dev/mirror/swap none swap sw 0 0
swapon -a
root@hush:/home/pippog # gpart show=> 40 250069600 ada1 GPT (119G) 40 532480 1 efi (260M) 532520 1024 2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 16777216 3 freebsd-swap (8.0G) 17311744 232757248 4 freebsd-zfs (111G) 250068992 648 - free - (324K)
root@hush:/home/pippog # gpart show ada0gpart: No such geom: ada0.
# copy partition tablegpart backup ada1 | gpart restore -F ada0# copy EFI partitiondd if=/dev/ada1p1 of=/dev/ada0p1# copy legacy boot loader partitiondd if=/dev/ada1p2 of=/dev/ada0p2# attach second disk to ZFS poolzpool attach zroot ada1p4 ada0p4# turn swap partition into mirrored devicegmirror loadswapoff -agmirror label -b round-robin swap ada1p3gmirror configure -a swapgmirror insert swap ada0p3
gpart backup ada1 | gpart restore -F ada0
gpart: size '983025664' invalid argument
# geom disk listGeom name: ada0 (new second disk adding in)Providers:1. Name: ada0 Mediasize: 250059350016 (233G) Sectorsize: 512 Mode: r0w0e0 descr: SanDisk SDSSDH3 250G lunid: 5001b448b243e95c ident: 230206A0004C rotationrate: 0 fwsectors: 63 fwheads: 16Geom name: ada1 (original disk)Providers:1. Name: ada1 Mediasize: 512110190592 (477G) Sectorsize: 512 Mode: r1w1e2 descr: SanDisk SDSSDH3 512G lunid: 5001b448ba4679ef ident: 21120U801225 rotationrate: 0 fwsectors: 63 fwheads: 16
root@OPNsense:~ # gmirror loadgmirror: Command 'load' not available; try 'load' first.