# Create and Use ZFS Pool ## Install ZFS ``` apt install zfsutils-linux ``` The initiall install may give some errors, but that is okay. Simply reboot to fix it. ## Create Pool if you want to create a raid-10 setup with four disks, we can run: ``` zpool create ${poolname:?} mirror ${mirror1dev1:?} ${mirror1dev2:?} mirror ${mirror2dev1:?} ${mirror2dev2:?} ``` Make sure to pass device names as given by `/dev/disk/by-id`. If you give `sda`, `sdb`, etc, the pool will break if the system ever changes which physical disk the name `sda` refers to. The names in `/dev/disk/by-id/`, however, are guaranteed to always refer to the same physical device. ## Create Datasets ``` zfs create ${poolname:?}/${datasetname:?} ``` ## Setup Auto Snapshots ``` apt install zfsnap ``` put your commands in crontab.