1
00:00:00,000 --> 00:00:11,600
In this video, we'll talk about options to repair file systems. Actually, you need to

2
00:00:11,600 --> 00:00:16,320
understand what is going on. And that is because many problems are fixed automatically when

3
00:00:16,320 --> 00:00:24,160
you boot because file system journal on XFS or the transaction log on XFS. This journal

4
00:00:24,160 --> 00:00:29,360
and transaction log mean that file systems basically are auto-healing. So when you are

5
00:00:29,360 --> 00:00:34,320
booting and an error was encountered, the file system will do a rollback of the previous

6
00:00:34,320 --> 00:00:40,560
situation and you'll be all set. EXT file systems can be checked manually as well using

7
00:00:40,560 --> 00:00:46,480
the fscheck utility, which is a utility that you can also use to repair. And on some more

8
00:00:46,480 --> 00:00:52,240
cases, you might need to have to do that. On XFS, it's even more rare with the XFS repair

9
00:00:52,240 --> 00:00:58,240
utility is available. If you are going to use these utilities, you need to make sure

10
00:00:58,240 --> 00:01:04,720
that you are in emergency mode because normally these utilities require the file system not to

11
00:01:04,720 --> 00:01:09,040
be opened at all. So let me show you how you can start these utilities.

12
00:01:11,919 --> 00:01:18,320
Starting here. So to start it, I need to reboot and get access to the group boot prompt.

13
00:01:19,279 --> 00:01:23,040
Getting access to the group boot prompt is always a little bit of a guess. You need to

14
00:01:23,040 --> 00:01:28,400
press escape at the right moment. And as you can see, I just succeeded. So here we see the

15
00:01:28,400 --> 00:01:33,599
default kernel that my system wants to start. I'm pressing E for edit. And then I'm looking

16
00:01:33,599 --> 00:01:39,760
up the line that starts with Linux and ends with R-A-G-B and quiet, which is default on CentOS.

17
00:01:40,720 --> 00:01:46,879
I'm giving it the option init is slash bin slash bash. Init is bin bash is the most

18
00:01:46,879 --> 00:01:51,519
minimal troubleshooting mode. And the nice thing about this minimal troubleshooting mode

19
00:01:51,519 --> 00:01:57,199
is that your file systems are not yet mounted in a read-writable way. And also you are not

20
00:01:57,199 --> 00:02:03,440
required to enter a root password. You just get access to a root shell. Now there I'm going to

21
00:02:03,440 --> 00:02:10,160
use LSBLK where I can see my block devices and none of these block devices is mounted.

22
00:02:10,160 --> 00:02:16,880
So I need to use the appropriate utility. And in order to do so, I am going to use slash user

23
00:02:17,279 --> 00:02:24,800
slash sbin where all of my XFS utilities are. And there we can see there is the XFS repair utility.

24
00:02:25,520 --> 00:02:33,440
So let's do that on dev sda1, which should be by my boot device. And oh boy, there I can see that

25
00:02:33,440 --> 00:02:40,800
XFS repair is failing. Bad primary superblock. And why is it giving me bad primary superblock?

26
00:02:40,800 --> 00:02:47,360
Well, that is because I made a mistake. And we did it on a VFAT file system. In order to use

27
00:02:47,360 --> 00:02:53,600
XFS repair and other repair utilities, they're file system specific. So you need to be on the

28
00:02:53,600 --> 00:02:54,639
right file system.

