Getting older, not necessarily wiser!
In a previous post, I discussed a high level look at the ZFS file system. In this post I want to take a closer look at actually using ZFS, and where you might want to use it.
One thing I am not going to cover here is using ZFS as your root file system. Implementing ZFS as the root file system can get somewhat complicated pretty quickly, depending on your Operating System. Our discussion here will be limited to creating ZFS mirrored file systems for storage.
Also, I am going to stay away form some of the more complex configuration and other things you can do with ZFS. The focus here is setting up some data storage.
ZFS is a combination Volume manager and File System. The below diagram represents the infrastructure of ZFS.
At the top are the actual physical Drives. These can be any type of storage device. The Drives are grouped into the VDEV. Each VDEV has its own configuration. The table below shows some of the various configurations that are possible.
Stripe |
Mirror |
RAIDZ |
RAIDZ2 |
RAIDZ3 |
|
---|---|---|---|---|---|
Number of disks |
1 |
2 |
3 |
4 |
5 |
Fault Tolerance |
None |
(N-1) disk |
1 disk |
2 disks |
3 disk |
Overhead |
None |
(N-1)/N |
1 disk |
2 disks |
3 disks |
Note that in RAIDZ or Mirror configuration storage is not the sum of all drives. In these two configurations some space will be used for redundancy. Mirror for example uses one drive to mirror the content of the other, so even though you have two drives, the available storage is equivalent of one drive.
A ZPOOL is made up of one or more VDEVs. The total storage is based on the individual storage of each VDEV. To access your storage you must set up a DATASET.
A DATASET is a file system.Β You can have several DATASETS within your ZPOOL, each mounted to a different spot.
For my working example I will set up a Fault tolerant two disk MIRROR, which is similar to RAID1 (Standard Raid Levels). In this type of setup, data is written to both disks, and each of the two disks is identical. If one of the disks fails, the other disk still contains all the data and will continue to function.
In this example I will attempt to install ZFS on Debian Bullseye. We will need to add the zfsutils-linux package to work with a ZFS file system. This is part of the contirb repository.
Many of the instructional tutorials that I have read use the back-port repository. But since this is a new ZFS install, and looking at the versioning, I donβt think it is necessary with bullseye. If I had an existing ZFS file system, then I suspect I would need the back-port. We shall see what happens.
Also I will be using partitions instead of entire disks for this exercise. As the computer I am installing on has only one internal drive, and this is just proof of concept.
This process has been carried out on a new minimal Debian installation (see this post). It is GPT with one partition for root. I have created two additional partitions which are currently unused.
deb http://deb.debian.org/debian/ bullseye main contrib non-free
zpool create testpool mirror /dev/sda4 /dev/sda5
What this has done is create a ZPOOL and mount it at the root level, /testpool. Additionally, it has created a VDEV called mirror-0 that consists of /dev/sda4 and /dev/sda5. ZFS will automatically mount this file system at reboot.
In this post we have looked at creating a simple ZFS mirrored file system under Debian. I have endeavored to explain the various levels of a ZFS file system with an example. There is plenty more that can be done with ZFS. We have just scratched the surface here.
Add New Comment