Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZFS filesystem vs ZFS pool

Tags:

zfs

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.

like image 427
dorinand Avatar asked Apr 20 '18 06:04

dorinand


People also ask

What is a ZFS pool?

ZFS pool (Zpool) is a collection of one or more virtual devices, referred to as vdevs that appear as a single storage device accessible to the file system. The Zpool is the highest container in the whole ZFS system.

What file system does ZFS use?

ZFS and OpenZFS file systems use inline data compression as a built-in feature to reduce the number of bits required to store data. In addition to that, both ZFS and OpenZFS file systems support several compression algorithms, allowing users the option of enabling or disabling inline data compression.

Is ZFS the best file system?

ZFS may be the best-known enterprise-grade transactional file system to use storage pools to manage physical storage space.

What exactly is a Vdev?

The storage pool of ZFS constitutes one or more virtual devices that are, in general, called vdevs. A Vdev is either a single disk, or two or more disks which mirrors each other, or a group of disks that organizes together. The RAID layout sets on each vdev as opposed to the storage pool.


1 Answers

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.

like image 118
Dan Avatar answered Sep 24 '22 07:09

Dan