ZFS
RAID
RAID types
mirror - RAID1
raidz - RAID5
raidz2 - RAID6
Create RAID
# zpool create -m none data-pool mirror /dev/disk/by-id/ata-Hitachi_... /dev/disk/by-id/ata-SAMSUNG_...
Replacing disk
# zpool replace tank /dev/disk/by-id/ata-Hitachi_... /dev/disk/by-id/ata-SAMSUNG_...
# zpool replace data-pool /dev/disk/by-id/ata-QEMU_HARDDISK_QM00011-part1
Removing disk
# zpool detach tank ata-KINGSTON_SEDC500M1920G_50026B76839BEFE8-part3
Add devices to pool
# zpool add hdd-pool raidz /dev/xvdf /dev/xvdg /dev/xvdh
Enable periodic scrub (FreeBSD only)
# cat << EOF >> /etc/periodic.conf
daily_scrub_zfs_enable="YES"
daily_scrub_zfs_default_threshold="28"
TRIM (Linux only)
# zpool trim data-pool
# zpool status -t data-pool
Misc
# zfs create -V 10G tank/storage
# zfs get volsize tank/storage
# zfs set volsize=50G tank/storage
# zfs create -V 4G -b $(getconf PAGESIZE) -o compression=zle \
-o logbias=throughput -o sync=always \
-o primarycache=metadata -o secondarycache=none \
-o com.sun:auto-snapshot=false rpool/swap
# zfs set compression=lz4 data-pool/data/logs
# zfs set compression=off data-pool/data/logs
# zfs set quota=20G data-pool/data/ISO
# zfs get all data-pool