1
00:00:00,000 --> 00:00:14,160
Hey guys and welcome back.

2
00:00:14,160 --> 00:00:19,559
So now what I want to do is just have a few more words on file system recovery.

3
00:00:19,559 --> 00:00:23,600
Now like I say, when you're dealing with file system recovery, you can be dealing with things

4
00:00:23,600 --> 00:00:30,880
such as corrupt file systems and a common cause of a corrupted file system is when a

5
00:00:30,880 --> 00:00:33,800
system is inappropriately shut down.

6
00:00:33,800 --> 00:00:34,800
So what do I mean?

7
00:00:34,800 --> 00:00:39,640
That would be like someone pulling the power out of the system or a power outage.

8
00:00:39,640 --> 00:00:43,600
This type of thing could lead to such corruption of the file system.

9
00:00:43,600 --> 00:00:48,320
So when such a thing happens, we want to be aware of some of the tools that we have available

10
00:00:48,320 --> 00:00:52,760
to us to help us out and resolve these issues.

11
00:00:52,759 --> 00:00:57,399
The command I want to highlight here is the FSCK command.

12
00:00:57,399 --> 00:00:59,920
This is the file system check command.

13
00:00:59,920 --> 00:01:02,519
And it really is quite easy to use this command.

14
00:01:02,519 --> 00:01:10,000
All you would ultimately do is say FSCK and then specify the partition you want to check.

15
00:01:10,000 --> 00:01:13,640
So I would say dev sda1 for example.

16
00:01:13,640 --> 00:01:20,000
And this will actually give us detailed information about what exactly is wrong with the partition

17
00:01:20,000 --> 00:01:21,159
in this case.

18
00:01:21,159 --> 00:01:26,760
And once it identifies a particular problem, it will then ask you, do you want to fix this

19
00:01:26,760 --> 00:01:27,760
problem?

20
00:01:27,760 --> 00:01:30,159
To which you want to reply yes.

21
00:01:30,159 --> 00:01:34,960
Now you can continually just keep entering yes to all the problems.

22
00:01:34,960 --> 00:01:35,960
Do you want to fix this?

23
00:01:35,960 --> 00:01:36,960
Do you want to fix this?

24
00:01:36,960 --> 00:01:37,960
So on and so forth.

25
00:01:37,960 --> 00:01:40,519
But you can imagine this is quite tiresome.

26
00:01:40,519 --> 00:01:45,760
Instead a good way to run the FSCK utility is with the dash y flag.

27
00:01:45,760 --> 00:01:51,320
What this is going to do is going to preempt any such prompts and just answer yes to every

28
00:01:51,320 --> 00:01:52,920
time we get a prompt.

29
00:01:52,920 --> 00:01:58,280
If you have a lot of issues, FSCK can just run through those problems and attempt to

30
00:01:58,280 --> 00:02:00,640
fix each one as they go through.

31
00:02:00,640 --> 00:02:04,000
Now one point of note here, and this is very important.

32
00:02:04,000 --> 00:02:08,879
We do not want to run the FSCK utility on a live system.

33
00:02:08,879 --> 00:02:15,719
That means if you happen to have a partition working and mounted, do not run this utility

34
00:02:15,719 --> 00:02:17,439
in fact, let me just quickly show you.

35
00:02:17,439 --> 00:02:24,280
So if I say the command LSBLK, we can actually see the root file system is mounted on SDA5.

36
00:02:24,280 --> 00:02:25,800
So this is mounted.

37
00:02:25,800 --> 00:02:32,000
If I did FSCK DEV SDA5 and hit enter, notice it gives me the warning.

38
00:02:32,000 --> 00:02:33,800
The file system is mounted.

39
00:02:33,800 --> 00:02:35,840
If you continue, you will cause severe damage.

40
00:02:35,840 --> 00:02:41,479
So we want to say N for no to make sure we do not run this command on a mounted file

41
00:02:41,479 --> 00:02:42,479
system.

42
00:02:42,479 --> 00:02:48,079
That would mean you may have to use commands such as the U mount command to unmount a particular

43
00:02:48,079 --> 00:02:49,079
file system.

44
00:02:49,079 --> 00:02:54,359
If you do suspect that it does have issues and needs to be fixed with FSCK, this command,

45
00:02:54,359 --> 00:03:00,319
which we actually went over in the LPIC1 examination can help you unmount a partition safely.

46
00:03:00,319 --> 00:03:04,679
And then you can run the FSCK check to fix any particular problems.

47
00:03:04,679 --> 00:03:09,239
Okay, those are some of the main commands that we can use to fix these types of problems.

48
00:03:09,240 --> 00:03:12,320
I hope this has been informative for you and I'd like to thank you for viewing.

