Yes, this is possible. If you read a little on ZFS, you’ll find that it’s basically a pool of so-called “vdev”s. The simplest vdev would be a plain physical drive. It could also be a mirror consisting of two or more physical drives. This is what you want.
You’d go for this structure:
d1 d2 d3 d4
\ / \ /
To create this zpool, use the following command:
zpool create mypool mirror d1 d2 mirror d3 d4
This will result in a usable capacity of 9 TB. It can tolerate one drive failure per mirror vdev. (Unless you add more mirrors, of course.)
If you want to add vdevs later, use this command:
zpool add mypool mirror d3 d4
To extend the pool size, first enable the
zpool set autoexpand=on mypool
Then replace one of d3/d4 with a larger drive and wait for it to rebuild. After that, replace the other. The pool should automatically expand to the available drive size.
It might be desirable to turn off
autoexpand after the job is done.
Alternatively, you can leave
autoexpand alone and use the following commands after you replace both drives:
zpool online -e mypool d3
zpool online -e mypool d4