ZFS is pre installed in FreeBSD. To start off with ZFS on FreeBSD, we would just need to start the service. To start the service, we would need to add enable the service in /etc/rc.conf.
Add the followinng line to /etc/rc.conf
NOw that we have enable the service in /etc/rc.conf, we can now start the service using the following comamnd.
service zfs start
We can have a dedicated hard drive for zfs pool. Here in this case the drive is ada1(The drive attached to the second SATA port)
zpool create pool1 /dev/ada1
Now we can check if pool1 is mounted to /pool1 folder by using the command “df”.
root@bsd:/pool1 # df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ada0p2 7705916 1772236 5317208 25% / devfs 1 1 0 100% /dev pool1 10708914 31 10708883 0% /pool1
We can also use the mount command to check the details.
root@bsd:/pool1 # mount /dev/ada0p2 on / (ufs, local, journaled soft-updates) devfs on /dev (devfs, local, multilabel) pool1 on /pool1 (zfs, local, nfsv4acls)
We can get the status of the pool using the following command
zpool status pool1
The output will be similar to the following
pool: pool1 state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM pool1 ONLINE 0 0 0 ada1 ONLINE 0 0 0 errors: No known data errors
Now that we have done all the necessary tests, we can now try creating a file inside this zpool.
cd /pool1 touch testfile