So on this lesson,
we're going to walk through some of the commands
to properly manage our file system.
For this example, we're going to use the same backup system
that we just created prior.
Because backups are critical to businesses,
you want to make sure you perform a scheduled maintenance
on each file system to spot any errors
that could corrupt the data or make it inaccessible.
Also, a common thing that happens
in organizations is the need to expand
or shrink storage as the entities grow.
You'll also need to ensure
that you resize the file system as well, or the users
and the apps will not be able to use the newly added space.
So let me get started. The first thing we're going to do,
I just want to use the lsblk command.
We're going to use the F option saying we want to look
at the file systems associated with the storage.
Now I love this view, it's a very clean view,
you can see all the partitions to the left
and you can see the file systems and you can see the UID
and the mount points to the right.
It's a very quick and easy way
to kind of see how our system is laid out.
So next thing we need to do is scan our systems
and this is how we're going to go through
and check to make sure that there's no errors
on our file systems.
So the first thing we need to do is unmounted
the logical volume from the associated mount point.
So going to use the dev, backup
and we'll use the data backup system first.
Okay.
Next thing I want to do is use a file system check command.
So I wanted use it on the data backup logical volume
to make sure everything is good to go there.
Okay. Now we see it gives us a clean response.
That means everything is good to go on this file system.
Whenever the system boots up,
the file systems automatically run this check.
Different type of shutdowns, hardware failures
or reboots can cause an error.
So it's always good to do this every so often
just to make sure that the system is good to go.
The next one we're going to do is an XFS system.
So again, we have to unmounted that system,
so we're going to use the dev backup
and we're going to use the system backup logical volume.
So let's get rid of this, unmounted that,
and now for XFS we have to use the XFS repair command.
Okay. Now you see, it wants to go through these phases,
this is letting us know
that it's checking every single piece of this file system.
And for the XFS,
this is the type of output you're going to receive.
So when you get that done there at the bottom,
that shows that there's no errors
and we can move forward.
Now, another command that we can use to
check the file system is the E2F system check.
And this of course associated
with the EXT4 file systems or three or two,
and we're going to use this force option.
So this end, even if the system runs clean
we want to make sure that we're checking everything.
So we're going to do it again.
Okay. So next thing we want to do is extend the volume drive.
So we're going to do LV extend command.
And now this option, the L option,
is going to let us know which is
the size that we're going to associate to this volume.
And we're just going to do three,
we're going to make it three gigs,
and we're going to do that for the backup system.
All right, so the data backup system has now changed
from two gigabytes to three.
Now, of course, we need to check the system again,
make sure there was no errors after we extended that size.
So it's going to scroll up, arrow up,
and get to that command again for convenience.
Run the check again.
Good there.
Now, since we increase the size of the volume
we need to increase the size of the file system as well.
It's not an automatic thing.
So we're going to resize to FS.
Dev
Data back
Now with this output, it lets us know that the file system
is now resized and it indicates the new length
of blocks associated with it.
So let's go ahead and mount this back,
all right, and ensure that it's associated.
We can see it there at the bottom.
Okay. The last thing we're going to do is increase the size
of an XFS file system.
So we're going to use the LV extend again,
and this time I'm going to use it for the system back up.
We're going to turn it into,
going to get 2.75, just to save space.
Okay. We see what's successfully resized.
Now, when using the XFS system,
and you're trying to increase the size of the file system,
you must first actually mount the file system.
So that's something of note with the XFS versus the EXT4.
So we can go here.
Okay.
So I'm going to use the FXS,
grow file system,
go to dev/backup/sysbk,
and the biggest thing we're looking for is the bottom
letting us know that the data blocks changed
from one size to another.
And since we've tried to increase it
the smaller number needs to be to left, of course,
the larger number to the right.
So in this walkthrough
we demonstrated another command with the LS block command
showing us a different way to view our logical volumes
and their associated mount points and their file systems.
We also learned how to use a file system check to make sure
that we have great integrity and validity
of our file systems.
We went through how to extend the logical volumes
and also their associated file systems.
And also the note, there's key differences
between the EXT4 file system versus the XFS file system.
Thank you, and I'll see you in the next lesson.