Time
8 hours 30 minutes
Difficulty
Beginner
CEU/CPE
10

Video Transcription

00:01
All right, welcome to module 104.2,
00:04
where we're going to take a look at maintaining file systems and
00:08
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
00:16
as to the characteristics and details of a given follow system.
00:26
So far, all systems and Lennox are just like fall systems and most other operating system they do require maintenance.
00:33
Some of the maintenance can be done automatically if we configure the system to do that,
00:38
or occasionally, we have to do the maintenance manually
00:41
when there is a problem that gets discovered.
00:45
Typically, we are
00:47
verifying the integrity of a false system.
00:50
For instance, if a system gets shut down suddenly
00:54
or loses power,
00:56
there's a good chance that there may be some file system corruption.
01:00
The way that we normally deal with this is to run the file system, check command,
01:04
typically, when the file system is not mounted. If you run it when the file system is mounted, you definitely risk
01:11
doing some damage in most file system check commands won't even run when the file system is mounted.
01:18
There's also, you know, some of the background details to think about where
01:22
file system blocks
01:23
and pointers to files, director entries and so on. They could become a little bit
01:30
corrupted when these power loss events occur, or when there's
01:34
other situations where the file system is not unfounded. Gracefully,
01:42
all of our mass storage devices that we see here
01:44
disc floppies, tape drives, flash drive, CDs, DVDs,
01:49
they all have the capability to have a file system, and some of them support various multiple choices for creating follow systems.
01:57
We even have the journal file system, and we see there's a very nice collection of
02:02
benefits and Jerling supports.
02:07
In a nutshell. A journal file system gives us a lot more recover a bility after some sort of a disruption.
02:15
There was a little bit of overhead in order to track the transactions of writing to a file or reading from a file.
02:21
And so therefore, there is a slight performance dip
02:24
that journal file systems may experience.
02:27
But in a powerful modern system, this may not be something that's a big deal. It may be something that's
02:34
relatively easy to deal with
02:38
now, the operating system
02:38
in a drawer journal file system will actually
02:43
create a journal entry to show what type of operation needs to occur, whether it's a
02:49
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
02:55
or to create files, delete them and so on.
03:00
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
03:12
that we think about for Journal Fall Systems
03:15
And has this last couple of entries show us? If the Journal entry or of the Journal,
03:21
uh,
03:21
entry is not completed correctly
03:23
or has not been written completely,
03:25
then that change will be discarded. The Journal found System can only go so far to help protect
03:31
our potential loss of data.
03:36
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.
03:45
Now we can put entries into that C. F s tab.
03:49
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.
03:58
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.
04:14
For most modern systems, this may not be as big of an issue. It used to be back in the good old days, but
04:18
it's still something to consider
04:20
for a quick turnaround time when a reboot command is actually run.
04:27
Now we see an example here of half a CK dash. Why,
04:30
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
04:41
as soon as it finds any irregularity missing block or a super block that's damaged or anything else of that nature,
04:46
it will prompt a question saying, Do you want to fix this? And you have to keep hitting the letter y
04:51
if I've got dozens or even hundreds, possibly even thousands of items that need correcting
04:58
hitting why can be pretty laborious. So we just can use the dash y option
05:01
in order to make that little bit easier.
05:05
And then we also have the dash a option to consider.
05:12
Let's first look at the help
05:15
forever. See Kate
05:17
gives us our version number.
05:20
There's are a gash y option for assuming yes, answered all questions.
05:27
We can also tell F S CK to use an alternate superblock. That's a pretty handy feature,
05:32
and we can see the superblock information, which is basically meta data for the file system.
05:38
As the file system gets used,
05:40
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
05:48
the operating system to use a different one because there's multiple copies.
05:53
And this is another bit of redundancy that's built into linens file systems.
05:58
We can also run F S CK with
06:00
the dash and option.
06:03
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.
06:15
We have our desk p option for automatic repair.
06:17
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?
06:28
We could even use a dash after force the checking
06:30
Dash V for boasts
06:32
And we can also declare that file system is
06:38
journal by using the dash J option.
06:42
Now we can see some different information if we look at the man at the man, Paige
06:54
and more specifically, what I was
06:57
looking for waas
07:00
The Dash eight option Here we go.
07:01
So if I use dash Capital A, this will look at first tab
07:06
and try to evaluate and verify the integrity of each file system that that's defined there.
07:14
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.
07:25
So right now, if I look at my mounted file systems,
07:29
I have my typical lyrics file systems and I also have
07:33
some. My CD ROM's mounted here, and I've got some different options.
07:40
So I've already created false systems on to partitions.
07:45
One of them is dead
07:46
s a d B. One.
07:50
And I ran it against this file system. It again shows me my current version number.
07:56
And it tells me that currently the false system is clean. It's got, um,
08:01
a depiction of my number of files and the number of blocks.
08:05
So 11 out of 25,688 possible files
08:09
and
08:11
8913 blocks,
08:13
I can run this against my S t B to partition as well.
08:20
Now, this one's telling me that I can't run the command.
08:24
And the reason being is that
08:26
the file system underneath that that's created an STD one
08:31
is
08:31
It should be e x t three if I remember correctly.
08:35
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.
08:52
Let's look at our help
08:56
and I can
08:58
season my options here.
09:01
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
09:07
I can also specify Dash V for for boasts will do that when we when we run this
09:13
and I can even give it
09:16
basically a force option by telling it to repair dangerously.
09:20
So let's do effort except us repair
09:24
dash V for death S d B
09:30
two
09:31
We see we got a bunch of information there.
09:35
The dash V for both gives me a lot more data to look at,
09:39
so I can see it's verifying my superblock.
09:41
Uh,
09:43
it looks like I've got 87,360 entries in my in my block. Cash
09:48
tells me that it's scanning my file system free space. I knowed maps,
09:52
and it shows me all the different phases
09:56
clearing unlinked lists, discover new. I know, discovering duplicate blocks.
10:03
It has a lot of different things to sort of clean clean up the file system. Basically, it's doing some housekeeping.
10:11
Now, what I can do is
10:13
I could mount the file system to see what we actually have.
10:16
So, Dev Esty, be one I'm gonna amount to a director I've already created called my data.
10:24
And then I'm going to mount Death S t B
10:28
Stevie, too
10:30
to my data, too.
10:35
I can run the d F. Command to show me that those file systems are now mounted. I use the dash H option,
10:41
which spells out my my
10:46
size characteristics using a human readable format like megabytes, gigabytes.
10:52
So there's those two follow systems.
10:56
Quickly, let's go back to our
11:00
slide.
11:01
We also have the tune F s
11:05
program,
11:05
and this basically works very similar to,
11:09
uh, except fast repair or F s CK in that I can I can tell it,
11:13
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.
11:22
I could specify max number of mounts.
11:24
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.
11:37
All right, so now let's have a look at
11:41
to Memphis.
11:46
Now, I know that this is used for money,
11:48
X t fall system. So I'm gonna run
11:52
tips
11:52
two
11:54
to confess
11:56
on my A known at SD file system, which in this case would be best to be one.
12:03
I'm gonna put this tomb. Or so I didn't see what kind of information.
12:09
Oh, I forgot the dash l option. My mistake.
12:16
Here we go.
12:16
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
12:26
Tells me that I can turn on a journaling. I can resize I nodes Aiken,
12:31
uh, use my recovery options.
12:35
Currently, it's clean
12:37
file system type I've got, I know, count of block count free blocks
12:41
when it was created when it was mounted Some interesting
12:45
statistics here three times I've mounted this file system.
12:48
Find out when it was checked last
12:54
and a few more details showing me
12:58
the default directory hash and smother parameters
13:01
most of time. You don't need a lot of this information, but when you're trouble shooting and when you're
13:05
doing some fine tuning, it's good to be able to refer to this information.
13:13
Now let's look at
13:18
the
13:18
do you and D F commands.
13:22
They stand for dis use and disc free
13:26
disc uses pretty handy because as an administrator
13:30
they'll be many times where you need to
13:31
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
13:41
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.
13:48
I can also display of the number of I nodes for particular files in the directory.
13:54
I could display the information and human readable format
13:58
and sort it, which is useful. I'll show you how that works here in a minute.
14:01
Then we have the D. F. The dis freak Ament.
14:05
This will show me on a per file system basis some of the statistics for money system.
14:11
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.
14:22
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.
14:31
I can run d f specifying a foul system type
14:37
and then lastly, I have
14:39
the dash capital T option, which displays all the file system types,
14:43
So let's have a look at that.
14:46
You start with
14:48
doing a help command for D u.
14:50
We should point that to Morris. We can see a little bit
14:58
so summarizing disuse that dash A gives me all files,
15:03
not just directory, So that's pretty useful.
15:07
I can specify the information, but block size
15:13
using the V I nodes option
15:16
Human readable s for summary.
15:18
So let's go ahead and try for you. These
15:22
if I do run a d u Dash A
15:26
on a director that I know has a bunch of files in it. User
15:28
pipe that two more.
15:31
And it tells me each individual file that it finds going down that directory tree and
15:37
how many
15:39
ah blocks it's using
15:41
now that the thieves blocked numbers are not easy to read. So
15:45
that's why typically, I would
15:48
use a dash
15:52
H option.
15:52
Now I can see something more useful. Four K 64 K and so on.
15:58
That's a little easier for us humans to deal with.
16:02
Now, if I won, do you dash page
16:06
by itself on a folder? Let's say Espen,
16:11
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
16:19
in that folder
16:21
to show me everything,
16:22
it will give me a human readable
16:25
I'll put
16:26
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
16:36
surge for large files or even smaller files.
16:38
Now this is all listed in sorted or sorted by the name,
16:45
but maybe I want to sort it by its numeric value so I can play this
16:48
to Soar Dash.
16:52
And this is pretty handy because now the biggest files will be at the bottom
16:56
off the list,
16:56
and I can see here my largest file underneath that particular directory is Espen LD Config.
17:07
Now, if I run it with the dash a H option,
17:11
there's there's not much.
17:11
There's not many layers underneath that, so it's not giving me much of anything different.
17:17
Husband doesn't have his money
17:18
files as user does.
17:23
If I run this against user, it's gonna take a moment to, uh,
17:29
go find all this information.
17:34
There you go
17:37
slowly but surely we get through
17:38
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
17:45
that this particular item is my largest file.
17:48
So this particular command
17:51
do you deaf age on some path
17:53
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
18:02
and I can find it quickly.
18:03
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.
18:12
I can also use the D. U dash s
18:17
for a summary,
18:22
and I'll run that against Let's say, User.
18:30
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.
18:41
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.
18:52
All right, now let's move on to the the disc. Free command,
18:56
I run just free Dash A. This is showing me all
19:00
file system that it knows about Sorry. On Lee
19:04
Mistake there. It's not file system to show me all of my
19:08
fake file systems as they're sometimes called.
19:11
We talked about these a little bit early in the chapter. Our temp, f s deaf temp F s.
19:18
I've got, um
19:19
my
19:21
my route file system.
19:23
It shows me real file systems as well. But I can also see things like
19:29
Prock if s
19:30
Well, there is.
19:32
So there's Prock
19:34
Rudolph s So
19:37
these air file systems that exist but may not actually be mounted because they're used by the Colonel.
19:44
But in any case, I might want to look at this information.
19:45
That could be good reasons to just do a quick check to see what kind of information
19:51
What kind of storage I'm utilizing
19:53
as before with do you command, I can run the d f Dash h and I could get a human readable output,
20:00
so it shows me things and gigabytes. Maga, bytes, kilobytes. As you can see here
20:06
If I run it with the dash capital H,
20:08
I get the multiples of 1000
20:12
so
20:14
you could see it's a slightly different
20:15
output. I've got eight gig for route there, and it says a 80.6 gig here.
20:22
This is kind of like the marketing megabyte versus the real megabyte.
20:26
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
20:33
If I do
20:36
or run a d f dash, I command.
20:38
Now I can see how many I nodes are in use for each of these, not points
20:44
and as well as you might remember from previous conversations. I nodes are a finite,
20:49
uh, resource when the file systems created
20:52
and you can change their sides and you can make other adjustments. But
20:56
at least here I can see if I am running low. How many I notes Do I have free harmony? Are used percentage used.
21:04
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
21:14
a process to die, an application to die. And that's obviously something we want to avoid.
21:19
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.
21:29
In this case, only one of them shows up
21:32
my data, which I created earlier.
21:34
If I run it with dash Capital T
21:38
now, it will just show me the file system type of all of my fellow systems. We see that column here.
21:45
There's my CD, Rahm, I sew 96 60.
21:47
I got my exit fast file system. I created the X T follow system I created
21:52
and so on all the temp F s file systems that we just saw when I ran the d f dash A.
21:59
So I've got a good bit of information there, too,
22:02
to work with when I'm trying to troubleshoot various file system issues.
22:07
Now we do have other commands to consider. I showed you tuned to F s earlier.
22:12
I can also run dump
22:15
two f s to show my superblock information.
22:19
I can run debug a fast. That's Ah,
22:22
come here that you probably won't have to use very often. But occasionally it is useful
22:26
if I'm creating riser F s
22:30
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
22:45
Now for ex SS file systems, you'll see if there's several comedians that are specifically for X f s.
22:52
Now there's, as I've said before, another
22:56
sections of this course. There's usually more than one way to do something. So I may be able to run
23:00
some of these comedians
23:03
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.
23:14
So you've got a few options there.
23:15
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,
23:30
I've got my admin command to change some of the parameters I can use repair
23:34
very much like the F S C K command for non X F s file systems
23:41
and then finally a excess
23:44
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.
23:53
So let's go ahead and have a look.
23:56
All right, So have let's have a look at a few of these commands.
24:02
First, we're gonna run.
24:03
Don't
24:04
e to f s.
24:08
And
24:11
actually, before we do that, let's quickly look at the man Paige for that.
24:18
And as we can see, this lets us interact with e x t file systems and let's show lots of different details.
24:26
For instance, I might want to look at the super block information. Maybe I wanna play print my bad block list.
24:37
I said, you go ahead with that.
24:45
I'm gonna run that on my e x t file system, which is S t B one
24:51
11 1
24:53
and we can see that gave me a lot of info. Someone run again and pipe it more.
24:57
I've got lots of data here. My last mile point. My u U I d
25:03
current status
25:04
Mount time information. Very similar to what we saw from,
25:07
um
25:08
tune
25:11
Eat tuned to f s
25:15
so pretty Pretty good information shows me information about my my different range of blocks.
25:22
Show me how many are rain are free in each of the groups.
25:25
I know information.
25:30
And if I run it with a dash h
25:37
should show me
25:38
omit the block information So it's sort of an abbreviated output.
25:44
I can also run debug
25:47
f s.
25:48
And this is just what it sounds like. It's to let you debug file systems.
25:55
Now, if I run it without any arguments,
25:59
I can
26:02
hope command
26:03
and see what my possibilities are. I can open a file system.
26:12
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.
26:21
I can
26:22
remove files. I could make directories. I can even undo Lita file. Just kind of interesting.
26:29
I can run the stats
26:30
command.
26:33
And this shows me very similar information that I just saw from the dump command.
26:37
I label my U U I. D number file system features.
26:41
If I want to see features by themselves, I can just type
26:45
features
26:47
and shows me all the things that this particular file system supports.
26:53
So make a directory called New Directory.
26:57
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
27:07
file system
27:12
close. False is okay.
27:15
Give me a different job command for that. That's fine.
27:26
It still doesn't like that.
27:29
Um,
27:33
that's fine.
27:36
What you can do is quit from D bag F s and I can run it again. This time,
27:41
what I'll do is I'll give it a dash. W option
27:45
groups just w
27:47
have STV one
27:48
now. It should be
27:51
mounted rewriteable.
27:56
And now you can see I was able to make the directory and now I can see that exists
28:03
pretty handy.
28:04
The, uh,
28:06
another command we could use would be the riser, eh? Festoon?
28:12
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.
28:26
We can run X f s info. So if I run d f GHT again,
28:32
looks like my data to was not currently mounted. So I'm gonna go ahead mount that
28:37
it's Deb STV too.
28:38
My data to and as you're following along, you know, make your own directors make your own file systems. It's very
28:47
it's the best way to play around with these commands and get familiar without causing any harm.
28:52
Now, for one day of destiny, I can see that that my data to is an exit fast fall system.
28:57
We can tell there.
29:02
So I'll run accent fast info
29:06
on
29:07
Dev SD be too.
29:12
And it shows me
29:15
I know size information, my number of blocks, block size,
29:19
current version of the file system that some of its logging information
29:26
I can also run the grow F s command again. I have to
29:30
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.
29:38
Very handy.
29:41
Let's also do a man on X f s admin.
29:47
Just let me change my file system parameters.
29:51
So enabling journaling preaching the current label
29:53
printing the view You i d number.
29:57
So if I run except fast admin dash l for label
30:03
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.
30:10
Maybe I wanted quickly check my u U I d number.
30:14
Did you see again? There's many ways to do this. I could run,
30:17
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
30:33
and that our last command is except faster d B.
30:40
So we're gonna man on that because that help doesn't give us much information.
30:47
And so just like d Block F s allows us to deal with debugging a e x t file system.
30:53
I could run except best DP to debug and accept s file system
30:59
with pretty much the same options.
31:00
I cannot
31:02
interact using the menu system or run some of these options directly from the command line.
31:10
So I'm gonna go ahead and go into the
31:12
menu
31:14
XF s d B and I want death. S d B two
31:21
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
31:30
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.
31:36
And that's my data, too
31:41
Up arrow
31:41
to get back to this command.
31:44
Now I can get into the menu.
31:47
What's my type? Question mark. I get my help,
31:51
and I can also type help. And the command itself, like help log,
31:55
shows me information about that particular command.
31:57
Some of the ones that are more useful. For instance, free space free SP shows me
32:04
my current percentage of usage of blocks and extents.
32:07
Maybe I want to display the label
32:10
again. That one's empty.
32:13
You i d number. I could display that
32:15
effectively. My serial number,
32:19
uh, and I can also run.
32:21
Run! Help him! Quick.
32:23
I've got some information about block use. It's a block free block. Get block use.
32:30
I do need to run block, get to, uh,
32:35
get the process going. So I run block yet
32:37
and from there, I should be able to run block use
32:43
Tells me I'm not using any right now because I really don't have any files in that
32:51
file system. Like free?
32:53
Not just yet. I think if I run, block, get again,
32:59
then block free. There's block at don't showing me my aggregate count.
33:07
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.
33:28
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,
33:37
and you should definitely spent some time practicing with these comedians and doing the various labs are gonna be available.
33:45
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.
33:59
All right, See you then. Thank you.

Up Next

CompTIA Linux+

Our self-paced online Linux+ training prepares students with the knowledge to become a certified Linux+ expert, spanning a curriculum that covers Linux maintenance tasks, user assistance and installation and configuration.

Instructed By

Instructor Profile Image
Dean Pompilio
CEO of SteppingStone Solutions
Instructor