In this video, I'll tell you a bit about ButterFS.
Btrfs is to be pronounced as ButterFS.
And that is because butter comes from a cow.
That's a joke by the main developer.
Cow stands for copy-on-write,
and copy-on-write is the strategy that is used
to guarantee file integrity on ButterFS.
ButterFS is also a B3 file system.
B3 is the database that is used behind the file system
for storing your files in the most efficient way.
It offers advanced features such as volumes and copy-on-write.
Copy-on-write means that if ever you are changing a file,
before changing it, the original file is copied to another location,
so during the change, something is going wrong,
you can always easily revert to the original file.
As I just mentioned, because butter comes from a cow,
we call it ButterFS and not Btrfs or BetterFS,
even if there's people that like calling it that way.
Now, ButterFS is the default file system on Fedora Linux,
and you will find it on some other Linux distributors as well,
but not on the main distributors that we are using for this course,
which are CentOS and Ubuntu.
And for that reason, I'm not going to demonstrate,
but on the Linux Plus exam,
you need to know a little bit about it.
So let's go through it.
One of the reasons that ButterFS was created in the first place
is because of ZFS.
ZFS is a file system that comes from BSD Unix,
and it provides flexible features,
but this file system is a license that is not compatible
with the Linux kernel license.
And for that reason, you will never see ZFS ever supported
in one of the main Linux distributions.
And that is why ButterFS has been developed as an alternative.
Another alternative for providing similar features is Stratis.
Stratis is used on Red Hat environments,
and Stratis is a volume manager that can be used
below the XFS file system.
So Stratis is not a file system.
Stratis is the volume manager below the XFS file system.
One of the features in ButterFS is the subvolume.
A subvolume allows you to add properties to directories
that you can normally only set on storage devices.
So let's use noexec as an example.
Noexec is a property that makes it you cannot run
any executable files from a directory.
If you want to use noexec on XFS,
then you need to create an XFS file system.
If you want to use noexec on ButterFS,
you can just do it on a directory
by making that directory a subvolume.
ButterFS has different utilities,
like ButterFS file system show and ButterFS file system label
and ButterFS subvolume list or subvolume create.
You can also use the ButterFS subvolume home option
to the user add command on distributions
that are supporting ButterFS.
And that makes that a user is getting
a ButterFS-based home directory.
One of the interesting features in ButterFS is a snapshot.
It comes with enabled snapshot functionality.
And making a snapshot allows users
to freeze the current state of files,
and that is useful before performing tests.
If desired, it is easy to revert to the previous state.
Snapshots are created on a subvolume level,
and the command to use is ButterFS subvolume snapshot
followed by slash files,
which is the name of your subvolume,
and slash files slash snapshots,
that will be the name of your snapshot.
And to figure out if you have any snapshots,
use ButterFS subvolume list.
And once you want to revert to a snapshot,
ButterFS subvolume set default 258 slash files
allows you to set the snapshot ID
as a new mount point for a directory.
And then you will have immediately returned
to the original state.