Q:

ZFS filesystem vs ZFS pool

ZFS pool may consist of datasets(file system, snapshot, etc..) or volumes. ZFS volume is like block device, but I am do not understand difference between pool and filesystem. When I created pool1 via zpool create pool1 sda sdb sdc and than  zpool create pool1/fs I can see two new lines in df -h output with pool1 and pool1/fs. The same in zfs list output. Now, I can copy files into pool and into fs. I can set dedup or compression on both. So what is the difference? Why should/shouldn't I crate filesystem in pool? Please include some example of usage if possible.

A:

A pool is a collection of disks, where you can store filesystems and volumes. When you create one, you also get one base-level filesystem that all the other filesystems you create will inherit properties (such as compression algorithm to use, etc.) from.
A filesystem is something that you can write files into, and they all use storage from your pool to write their data. Usually you group logically similar data into the same filesystem, since that way you can treat all that data the same w.r.t. compression, snapshotting, etc. You can share filesystems to other computers over the network through NFS.
A volume (aka a zvol) is a fake disk that uses storage from your pool to write its data. It's kind of like one big file, except that you can also do compression / snapshots / etc. to it directly instead of through a filesystem that contains it. Typically you would only create volumes if you are running a VM. Although I believe you can create a pool based on a group of zvols (a pool within a pool), in general that is not a good idea (it's useful for testing by ZFS developers, though). You can share volumes to other computers over the network through iSCSI or FibreChannel.

