All right, welcome to module 104.2,
where we're going to take a look at maintaining file systems and
learned you some of the commands to see the fall systems that we have available. Thio make a false system and to do a little bit of investigation
as to the characteristics and details of a given follow system.
So far, all systems and Lennox are just like fall systems and most other operating system they do require maintenance.
Some of the maintenance can be done automatically if we configure the system to do that,
or occasionally, we have to do the maintenance manually
when there is a problem that gets discovered.
verifying the integrity of a false system.
For instance, if a system gets shut down suddenly
there's a good chance that there may be some file system corruption.
The way that we normally deal with this is to run the file system, check command,
typically, when the file system is not mounted. If you run it when the file system is mounted, you definitely risk
doing some damage in most file system check commands won't even run when the file system is mounted.
There's also, you know, some of the background details to think about where
and pointers to files, director entries and so on. They could become a little bit
corrupted when these power loss events occur, or when there's
other situations where the file system is not unfounded. Gracefully,
all of our mass storage devices that we see here
disc floppies, tape drives, flash drive, CDs, DVDs,
they all have the capability to have a file system, and some of them support various multiple choices for creating follow systems.
We even have the journal file system, and we see there's a very nice collection of
benefits and Jerling supports.
In a nutshell. A journal file system gives us a lot more recover a bility after some sort of a disruption.
There was a little bit of overhead in order to track the transactions of writing to a file or reading from a file.
And so therefore, there is a slight performance dip
that journal file systems may experience.
But in a powerful modern system, this may not be something that's a big deal. It may be something that's
relatively easy to deal with
now, the operating system
in a drawer journal file system will actually
create a journal entry to show what type of operation needs to occur, whether it's a
the operating system itself or an application trying to write data to a file or to read data to a file video from a file rather
or to create files, delete them and so on.
And then once that journal entry is completed, then the operation actually takes place. This way we can preserve the ability to re create that transaction. If there's some sort of a failure. That's the main benefit
that we think about for Journal Fall Systems
And has this last couple of entries show us? If the Journal entry or of the Journal,
entry is not completed correctly
or has not been written completely,
then that change will be discarded. The Journal found System can only go so far to help protect
our potential loss of data.
So as I mentioned FSC K file system check. This is the command we typically think of when we're checking or verifying the integrity of a file system.
Now we can put entries into that C. F s tab.
This allows us to decide if a file system should be checked when the system boots and we can also define the order of checking.
There may be a good reasons for doing a check against one file system before others, just for performance reasons and so on. If you've got very large file systems, you may opt to skip checking during boot time because that may delay the boot process quite a bit.
For most modern systems, this may not be as big of an issue. It used to be back in the good old days, but
it's still something to consider
for a quick turnaround time when a reboot command is actually run.
Now we see an example here of half a CK dash. Why,
and what this does is answers yes to all the questions that FSC Kate will generate. If I've got a corrupted file system and run file system, check against it
as soon as it finds any irregularity missing block or a super block that's damaged or anything else of that nature,
it will prompt a question saying, Do you want to fix this? And you have to keep hitting the letter y
if I've got dozens or even hundreds, possibly even thousands of items that need correcting
hitting why can be pretty laborious. So we just can use the dash y option
in order to make that little bit easier.
And then we also have the dash a option to consider.
Let's first look at the help
gives us our version number.
There's are a gash y option for assuming yes, answered all questions.
We can also tell F S CK to use an alternate superblock. That's a pretty handy feature,
and we can see the superblock information, which is basically meta data for the file system.
As the file system gets used,
it needs to keep track of where everything is, and that's that information's basically held inside the superblock. Sometimes super blox get corrupted, and we have to tell
the operating system to use a different one because there's multiple copies.
And this is another bit of redundancy that's built into linens file systems.
We can also run F S CK with
the dash and option.
This gives us a chance to preview the changes, but doesn't actually make the change. And it's a way to kind of double check your work before you actually commit Thio Modifying a file system.
We have our desk p option for automatic repair.
This is sort of similar to dash. Why? Because the questions either they're answered automatically would dash, Why are we just don't see them with Dash Peak?
We could even use a dash after force the checking
And we can also declare that file system is
journal by using the dash J option.
Now we can see some different information if we look at the man at the man, Paige
and more specifically, what I was
The Dash eight option Here we go.
So if I use dash Capital A, this will look at first tab
and try to evaluate and verify the integrity of each file system that that's defined there.
That may be useful when you know you've got a bunch of small systems to find and you've got some corruption issues or integrity issues. You need to deal with that.
So right now, if I look at my mounted file systems,
I have my typical lyrics file systems and I also have
some. My CD ROM's mounted here, and I've got some different options.
So I've already created false systems on to partitions.
And I ran it against this file system. It again shows me my current version number.
And it tells me that currently the false system is clean. It's got, um,
a depiction of my number of files and the number of blocks.
So 11 out of 25,688 possible files
I can run this against my S t B to partition as well.
Now, this one's telling me that I can't run the command.
And the reason being is that
the file system underneath that that's created an STD one
It should be e x t three if I remember correctly.
File system for S t Be too. Is X f s. So I get a message from F ck telling me that I have to use xfx repair instead.
Let's look at our help
season my options here.
I can specify that I want to just do a check. Don't modify Dash and very similar to the way F s CK works
I can also specify Dash V for for boasts will do that when we when we run this
and I can even give it
basically a force option by telling it to repair dangerously.
So let's do effort except us repair
dash V for death S d B
We see we got a bunch of information there.
The dash V for both gives me a lot more data to look at,
so I can see it's verifying my superblock.
it looks like I've got 87,360 entries in my in my block. Cash
tells me that it's scanning my file system free space. I knowed maps,
and it shows me all the different phases
clearing unlinked lists, discover new. I know, discovering duplicate blocks.
It has a lot of different things to sort of clean clean up the file system. Basically, it's doing some housekeeping.
Now, what I can do is
I could mount the file system to see what we actually have.
So, Dev Esty, be one I'm gonna amount to a director I've already created called my data.
And then I'm going to mount Death S t B
I can run the d F. Command to show me that those file systems are now mounted. I use the dash H option,
which spells out my my
size characteristics using a human readable format like megabytes, gigabytes.
So there's those two follow systems.
Quickly, let's go back to our
We also have the tune F s
and this basically works very similar to,
uh, except fast repair or F s CK in that I can I can tell it,
Thio, let me interact with a false system in different ways. I can convert a file system to be journal by using a dash J option.
I could specify max number of mounts.
I can mount it read only if if I need to. I can look at my super blox display the universal, unique identify, which is basically a sort of a serial number for a file system.
All right, so now let's have a look at
Now, I know that this is used for money,
X t fall system. So I'm gonna run
on my A known at SD file system, which in this case would be best to be one.
I'm gonna put this tomb. Or so I didn't see what kind of information.
Oh, I forgot the dash l option. My mistake.
So if I had a volume name that would be shown here my u u i d. That I was just talking about that sort of a serial number for the file system
Tells me that I can turn on a journaling. I can resize I nodes Aiken,
uh, use my recovery options.
Currently, it's clean
file system type I've got, I know, count of block count free blocks
when it was created when it was mounted Some interesting
statistics here three times I've mounted this file system.
Find out when it was checked last
and a few more details showing me
the default directory hash and smother parameters
most of time. You don't need a lot of this information, but when you're trouble shooting and when you're
doing some fine tuning, it's good to be able to refer to this information.
do you and D F commands.
They stand for dis use and disc free
disc uses pretty handy because as an administrator
they'll be many times where you need to
identify the size of files, especially if you've got a file system that's filling up or is even full. And you're trying to locate
large files. And we saw how we could do that with find command. But disc use lets us do that in a slightly different way.
I can also display of the number of I nodes for particular files in the directory.
I could display the information and human readable format
and sort it, which is useful. I'll show you how that works here in a minute.
Then we have the D. F. The dis freak Ament.
This will show me on a per file system basis some of the statistics for money system.
Again, I have the dash H option for human readable capital Capital. H will give me the output in multiples of 1000 instead of 10 24.
Some people like that better. I prefer Dash H Lower case H for my purposes. I can also display the I knowed information with D f Dash I.
I can run d f specifying a foul system type
and then lastly, I have
the dash capital T option, which displays all the file system types,
So let's have a look at that.
doing a help command for D u.
We should point that to Morris. We can see a little bit
so summarizing disuse that dash A gives me all files,
not just directory, So that's pretty useful.
I can specify the information, but block size
using the V I nodes option
Human readable s for summary.
So let's go ahead and try for you. These
if I do run a d u Dash A
on a director that I know has a bunch of files in it. User
And it tells me each individual file that it finds going down that directory tree and
ah blocks it's using
now that the thieves blocked numbers are not easy to read. So
that's why typically, I would
Now I can see something more useful. Four K 64 K and so on.
That's a little easier for us humans to deal with.
Now, if I won, do you dash page
by itself on a folder? Let's say Espen,
they're running on the folder by itself. It just tells me that well, there's a director called Espen is not using even one block yet, but if I specify a wild card
to show me everything,
it will give me a human readable
and Dash a Goes will drill down into each directory as faras it confined file. So that's pretty handy when you want to do a deeper
surge for large files or even smaller files.
Now this is all listed in sorted or sorted by the name,
but maybe I want to sort it by its numeric value so I can play this
And this is pretty handy because now the biggest files will be at the bottom
and I can see here my largest file underneath that particular directory is Espen LD Config.
Now, if I run it with the dash a H option,
there's there's not much.
There's not many layers underneath that, so it's not giving me much of anything different.
Husband doesn't have his money
If I run this against user, it's gonna take a moment to, uh,
go find all this information.
slowly but surely we get through
and you can see it doesn't matter how many directories or some directors I have. It will drill down to all of those and tell me
that this particular item is my largest file.
So this particular command
do you deaf age on some path
sorting are piping that to soar dash and is extremely useful when you're just trying to do a quick and dirty Serge? Show me the largest file underneath this directory
and I can find it quickly.
It might even be faster than the find command. I really haven't done it a lot of comparison to see if that's true, but it seems like it's pretty quick.
I can also use the D. U dash s
and I'll run that against Let's say, User.
And it's just gonna tell me in each director underneath that that mount point or not, that I'm sorry that that mumbling each director underneath user that I confined it will summarize the size.
This might be even more useful in certain cases because I don't necessarily want to see every file. I might just go look for a director which has allowed a lot of data in it.
All right, now let's move on to the the disc. Free command,
I run just free Dash A. This is showing me all
file system that it knows about Sorry. On Lee
Mistake there. It's not file system to show me all of my
fake file systems as they're sometimes called.
We talked about these a little bit early in the chapter. Our temp, f s deaf temp F s.
my route file system.
It shows me real file systems as well. But I can also see things like
these air file systems that exist but may not actually be mounted because they're used by the Colonel.
But in any case, I might want to look at this information.
That could be good reasons to just do a quick check to see what kind of information
What kind of storage I'm utilizing
as before with do you command, I can run the d f Dash h and I could get a human readable output,
so it shows me things and gigabytes. Maga, bytes, kilobytes. As you can see here
If I run it with the dash capital H,
I get the multiples of 1000
you could see it's a slightly different
output. I've got eight gig for route there, and it says a 80.6 gig here.
This is kind of like the marketing megabyte versus the real megabyte.
Uh, as as I said before, I prefer lower lower case H. I just think that's more appropriate for most of the purposes that were considering
or run a d f dash, I command.
Now I can see how many I nodes are in use for each of these, not points
and as well as you might remember from previous conversations. I nodes are a finite,
uh, resource when the file systems created
and you can change their sides and you can make other adjustments. But
at least here I can see if I am running low. How many I notes Do I have free harmony? Are used percentage used.
This could be important, because if if I've got a file system with very large numbers of files, I may run out of, I know DS and I want to be able to prepare for that before that happens because that would cause
a process to die, an application to die. And that's obviously something we want to avoid.
Now, if I were the DF command with a dash lower case T. Aiken say, show me all the file systems at R E X t three, for instance.
In this case, only one of them shows up
my data, which I created earlier.
If I run it with dash Capital T
now, it will just show me the file system type of all of my fellow systems. We see that column here.
There's my CD, Rahm, I sew 96 60.
I got my exit fast file system. I created the X T follow system I created
and so on all the temp F s file systems that we just saw when I ran the d f dash A.
So I've got a good bit of information there, too,
to work with when I'm trying to troubleshoot various file system issues.
Now we do have other commands to consider. I showed you tuned to F s earlier.
two f s to show my superblock information.
I can run debug a fast. That's Ah,
come here that you probably won't have to use very often. But occasionally it is useful
if I'm creating riser F s
arap. Sorry, Riser file systems. I've got a F S tune command for this as well, and they're very similar. Let me let me show me the file system characteristics. Let me just a few things like block size number I nodes and things of that nature
Now for ex SS file systems, you'll see if there's several comedians that are specifically for X f s.
Now there's, as I've said before, another
sections of this course. There's usually more than one way to do something. So I may be able to run
some of these comedians
and get the results one way using the FX XF s underscore options or using a different command with a file system designator for except for us.
So you've got a few options there.
I can also grow a file assistant by running XF Asgrow F s. Now you do have to to make sure that the partition has some space for the file system to expand into no different than than what you would do for Windows for instance,
I've got my admin command to change some of the parameters I can use repair
very much like the F S C K command for non X F s file systems
and then finally a excess
as D B command, which lets me do some debugging of a false system. If it's got issues or some corruption, I could do a little bit of checking that way.
So let's go ahead and have a look.
All right, So have let's have a look at a few of these commands.
First, we're gonna run.
actually, before we do that, let's quickly look at the man Paige for that.
And as we can see, this lets us interact with e x t file systems and let's show lots of different details.
For instance, I might want to look at the super block information. Maybe I wanna play print my bad block list.
I said, you go ahead with that.
I'm gonna run that on my e x t file system, which is S t B one
and we can see that gave me a lot of info. Someone run again and pipe it more.
I've got lots of data here. My last mile point. My u U I d
Mount time information. Very similar to what we saw from,
so pretty Pretty good information shows me information about my my different range of blocks.
Show me how many are rain are free in each of the groups.
And if I run it with a dash h
omit the block information So it's sort of an abbreviated output.
I can also run debug
And this is just what it sounds like. It's to let you debug file systems.
Now, if I run it without any arguments,
and see what my possibilities are. I can open a file system.
So now I've opened Esty, Be one which should be mounted under my data. Come on. L s command. I can actually look in the file system.
remove files. I could make directories. I can even undo Lita file. Just kind of interesting.
And this shows me very similar information that I just saw from the dump command.
I label my U U I. D number file system features.
If I want to see features by themselves, I can just type
and shows me all the things that this particular file system supports.
So make a directory called New Directory.
Oh, I see that. Now let's tell me that it's mounted. Read only. So what I should be able to do here is close
close. False is okay.
Give me a different job command for that. That's fine.
It still doesn't like that.
What you can do is quit from D bag F s and I can run it again. This time,
what I'll do is I'll give it a dash. W option
And now you can see I was able to make the directory and now I can see that exists
another command we could use would be the riser, eh? Festoon?
No, I don't have any riser file systems installed. In fact, I don't even have the command installed. So I would have to use young or something like that. Install the tool to interact with the Reiser F s.
We can run X f s info. So if I run d f GHT again,
looks like my data to was not currently mounted. So I'm gonna go ahead mount that
My data to and as you're following along, you know, make your own directors make your own file systems. It's very
it's the best way to play around with these commands and get familiar without causing any harm.
Now, for one day of destiny, I can see that that my data to is an exit fast fall system.
So I'll run accent fast info
I know size information, my number of blocks, block size,
current version of the file system that some of its logging information
I can also run the grow F s command again. I have to
have a partition that's larger than the current file system. Then I could just specify size parameter and expand the file system into that new partition space.
Let's also do a man on X f s admin.
Just let me change my file system parameters.
So enabling journaling preaching the current label
printing the view You i d number.
So if I run except fast admin dash l for label
I don't have a label specified right now, but if I did, it would show me what it was. It's just currently blank.
Maybe I wanted quickly check my u U I d number.
Did you see again? There's many ways to do this. I could run,
you know, the info command and look at all the data or I can just specifically show this now if I run with with a dash cam Paul, you and I can actually set the u U I d them if I want to change this serial number, which I don't want to do right now. So I'm just gonna hit control C to get out of that
and that our last command is except faster d B.
So we're gonna man on that because that help doesn't give us much information.
And so just like d Block F s allows us to deal with debugging a e x t file system.
I could run except best DP to debug and accept s file system
with pretty much the same options.
interact using the menu system or run some of these options directly from the command line.
So I'm gonna go ahead and go into the
XF s d B and I want death. S d B two
tells me I can't run this on a mounted foul system. That's very typical. And we get a nice reminder, so I'll go ahead and I'm not that
now. I could amount by the device name or I can amount by the Mount Point, so I'll go ahead and specify the amount point in this case.
And that's my data, too
to get back to this command.
Now I can get into the menu.
What's my type? Question mark. I get my help,
and I can also type help. And the command itself, like help log,
shows me information about that particular command.
Some of the ones that are more useful. For instance, free space free SP shows me
my current percentage of usage of blocks and extents.
Maybe I want to display the label
again. That one's empty.
You i d number. I could display that
effectively. My serial number,
uh, and I can also run.
Run! Help him! Quick.
I've got some information about block use. It's a block free block. Get block use.
I do need to run block, get to, uh,
get the process going. So I run block yet
and from there, I should be able to run block use
Tells me I'm not using any right now because I really don't have any files in that
file system. Like free?
Not just yet. I think if I run, block, get again,
then block free. There's block at don't showing me my aggregate count.
Still not showing anything, but there's really no structure there, so it doesn't have much to look at. But you can see the usefulness of being able to get into a file system and have many different options for fixing problems, getting your statistics and dealing with your various administrative tasks.
So we covered the disc use command that this free command we looked at various different options to check file system, e x t file systems and excess bring particular,
and you should definitely spent some time practicing with these comedians and doing the various labs are gonna be available.
All right, so that gets us to the end of maintaining integrity of our file systems. Next way will spend a little bit more time dealing with mounting an amount which you've already seen. A little bit of that, but we're gonna have a little bit more practice and some other commands to show you.
All right, See you then. Thank you.