Continuing from part 4, in today’s post we’ll learn how to create ZFS data set for a user and mount it to a directory for use:
1. Issue the following commands at the terminal to view zpool status and the available capacity –
sudo zpool status
sudo zfs list
2. Now, we’ll create a ZFS data set called ‘myData’ in ZFS pool ‘myPool’ and enable compression, deduplication and 1 GB quota for the data set. Issue the following commands at the terminal –
sudo zfs create myPool/myData
sudo zfs set compression=on myPool/myData
sudo zfs set dedup=on myPool/myData
sudo zfs set quota=1g myPool/myData
3. Now, we’ll create a desired mount point for myData on Desktop of user ‘ihaveapc’, modify it’s premissions and modify the ZFS data set ‘myData’ to be mounted to this directory. Issue the folowing command at the terminal –
sudo mkdir /home/ihaveapc/Desktop/myPrecious
sudo chmod -R 777 /home/ihaveapc/Desktop/myPrecious
sudo zfs set mountpoint=/home/ihaveapc/Desktop/myPrecious myPool/myData
4. Now we’ll verify that the properties of the ZFS data set ‘myData’. Issue the following commands at the terminal to verify the quota, mount point, compression and deduplication –
sudo zfs list
sudo zfs get all myPool/myData | grep compression
sudo zfs get all myPool/myData | grep dedup
The user can now store his data in directory ‘myPrecious’ and it will get stored in the ZFS data set ‘myPool’ with compression and deduplication. In part 6, we’ll learn how to backup and restore this data via ZFS snapshots and ZFS clones.
[…] [To be continued in Part 5…] […]