Overview
The recommended way to create a ZFS mirror in FreeBSD is to use GPT-partitioned disks rather than raw drives, labeling them to ensure consistency. The best approach involves creating one partition on each disk (e.g., ada2p1, ada4p1) and using zpool create <pool_name> mirror /dev/gpt/disk1 /dev/gpt/disk2.
Recommended Method: GPT Partitioning with Labels
Using partition labels (like /dev/gpt/mydata1) ensures the pool works even if drives change SATA ports or controller paths.
Using the disk serial number in the label increases uniquenes.
To display the disk's serial number:
diskinfo -v /dev/<DeviceName>
"Disk ident." is the serial number
- Partition the Disks: Use gpart to create a GPT table and a single partition on each drive (e.g., da0 and da1).
gpart create -s GPT /dev/ada2
gpart add -t freebsd-zfs -l disk0-mirror-MK0331YHH47YRA /dev/ada2
gpart create -s GPT /dev/ada4
gpart add -t freebsd-zfs -l disk1-mirror-HUA723030ALA640 /dev/ada4