1 00:00:00,000 --> 00:00:01,330 [No audio] 2 00:00:01,330 --> 00:00:03,678 Filesystem corrupted or if there 3 00:00:03,704 --> 00:00:05,710 is a filesystem corruption. 4 00:00:05,890 --> 00:00:08,240 Well, what is a filesystem? 5 00:00:08,570 --> 00:00:14,734 Filesystem consists of the directories or folders 6 00:00:14,782 --> 00:00:17,718 that's you create in your operating system. 7 00:00:17,864 --> 00:00:20,518 So there are different type of filesystems. 8 00:00:20,614 --> 00:00:23,674 The filesystems are like ext3, Linux 9 00:00:23,722 --> 00:00:28,378 ext4, xfs, NTFS or Fat and Windows. 10 00:00:28,474 --> 00:00:30,298 These are all different type of file 11 00:00:30,334 --> 00:00:33,966 systems that we have in operating system. 12 00:00:34,148 --> 00:00:36,790 A filesystem layout and partitions 13 00:00:36,850 --> 00:00:42,222 are like /var, /etc, /root, /home. 14 00:00:42,356 --> 00:00:47,130 So whenever you carve a disk and you give that disk 15 00:00:47,450 --> 00:00:52,426 to your operating system, the first thing you have to define 16 00:00:52,498 --> 00:00:55,530 is what type of filesystem do you want for it? 17 00:00:55,640 --> 00:00:59,060 Then you pick a filesystem, for example, ext4. 18 00:00:59,390 --> 00:01:02,754 Once that is assigned to your filesystem, the 19 00:01:02,792 --> 00:01:06,714 next step is to partition that disk or that 20 00:01:06,751 --> 00:01:09,042 filesystem in the way you want. 21 00:01:09,236 --> 00:01:11,122 If you leave it a default file 22 00:01:11,146 --> 00:01:13,642 system, then everything goes under slash. 23 00:01:13,786 --> 00:01:18,106 But if you wanted to partition with advanced partitioning 24 00:01:18,178 --> 00:01:20,958 option while you're doing the installation, then you could 25 00:01:20,984 --> 00:01:24,714 use /var, /etc, or whichever the partition or 26 00:01:24,752 --> 00:01:26,938 mount point that you want to specify. 27 00:01:27,094 --> 00:01:30,310 So what happened is when the filesystem is corrupted, 28 00:01:30,430 --> 00:01:34,690 it usually gets corrupted in one of these partitions. 29 00:01:34,750 --> 00:01:39,162 Maybe the /var is bad, /etc, or /root is bad. 30 00:01:39,296 --> 00:01:42,258 That's why sometimes the system administrators, the 31 00:01:42,284 --> 00:01:45,918 way they design the operating system is 32 00:01:45,944 --> 00:01:50,194 they slice each partition differently. 33 00:01:50,302 --> 00:01:52,794 So this way if there is a problem 34 00:01:52,832 --> 00:01:54,846 with var, it only stays with var. 35 00:01:54,908 --> 00:01:58,446 It doesn't impact the whole slash filesystem. 36 00:01:58,628 --> 00:02:00,798 So that is one of the main reason people 37 00:02:00,884 --> 00:02:04,614 pick the partitioning of your disk instead of just 38 00:02:04,652 --> 00:02:07,830 picking one big large partition which is slash. 39 00:02:08,210 --> 00:02:10,602 Now, how do we check the filesystem? 40 00:02:10,735 --> 00:02:12,318 Well, the first command that you 41 00:02:12,344 --> 00:02:14,374 need to run is df command. 42 00:02:14,422 --> 00:02:15,618 We already talked about it. 43 00:02:15,644 --> 00:02:18,298 df command tells you what type of file 44 00:02:18,334 --> 00:02:21,930 system you have and where that filesystem 45 00:02:22,100 --> 00:02:25,330 is being partitioned and where is it mounted. 46 00:02:25,510 --> 00:02:28,954 Also you could run the command fdisk with minus 47 00:02:29,002 --> 00:02:32,240 l option to see all the disks that you have 48 00:02:32,930 --> 00:02:40,018 in your system and also each partition of that disk. 49 00:02:40,174 --> 00:02:43,098 If your system is running on lvm, then 50 00:02:43,124 --> 00:02:45,927 you could run many lvm commands like 51 00:02:45,927 --> 00:02:50,926 lvdisplay, pvdisplay, the lvblock. 52 00:02:50,998 --> 00:02:52,362 So there are many commands that you 53 00:02:52,376 --> 00:02:54,200 can run to see your filesystem. 54 00:02:54,710 --> 00:02:56,542 Now, let's get into troubleshooting steps. 55 00:02:56,566 --> 00:02:58,750 So you know your system is running slow 56 00:02:58,810 --> 00:03:01,338 or you have identified that you have a 57 00:03:01,364 --> 00:03:04,570 filesystem corruption in one of your partitions. 58 00:03:04,690 --> 00:03:06,330 So what do you do? 59 00:03:06,500 --> 00:03:09,174 You first check the /var/log/messages to 60 00:03:09,212 --> 00:03:13,218 confirm that it is actually the filesystem. 61 00:03:13,304 --> 00:03:17,238 And you will see a lot of error messages that will 62 00:03:17,264 --> 00:03:20,946 come up in your /var/log/messages that will say that bad 63 00:03:21,008 --> 00:03:25,962 log on this sector, on this disk and you need to 64 00:03:25,976 --> 00:03:28,110 fix it or you need to run fsck, 65 00:03:28,610 --> 00:03:30,870 you will see that in your /var/log/messages. 66 00:03:30,920 --> 00:03:33,330 So /var/log/messages or any type of log 67 00:03:33,380 --> 00:03:37,398 like /var/log/syslog are very important in a 68 00:03:37,484 --> 00:03:41,526 system structure to identify where the problem is. 69 00:03:41,708 --> 00:03:44,502 Then once you know that you do have 70 00:03:44,576 --> 00:03:47,478 a filesystem problem or a corruption and 71 00:03:47,504 --> 00:03:51,498 you identified which partition that filesystem is 72 00:03:51,524 --> 00:03:55,545 corrupted, then you run the command fsck. 73 00:03:55,610 --> 00:03:57,634 This is the command fsck, 74 00:03:57,682 --> 00:04:00,260 which stands for filesystem check. 75 00:04:00,890 --> 00:04:03,646 This command has been used with many different Linux 76 00:04:03,718 --> 00:04:07,470 as well as Solaris or Unix flavors as well. 77 00:04:07,640 --> 00:04:10,170 It's still there, it works perfectly. 78 00:04:10,850 --> 00:04:14,802 There are some of the new commands that 79 00:04:14,816 --> 00:04:16,541 are in there for different filesystem. 80 00:04:16,616 --> 00:04:20,793 Maybe XFS filesystem will run xfs_repair, 81 00:04:20,902 --> 00:04:22,926 which we'll talk about in a little bit. 82 00:04:22,988 --> 00:04:25,194 So anyway, we run the fsck on 83 00:04:25,232 --> 00:04:29,122 block device which is /dev/sda. 84 00:04:29,266 --> 00:04:33,154 We will not run on the mount point, meaning 85 00:04:33,202 --> 00:04:36,658 these are the mount points to /var, we cannot run fsck 86 00:04:36,754 --> 00:04:42,418 on /var. We have to run on the actual mount 87 00:04:42,514 --> 00:04:44,806 where it's coming from, the source. 88 00:04:44,938 --> 00:04:46,810 That would be the block device. 89 00:04:46,990 --> 00:04:50,814 Then make sure we are unmounting the 90 00:04:50,852 --> 00:04:54,190 filesystem before we are running fsck. 91 00:04:54,310 --> 00:04:59,034 Because if you run fsck on a mounted filesystem or 92 00:04:59,072 --> 00:05:02,022 mounted partition that is already mounted on /var, /etc, it 93 00:05:02,036 --> 00:05:04,674 will give you an error message and it will say you 94 00:05:04,712 --> 00:05:07,774 cannot mount it because that filesystem is busy. 95 00:05:07,882 --> 00:05:09,582 That is why one of the things that a lot 96 00:05:09,596 --> 00:05:12,834 of people get into trouble saying when they are trying 97 00:05:12,872 --> 00:05:16,446 to do the corruption cleanup of the corruption filesystem 98 00:05:16,568 --> 00:05:19,446 and they run fsck, and it doesn't run. 99 00:05:19,628 --> 00:05:22,494 And then they're sitting in trying to find out why it 100 00:05:22,532 --> 00:05:26,574 is not running, read the error message, what it says and 101 00:05:26,612 --> 00:05:29,374 it will tell you why it's not running because it cannot 102 00:05:29,422 --> 00:05:32,646 run that command on the mounted filesystem. 103 00:05:32,768 --> 00:05:34,930 So let's get into our Linux machine. 104 00:05:34,990 --> 00:05:39,130 I have already opened a terminal to my Linux machine 105 00:05:39,310 --> 00:05:42,138 and the first thing we will see is, we'll see 106 00:05:42,164 --> 00:05:45,262 the layout of our filesystem, and for that we'll 107 00:05:45,286 --> 00:05:49,890 run the command df -h. h is for human readable option. 108 00:05:49,940 --> 00:05:51,786 You could pick any option you want. 109 00:05:51,848 --> 00:05:54,846 If you pick, I suppose t, that will also 110 00:05:54,908 --> 00:05:57,114 tell you what type of filesystem it is. 111 00:05:57,212 --> 00:06:01,794 It is xfs, tmp filesystem, or exe filesystem. 112 00:06:01,892 --> 00:06:06,858 So let's just run df -h, and you will see there 113 00:06:06,884 --> 00:06:10,078 are different filesystems are also there as tmpfs. 114 00:06:10,174 --> 00:06:12,078 These are just tmporarily, this is 115 00:06:12,104 --> 00:06:13,350 not the actual filesystem. 116 00:06:13,460 --> 00:06:15,598 So what you could do is you could do df 117 00:06:15,634 --> 00:06:20,986 -h and grep -v to exclude tmpfs. 118 00:06:21,118 --> 00:06:23,922 So now you know exactly how many partitions you have. 119 00:06:23,996 --> 00:06:25,138 You have two partitions. 120 00:06:25,174 --> 00:06:28,126 One is mounted on slash, which is just slash 121 00:06:28,198 --> 00:06:30,858 on the root level and the second one is 122 00:06:30,884 --> 00:06:33,870 /dev/sda1, which is mounted for boot. 123 00:06:34,310 --> 00:06:39,646 boot is usually mapped on a regular block device. 124 00:06:39,718 --> 00:06:42,190 It does not get mapped on the lvm. 125 00:06:42,250 --> 00:06:45,150 So up here, you'll see this is the lvm. 126 00:06:45,770 --> 00:06:47,902 It always starts with /dev/mapper. 127 00:06:48,046 --> 00:06:49,914 So we identified it. 128 00:06:49,952 --> 00:06:52,986 Now, in your system, if you are working in a 129 00:06:52,988 --> 00:06:55,490 corporate environment or any of your system, 130 00:06:55,490 --> 00:06:56,925 you're probably going to see, 131 00:06:56,925 --> 00:06:59,395 more mounted points. 132 00:06:59,395 --> 00:07:03,232 You probably have /var, /etc, /opt, 133 00:07:03,232 --> 00:07:13,126 /sbin, or /tmp, whatever partition you have, 134 00:07:13,126 --> 00:07:15,763 it's ok. I'm not going to go into everyone of them 135 00:07:15,763 --> 00:07:17,536 But I'm just saying, you're probably going 136 00:07:17,536 --> 00:07:22,010 to see a lot more mount points on your system. 137 00:07:22,180 --> 00:07:23,930 If you don't, that is fine. 138 00:07:24,040 --> 00:07:26,702 But let's go, come in here, 139 00:07:26,776 --> 00:07:30,878 and to cover this, I have actually 140 00:07:30,964 --> 00:07:36,918 attached a disk through my virtual machine. 141 00:07:37,074 --> 00:07:40,178 And I am going to mount that disk first 142 00:07:40,324 --> 00:07:43,170 just to show you how we could run fsdk. 143 00:07:43,290 --> 00:07:47,945 So that disk I will do df -k, fdisk -k. 144 00:07:47,945 --> 00:07:50,864 Oh sorry, fdisk -l, 145 00:07:51,050 --> 00:07:54,078 and here, if you notice, I have a 146 00:07:54,104 --> 00:07:57,090 new disk, which I have already partitioned. 147 00:07:57,590 --> 00:07:59,514 I just wanted to add that I 148 00:07:59,552 --> 00:08:04,470 have already partitioned that new disk. 149 00:08:05,330 --> 00:08:07,098 If you notice right here, I have 150 00:08:07,124 --> 00:08:14,170 a disk, /dev/sdb, which is five gig. 151 00:08:14,230 --> 00:08:16,018 This is what I got from my virtual 152 00:08:16,054 --> 00:08:18,606 machine, and I have already partitioned that. 153 00:08:18,728 --> 00:08:20,914 Now I have to mount that somewhere. 154 00:08:20,962 --> 00:08:23,622 So I will mount it in one of 155 00:08:23,636 --> 00:08:26,506 the directory that I have created earlier. 156 00:08:26,638 --> 00:08:29,722 So that directory is in my slash directory, 157 00:08:29,866 --> 00:08:32,549 which is I named it sparedata. 158 00:08:32,659 --> 00:08:36,658 So I'm going to mount that mount 159 00:08:36,754 --> 00:08:43,159 /dev/sdb1 to /sparedata/. 160 00:08:43,490 --> 00:08:44,818 Okay, now it is mounted. 161 00:08:44,854 --> 00:08:47,214 Now, when I run df -h, of course 162 00:08:47,251 --> 00:08:51,510 I will grep everything, all the temporary filesystem. 163 00:08:51,679 --> 00:08:56,650 And now you will see I have basically two filesystems. 164 00:08:56,770 --> 00:08:59,250 One is sda, and one is sdb. 165 00:09:00,050 --> 00:09:01,602 They are the same filesystem, 166 00:09:01,676 --> 00:09:07,834 XFS. I wanted to know, I have discovered that this 167 00:09:07,872 --> 00:09:11,710 filesystem or this partition point is corrupted. 168 00:09:12,030 --> 00:09:15,094 Now, I need to fix that or clean 169 00:09:15,192 --> 00:09:19,550 any bad sectors that is on this partition. 170 00:09:19,670 --> 00:09:28,558 So I will run the command fsck space /sparedata. 171 00:09:28,704 --> 00:09:31,978 Now, the reason I'm putting that here, because I want you 172 00:09:32,004 --> 00:09:35,674 to know that it will not work, because I am trying 173 00:09:35,712 --> 00:09:39,946 to run fsck on the mount point, which does not work. 174 00:09:40,068 --> 00:09:41,698 And it will tell you it's a 175 00:09:41,724 --> 00:09:43,786 directory while trying to open this. 176 00:09:43,908 --> 00:09:47,650 So we don't do on the directory, we do 177 00:09:47,760 --> 00:09:50,218 on the block device, as I mentioned before. 178 00:09:50,364 --> 00:09:55,678 So I will do fsck /dev/sdb1. 179 00:09:55,824 --> 00:09:59,460 Now I'm running this, it will still fail. Why? 180 00:09:59,970 --> 00:10:03,046 Because as I mentioned in my last part, it 181 00:10:03,048 --> 00:10:06,386 says unmount filesystem and then run fsck. 182 00:10:06,518 --> 00:10:08,446 Unmounting means it is already 183 00:10:08,508 --> 00:10:10,010 mounted on this directory. 184 00:10:10,130 --> 00:10:11,638 So that's why it's not going to work. 185 00:10:11,724 --> 00:10:12,898 But I will go ahead and run 186 00:10:12,924 --> 00:10:14,662 it to see the error message. 187 00:10:14,856 --> 00:10:18,746 Okay, so when I ran it, it says fsck from utility-linux so 188 00:10:18,746 --> 00:10:22,546 and so, and the version and the date, and it says 189 00:10:22,608 --> 00:10:28,726 /dev/sdb1 is mounted. e2fsck: Cannot continue. 190 00:10:28,848 --> 00:10:29,894 So aborting. 191 00:10:30,002 --> 00:10:33,638 Basically, this e2fsck is a newer command. 192 00:10:33,794 --> 00:10:41,158 But for fsck, I'm sure fsck probably have a link to this. 193 00:10:41,244 --> 00:10:44,206 This is the new command that you could run. Anyway, 194 00:10:44,388 --> 00:10:46,162 we could talk about new commands later. 195 00:10:46,236 --> 00:10:48,946 But right now our focus is to find out 196 00:10:49,008 --> 00:10:52,594 why we cannot run fsck on /dev/sdb1. 197 00:10:52,692 --> 00:10:56,230 And we know we cannot, because it is mounted. 198 00:10:56,550 --> 00:10:58,150 So what do I have to do? 199 00:10:58,260 --> 00:11:00,240 I have to unmount it. 200 00:11:00,240 --> 00:11:02,507 [No audio] 201 00:11:02,507 --> 00:11:08,834 umount, the command to unmount is umount /sparedata. 202 00:11:08,932 --> 00:11:11,858 That's the partition or that's the mount point I have. 203 00:11:12,004 --> 00:11:15,138 So I'll run that command and now it is unmounted. 204 00:11:15,234 --> 00:11:17,282 I will do df -h again 205 00:11:17,356 --> 00:11:19,010 and you'll see it is not there. 206 00:11:19,120 --> 00:11:25,338 Now I could run fsck /dev/sdb1 by hitting up arrow keys 207 00:11:25,374 --> 00:11:28,530 which will repeat all the commands that we ran earlier, 208 00:11:28,590 --> 00:11:32,366 I hit Enter. As soon as I hit enter, 209 00:11:32,428 --> 00:11:36,314 it says fscl from utility so and so, and version, date, 210 00:11:36,352 --> 00:11:38,740 it says /dev/sdb1, and clean. 211 00:11:39,910 --> 00:11:43,502 And it has some calculations and the files, it's telling you 212 00:11:43,516 --> 00:11:46,190 how many files it has, how many blocks it has, since 213 00:11:46,240 --> 00:11:50,438 this is only five gig and it went pretty fast and 214 00:11:50,464 --> 00:11:54,914 there is no files or data on that spare disc right 215 00:11:54,952 --> 00:11:59,474 now, that is why it went pretty fast and you see 216 00:11:59,512 --> 00:12:01,622 you got the result right away. 217 00:12:01,696 --> 00:12:06,854 If you have that, let's say 100 gig of disk and has it so 218 00:12:06,892 --> 00:12:11,726 much data on it, then it could take a long time to run. 219 00:12:11,848 --> 00:12:16,754 It will go into it and it will check everything that it has 220 00:12:16,792 --> 00:12:19,934 to check on for the bad blocks and it will fix it. 221 00:12:20,032 --> 00:12:23,978 So it's also possible while it is fixing it, it 222 00:12:24,004 --> 00:12:27,710 will ask you, hey, I found the fix for this, 223 00:12:27,760 --> 00:12:31,050 do you want me to fix that bad block? 224 00:12:31,110 --> 00:12:33,460 And you will have to enter y, 225 00:12:33,790 --> 00:12:35,354 to say yes, go ahead. 226 00:12:35,452 --> 00:12:38,522 So one thing is you could keep saying y, y, 227 00:12:38,716 --> 00:12:41,858 and keep entering in on the prompt, or you 228 00:12:41,884 --> 00:12:45,470 could just simply say fsck -y. 229 00:12:45,640 --> 00:12:48,086 It means whatever that you're going to ask me, 230 00:12:48,148 --> 00:12:49,718 my answer is yes. 231 00:12:49,864 --> 00:12:52,706 So then you hit Enter and it will go through 232 00:12:52,768 --> 00:12:55,694 all the filesystem again and it will clean up. 233 00:12:55,792 --> 00:12:58,754 Now, next thing I wanted to talk about, which 234 00:12:58,792 --> 00:13:01,502 is one of the biggest thing a lot of 235 00:13:01,516 --> 00:13:06,040 people experience is they say, okay, my filesystem 236 00:13:06,850 --> 00:13:11,462 is corrupted, but it is root filesystem. 237 00:13:11,536 --> 00:13:15,798 Now how do I clean that when it is mounted? 238 00:13:15,954 --> 00:13:18,558 If I unmount it, it's not going to let me unmount 239 00:13:18,594 --> 00:13:22,286 because that's where I am running my entire operating system. 240 00:13:22,408 --> 00:13:24,098 So how can I do that? 241 00:13:24,244 --> 00:13:26,138 Well, that's a very good question if 242 00:13:26,164 --> 00:13:28,120 that is coming in your mind. 243 00:13:28,570 --> 00:13:32,234 Many times we have that issues we cannot clean up. 244 00:13:32,332 --> 00:13:36,674 So the only way we could do that is we have to 245 00:13:36,712 --> 00:13:42,040 boot our machine through the CD ROM, we have to mount our 246 00:13:42,730 --> 00:13:47,798 CentOS or Red Hat cd to our Linux machine right here and 247 00:13:47,824 --> 00:13:51,998 we have to boot from that CD ROM and then once it 248 00:13:52,024 --> 00:13:54,662 boots, it will give us the rescue option. 249 00:13:54,796 --> 00:13:58,034 We'll pick the rescue option and then we can 250 00:13:58,132 --> 00:14:02,118 fix this issue if there are any bad sectors 251 00:14:02,274 --> 00:14:05,738 on the root or any partition that cannot be 252 00:14:05,764 --> 00:14:08,570 mounted while the operating system is running. 253 00:14:08,740 --> 00:14:10,838 Now, how can I do that? 254 00:14:10,984 --> 00:14:15,134 So for that, you cannot use a PuTTY session for that. 255 00:14:15,172 --> 00:14:18,654 You have to actually console into the machine 256 00:14:18,702 --> 00:14:21,038 because you will be rebooting the machine and 257 00:14:21,064 --> 00:14:23,718 you will be bringing down all the network 258 00:14:23,754 --> 00:14:27,882 connections and all the multi user environment. 259 00:14:28,026 --> 00:14:35,030 So I will go into my Linux machine through console. 260 00:14:36,550 --> 00:14:39,138 Okay. I am logged into console. 261 00:14:39,174 --> 00:14:43,290 Now I have to attach the device, 262 00:14:43,410 --> 00:14:45,630 sorry, the ISO image of my CentOS. 263 00:14:45,690 --> 00:14:50,690 So go to Device, Optical Drives, and choose a disk image. 264 00:14:51,010 --> 00:14:54,050 Once I go in here, it will tell me where the file is. 265 00:14:54,100 --> 00:14:56,226 I'll say Desktop, it is on my Desktop, 266 00:14:56,298 --> 00:14:59,560 and the file is CentOS, click Open. 267 00:15:00,130 --> 00:15:02,634 If you want to confirm it has attached, 268 00:15:02,682 --> 00:15:05,774 you could go back to Devices, Optical Drives, and 269 00:15:05,812 --> 00:15:07,718 you see the check mark is right here. 270 00:15:07,804 --> 00:15:09,222 So it means it is mounted. 271 00:15:09,306 --> 00:15:15,940 So now all I have to do is do a reboot and hit Enter. 272 00:15:15,940 --> 00:15:17,950 [No audio] 273 00:15:17,950 --> 00:15:23,680 When it reboots, you see in the back I have the 274 00:15:24,310 --> 00:15:27,714 PuTTY session and it says it lost the server unexpectedly. 275 00:15:27,762 --> 00:15:28,660 That's fine. 276 00:15:28,990 --> 00:15:31,122 Now I am at this section 277 00:15:31,206 --> 00:15:33,506 where it says Install CentOS 7. 278 00:15:33,568 --> 00:15:35,174 You probably have seen that if 279 00:15:35,212 --> 00:15:38,874 you have recently done the installation. 280 00:15:39,042 --> 00:15:41,126 So Install CentOS is perfect. 281 00:15:41,308 --> 00:15:43,418 You don't want us to do that because this 282 00:15:43,444 --> 00:15:46,062 is if you are doing the install from scratch, 283 00:15:46,206 --> 00:15:48,866 Test this media & install CentOS. 284 00:15:48,928 --> 00:15:50,990 It's the same thing, but it will test it again. 285 00:15:51,160 --> 00:15:53,810 Our option is Troubleshooting. 286 00:15:54,250 --> 00:15:56,730 I'll go in and hit Enter in Troubleshooting. 287 00:15:56,790 --> 00:15:59,392 Now the next option is Install CentOS in 288 00:15:59,392 --> 00:16:01,206 basic graphical mode. 289 00:16:01,338 --> 00:16:03,618 Again, we are not installing, we are doing Rescue. 290 00:16:03,654 --> 00:16:07,118 So come down to the selection to the 291 00:16:07,144 --> 00:16:09,770 option where it says Rescue ascent OS system. 292 00:16:09,940 --> 00:16:11,378 If you are using Redhat it 293 00:16:11,404 --> 00:16:13,322 would say rescue a Redhat system. 294 00:16:13,396 --> 00:16:14,500 So hit Enter. 295 00:16:14,500 --> 00:16:26,210 [No audio] 296 00:16:26,210 --> 00:16:32,254 Now it's basically starting up the Operating System. 297 00:16:32,412 --> 00:16:35,698 Not actually the operating system, but the system 298 00:16:35,784 --> 00:16:39,346 that is actually on the disk that is 299 00:16:39,408 --> 00:16:42,158 used to go through the installer. 300 00:16:42,194 --> 00:16:43,862 See, it says starting installer. 301 00:16:43,946 --> 00:16:45,598 Well, in fact it's not doing the 302 00:16:45,624 --> 00:16:47,962 installer, so don't be alarmed by that. 303 00:16:48,096 --> 00:16:50,710 Now here we are in the rescue mode. 304 00:16:51,150 --> 00:16:53,390 Read it very carefully, says the environment. 305 00:16:53,450 --> 00:16:55,766 The rescue environment will now attempt 306 00:16:55,958 --> 00:16:59,410 to find your Linux installation and 307 00:16:59,460 --> 00:17:03,518 mounted under the directory /mount/sysimage. 308 00:17:03,674 --> 00:17:06,790 You can then make any changes required to your system. 309 00:17:06,960 --> 00:17:08,594 Choose 1 to proceed 310 00:17:08,642 --> 00:17:10,702 With this step you can choose to 311 00:17:10,714 --> 00:17:12,982 mount your filesystem read-only. 312 00:17:13,175 --> 00:17:16,150 Instead of read, write by choosing 2. 313 00:17:16,319 --> 00:17:19,294 If for some reason this process does not work, 314 00:17:19,392 --> 00:17:22,920 choose 3 to skip directly to a show. 315 00:17:23,490 --> 00:17:27,190 So if I mounted, if I pick one, then it will 316 00:17:27,240 --> 00:17:32,470 mount my filesystem which is root to /mnt/sysimage. 317 00:17:32,470 --> 00:17:36,910 [No audio] 318 00:17:36,910 --> 00:17:39,290 So suddenly I lost the screen. 319 00:17:39,339 --> 00:17:41,821 But anyway, so I don't want to mount that. 320 00:17:41,896 --> 00:17:44,849 If I mounted then I cannot run fsck 321 00:17:44,910 --> 00:17:46,780 which I will be in the same situation. 322 00:17:47,170 --> 00:17:49,130 I don't want to mount it as read-only. 323 00:17:49,180 --> 00:17:51,174 So I will just skip straight to the shell. 324 00:17:51,222 --> 00:17:54,580 So I will pick option three and hit Enter. 325 00:17:54,970 --> 00:18:00,578 Now I have the shell, so I run df -h command and 326 00:18:00,604 --> 00:18:03,110 you will see none of the filesystem will show up here. 327 00:18:03,160 --> 00:18:07,106 That actually the partitions that we have when the actual 328 00:18:07,168 --> 00:18:11,726 operating system runs, the one that you see right now, 329 00:18:11,788 --> 00:18:14,250 it is actually coming straight from the cd. 330 00:18:14,430 --> 00:18:15,938 So you know that already. 331 00:18:16,024 --> 00:18:17,438 Your filesystem that you need to 332 00:18:17,464 --> 00:18:20,214 clean actually lives on /dev/sda. 333 00:18:20,382 --> 00:18:24,570 So you will run now you run fsck minus 334 00:18:24,630 --> 00:18:30,050 y, if you want to/dev/sda1, 335 00:18:30,160 --> 00:18:32,774 because you have to specify the entire partition for 336 00:18:32,812 --> 00:18:35,334 every partition that you have on the disk. 337 00:18:35,442 --> 00:18:38,558 Now you hit Enter and it says fsck from 338 00:18:38,584 --> 00:18:43,346 utility-linux 2.23.2. /sbin/fsck.xfs : XFS file system. 339 00:18:43,408 --> 00:18:46,538 It means I cannot run fsck for 340 00:18:46,564 --> 00:18:50,342 the partition that is on that list on 341 00:18:50,476 --> 00:18:53,450 or that has assignment of XFL filesystem. 342 00:18:53,560 --> 00:18:59,044 So I have to run the command fsck.xfs. 343 00:18:59,750 --> 00:19:02,600 Now run /dev/sda1. 344 00:19:03,170 --> 00:19:05,418 Now if you wish to check the consistency of 345 00:19:05,444 --> 00:19:09,210 XFL system or repair damaged filesystem, see this. 346 00:19:09,320 --> 00:19:11,278 Now it's saying now go to this command. 347 00:19:11,314 --> 00:19:12,834 This is the one I was talking about. 348 00:19:12,932 --> 00:19:16,858 You will have to run this command instead of fsck. 349 00:19:17,014 --> 00:19:22,602 So now you run a /dev/sda1, hit Enter and 350 00:19:22,616 --> 00:19:25,590 it's going through all the phases, phase one to six. 351 00:19:25,640 --> 00:19:29,022 And it's actually resetting the content, resetting checking the 352 00:19:29,036 --> 00:19:32,130 blocks and it's verifying and it says verify and 353 00:19:32,180 --> 00:19:34,714 correct link counts and at the end don't. 354 00:19:34,762 --> 00:19:37,410 So basically it went through the whole lot. 355 00:19:37,520 --> 00:19:41,286 If you had a big disk space with a lot of data 356 00:19:41,348 --> 00:19:44,022 on it, then it will take a long time as I mentioned. 357 00:19:44,156 --> 00:19:47,406 So now since it's mounted, it's cleaned, your 358 00:19:47,468 --> 00:19:50,226 corruption is cleared on your filesystem. 359 00:19:50,288 --> 00:19:55,098 Now you could simply do reboot, but before you 360 00:19:55,124 --> 00:19:59,622 do the reboot, just unmount your optical drive so 361 00:19:59,636 --> 00:20:02,566 it won't start off the ISO image. 362 00:20:02,758 --> 00:20:05,310 Force Unmount and hit Reboot. 363 00:20:06,310 --> 00:20:09,394 It will reboot and it will come 364 00:20:09,432 --> 00:20:12,554 back as clean disk and no corruption. 365 00:20:12,602 --> 00:20:15,266 You will also check in the /var/log/messages. 366 00:20:15,398 --> 00:20:16,906 Anyway, so this is about 367 00:20:16,968 --> 00:20:19,658 this lecture filesystem corruption. 368 00:20:19,814 --> 00:20:23,410 Then you have to follow these steps one by one again. 369 00:20:23,460 --> 00:20:25,282 If you have any questions, please send me 370 00:20:25,296 --> 00:20:27,226 a message and I'll be happy to answer 371 00:20:27,288 --> 00:20:29,047 anything that you haven't in mind. 372 00:20:29,047 --> 00:20:30,058 [No audio]