Instructor: The xfs_info command.
Hey, beautiful people.
In this lecture, we will learn about
xfs_info command in Linux.
Before we jump into the details of this utility,
let's first refresh our understanding of XFS file system.
Why?
Okay, because the xfs_info utility is designed
specifically to work with XFS
and revising the basics of XFS file system
will definitely help you see exactly
how this tool fits into the bigger picture.
So XFS is a journaling file system in Linux
that organizing data into a hierarchical structure
or directories and files.
It efficiently manages disk space and ensures data integrity
by keeping a log of changes
before they are actually made.
Now let's move on to our main topic about xfs_info utility.
According to man7.org,
xfs_info displays geometry information
about an existing XFS file system.
Let's put it in simple words again for you.
The xfs_info utility is used to display detailed information
about an XFS file system such as its size,
block size, and how the file system is structured.
It's helpful for understanding the current configuration
and layout of an XFS file system on a disk.
It provides a quick overview without modifying
the file system in any way.
Furthermore, xfs_info is important for system monitoring,
troubleshooting, and capacity planning.
The syntax of or syntax for using xfs_info
is as straightforward as it gets.
Just type xfs_info command followed by the partition
you are curious about like let's say /dev/sda.
Now let's quickly go over its history.
In 1994 XFS was first introduced by Silicon Graphics.
In 2001, XFS was ported to the kernel
or Linux kernel and utilities like xfs_info
were made available for Linux users.
Then in 2002, the xfsprogs package,
which includes xfs_info,
was officially released for Linux distributions.
In 2014, XFS became the main file system
for Red Hat Enterprise Linux 7,
making tools like xfs_info even more important.
As of today, continuous improvements have been made
to xfs_info as part of ongoing updates
to the xfsprogs package enhancing its functionality
and reliability.
Okay, now let's go ahead and do some practice.
So I have already opened the PuTTY session here.
The first step, always do check who you are.
We are logged in as root.
Which directory you are in,
you are in root directory.
Host name is my first VM.
Let's type the ip a command
to see IP address of this machine.
Here you can see my IP address
is 192.168.100.159.
All right.
On your case it may be different,
but for me, I am in the right machine
and you need to make sure you are logged into
the right machine as well.
Perfect.
Let's start by checking which file system
your system partitions are running on.
For this, we use the df command with the T
or uppercase T option.
Here T option shows the different type of file system
that your machine is using.
When you run this, you'll notice two key players,
the root and boot partition,
both powered by XFS file system.
This tells us that your system is built on XFS
with the root partition handling most of the system files
and user data,
while the boot partition contains the important files
needed to start up your system.
Let's take our explanation a step further
and dive into the specific of the xfs_info command.
To uncover its full potential, let's use the man command.
It will give you access to the xfs_info manual page.
Here are two simple options for using
the xfs_info command, T and V.
The T option allows you to specify
a different mount table file while V option
only displays the version number.
Alright, next, if you're looking at the example below,
the xfs_info output highlights five key areas,
meta data, data, naming,
log and runtime.
Each of these points gives you important information
about how your XFS file system is organized.
By understanding these, you will be better equipped
to monitor your system health, troubleshoot issues,
and plan for future capacity.
Yep, that's why I am including this lecture in this course.
So metadata stores information about
the file system structure like file names,
sizes, and permissions.
Data shows how the actual data is stored,
including block sizes
and the total number of blocks available.
Naming relates to how file names
and directories are handled within the file system.
Alright, log is the journal that helps protect
data integrity by tracking changes
before they are fully written.
Finally, realtime refers to a special area
for handling realtime data,
but in this case, it's not being used.
Let's quit from this.
Let's first check which version of xfs_info you're running.
Simply type xfs_info
with minus uppercase V option
and you will see the version displayed here
and right now it is 6.4.0.
Now let's get some real data
and see the details of the cs -root partition.
And by the way, if you are running
the xfs_info space version
and your version is different or higher,
it doesn't really matter.
What we are trying to understand
is how to check the version.
Alright, now about the partition.
For this type xfs_info, space,
the path of the partition
and that is /dev/mapper/cs -root
and hit enter.
Let's see what this information shows.
First, refer to the metadata.
It indicates that all information related
to the cs- partition.
This petition uses 512 bytes inode size
divided into four groups.
It means each inode, which is a data structure
storing information about a file such as its size,
ownership, permissions,
and disk location occupies 512 bytes of space.
The file system is divided into four allocation groups,
each managing its own set of inode and data blocks.
Data blocks hold the actual content of files
such as the text, images, or any of the data.
The meta data also shows support for attributes
CRC and reflink feature.
Attributes allow for storing additional meta data
for files such as security labels
or custom tags are, sorry,
CRC ensures data integrity and reflink
or reference link allows for copying files by sharing blocks
between files.
Moving on to data section.
That shows us uses a block size
of four kilobyte with a total of 17 gig blocks available.
Then you have naming here,
version two indicates an updated naming convention
while 4,096 byte block size specifies
the size of data chunks used in storage
and file type support means it can handle
various file formats.
Then you have log
that uses 4,096 byte blocks
and contain 16,384 blocks.
Lazy counting is enabled,
which means it tracks changes only when necessary.
Finally, you have real time.
It's none.
That means there is no special areas
for handling real time data.
Alright, that's a wrap for the xfs_info command.
Now, again, as I always say, it's your turn to dive in
and practice.
Open your terminal and run the xfs_info command
on your file system and see what you discover.
All right, I hope you learn something useful in this lecture
and I'll see you in the next one.