Should I use ZFS RAID or mdadm RAID 1

Hi, I have two SSD disk with a partition on each for lxd.

I am just wondering if I should use mdadm and present a single RAID 1 device to lxd or use ZFS builtin raid for the job? If the latter, any pointers?

Use the ZFS built-in RAID.

mdadm RAID isn’t aware of usage on the block device, so in the case of a rebuild, the entire existing drive will have to be replicated to the replaced drive, possibly causing such load that the remaining drive may itself fail.

Instead when using ZFS raid, only the data actually on disk will be replicated to the new drive, making it significantly faster and less likely to cause a failure of the remaining drive.

There are also a variety of other benefits such as ZFS’ ability to automatically heal by being able to look at the stored value on both drives and compare that to expected checksum which it couldn’t do if both drives showed up as a single block device.

Thanks for the info, it looks like this is the necessary command. Just posting below for anyone stumbling upon this.

zpool create -m /mnt/lxd-zpool lxd mirror /dev/sda4 /dev/sdb4