And yes,
we're now going to take a look at xfs, so adding a
filesystem to our second partition,
looking at some of our toolset for the xfs filesystem, as well as
demonstrating the dynamic nature of xfs by defragging the existing root
filesystem. And here we are on our Alma Linux 8 system.
Our root filesystem should be xfs, and we can check this with df
‑hT and then /, and we can see, then both the free space that's
available, but importantly for us, we want to look at the filesystem type,
which is xfs.
Now honestly, being xfs,
we're going to be able to use our xfs toolset against this,
including reading information about the number of blocks that are
in use and the block size, and that then comes to the xfs_info
command, again looking at our root filesystem. We would also see
this xfs_info information on a new filesystem that we had created
when formatted with xfs.
One of the really cool things about an xfs filesystem is even
though whilst the filesystem is mounted and in use,
we can go through and make better use of the disk space by
using defrag to tidy up the filesystem.
We can see all of the available toolset with xfs_ and double tab.
We want fsr to be able to go through and defrag, so ‑v will show us
the defragmentation as it happened, and again, for our root
filesystem, and we can see, then as we find iNote, starting moving
those iNotes around.
If I try and defrag it again,
it tells me now that I don't need to. We're fully defragmented, and
all of this whilst the root filesystem was online.
But don't worry, we're not going to stop there.
We're going to look at how we can go through and create xfs filesystems. We can
use mkfs and dot, and then it allows us double tab, so we can go through and
start taking a look at the available filesystems.
Another way would be mkfs ‑t, specify the type of filesystem that
we want, and we're going to now create an xfs filesystem on our
/dev/loop1p2, the second partition.
I don't need to worry about opening it because it was not
encrypted like the first partition.
So now that this is set,
we see the information that we saw with xfs_info before, this time, of
course, relating to the new partition. And if we want to go through and take
a look at setting a label similarly to what we did on the ext4, we can go
through and use our xfs_admin and ‑L, and then go through and specify our
marketing label on then loop1p2.
So look at that. We've got our label set.
So there you go, a quick introduction to the xfs filesystem, which I hope you enjoyed.