HAST
FreeBSD's way of mirroring a disk across the network to another machine, block by block, so a server can die without taking its data with it.
Highly Available Storage was written by Paweł Jakub Dawidek with FreeBSD Foundation sponsorship and shipped in FreeBSD 8.1 in 2010. The hastd daemon runs on two nodes; the primary exposes a GEOM provider under /dev/hast/, and every write to it is also sent to the secondary. You put whatever you like on top, UFS or ZFS. Replication can be synchronous, asynchronous, or a middle mode that acknowledges once the data has reached the peer's memory.
HAST doesn't switch roles by itself. That is usually left to CARP plus a script that runs hastctl role primary when the virtual address moves. The idea is the same as DRBD on Linux, and as there, the hard part isn't the replication but avoiding the state where both nodes believe they are primary.