In this video, you'll learn about Stratis.
So what is Stratis?
Well, it is adding volume management capacities
as a separate layer to the XFS file system.
And that's the reason why Red Hat created Stratis.
And that is because there are alternative file systems
like ZFS and ButterFS, which have volume management
capacities.
Red Hat is not impressed from the stability of ButterFS.
And ZFS is not compatible with the license of the Linux kernel.
And that is why something else was needed.
So Red Hat has considered that XFS is a very mature file
system.
And they added Stratis as an additional layer to XFS.
So Stratis volumes always use the XFS file system.
And Stratis volumes, and that makes it special,
are thin, provisional by nature.
That means that you don't specify a size.
And volume storage is allocated from the Stratis pool.
Now, each Stratis volume needs a minimal size of 4 gigs.
And because of thin provisioning,
Stratis tools must be used to monitor available storage
space.
Let me make a quick drawing so that you
can see how the architecture of Stratis is organized.
OK, so let's try to understand Stratis and how it's organized.
As you will notice, it looks a lot like LVM.
Because in Stratis, there is also a pool.
But Stratis is using a Stratis D. And Stratis D
is a user space daemon that allows applications
to talk to the pool.
Now, at the lower end of Stratis,
you are going to add the block devices.
And the block devices can be any block device.
Could even be an LVM logical volume.
And that makes the Stratis pool a resizable SL.
Then on top of the Stratis pool, we have the file systems.
And these file systems, well, they
are XFS file systems by default.
And the essence of Stratis is that we have thin provisioning.
And that means that the amount of available storage
for each of your file systems is the amount
of available storage in the pool.
You don't set the size limit on the file system.
Your size limit is set right here.
And that makes it flexible.
And that makes it you will never run out of storage
on your file system again.
Now that you understand how it works,
let's create some Stratis volumes.
To work with Stratis, you will need the Stratis D
and Stratis CLI packages.
Use the Stratis command to create
the pools and file systems.
And do notice that this command is also tab completion.
While working with Stratis, you can use Stratis pool list
to ensure the pool has sufficient space remaining.
And to mount Stratis volumes, you use the UUID.
And you include xSystemD.requiresStratisD.service
as the mount option.
Now, here we have the complete procedure.
Let me show you how it works.
Now, before starting this, I'm going to add two more disks
because Stratis has a lot of disk space requirements.
So let me switch off my virtual machine
and add two more disks to it.
So let's verify LSBLK.
It's showing that we have two new disks.
As you can see, the disk names have changed again.
And the new disks are now known as NVMe0N1 and NVMe0N3.
Good.
Let's prepare for Stratis using DNF install, Stratis CLI,
and Stratis D.
Now, Stratis comes with a daemon.
So I need systemctl enable, minus minus now,
Stratis D to make sure that this daemon is enabled
and it is running.
And then I can use Stratis pool complete to create the pool.
So Stratis pool create, mypool, slash dev, slash NVMe0N1.
Be mindful of the device names that you are using here,
particularly if they are changing all the time.
Next, Stratis pool list.
And there we can see that we now have a pool with the name
mypool, a size of 20 gigs.
And a total of half a gig is already used.
That's for the Stratis metadata.
Now, I can easily add more storage
to the pool using Stratis pool.
Add data, mypool, slash dev, slash NVMe0N3, for instance.
And now when I repeat Stratis pool list,
you can see that the pool is four gigs in total,
still half a gig for metadata.
Another useful command is Stratis block dev list.
That is listing the block devices
and where the block devices are.
So let me continue.
Now that I have my pool, I can create my file system.
So Stratis fs create, mypool, myfs.
And next, I'm going to use Stratis fs list.
It's pretty simple.
You have three elements, the pool, the block dev,
and the fs.
And you can list all of them.
And we can see that in mypool, we have a file system, myfs.
And look at that, with a total size of one tebybyte.
Where does this one tebybyte come from?
Well, it's a thin provisioned file system.
And the thin provisioning is a function
and the thin provisioning is representing
one tebybyte by default.
Now that's a lie, of course, because my underlying storage
is only 40 gigs in total.
And that's something that you need to be very aware of while
working with Stratis.
Your traditional tools are reporting disk space
availability that is not really there.
So you need to do that in a different way.
But let me first show you how we can mount this.
So I'm using mkdir slash myfs.
And next, I'm using lsblk minus minus output is UUID
on dev Stratis, mypool, myfs.
That is showing the UUID.
And I need this UUID in the etc fs step.
This is just another way to show you the UUID.
I could have worked on org and the output of Stratis fs list
as well.
But we haven't seen lsblk minus minus output is UUID yet.
So what do I have in etc fs step?
Well, in etc fs step, I now have this UUID.
And on the next line, I have the actual UUID.
So I need to change them and put it together to make sure
that we can mount it the right way.
So UUID equals, and that is what we
are going to use as the starting point.
The starting point for what?
Well, for the mount.
So I need UUID equals, and that is
what I'm going to mount on myfs.
And the file system is xfs.
And then we need the default mount option,
but also xsystemd.requires is Stratis d.service.
And next, we need the 0 and 0.
The xsystemd.requires is Stratis d.service
is very important for dependency handling.
Because if you don't do that, you
risk during the reboot that Stratis d is not yet present,
and the mount will fail, and you will be in problems.
So the demo continues on the second slide.
As you can see, we're almost there.
And let me show you how it works out.
Starting with Stratis FS list, which
is showing the file system.
Well, we have already seen that.
Stratis pool list, which is showing the pool.
Now, if you want to monitor available disk space
in Stratis, Stratis pool list is what you want to do.
Because here, we can see that in total within the pool,
we have 38.93 gigabytes available.
The essence of Stratis is that all file systems in the pool
can use all the remaining disk space within the pool.
So your file system doesn't have a specified size anymore.
It's the pool that is handing out available blocks
to the file systems.
And these file systems can grow dynamically
to make sure that you will never be in a situation
again where one file system is completely full,
and the other file system still has available blocks.
So you use Stratis pool list for monitoring.
Now, what is df minus h giving me?
OK, before continuing, I want to mount my Stratis volume.
And now, we can check what df minus h is giving me.
And look at that.
Here, we have df minus h giving DevMapper Stratis
with a very long name, with the size of 1 terabyte,
and use of 20 gigs, and available of 1 terabyte,
approximately.
So df minus h is not reliable.
And that means that Stratis is giving a nice new way
to work with storage.
But your traditional utilities to monitor
the availability of disk space are unreliable.
And that is something that you really
need to keep in mind while working with Stratis.