1
00:00:00,060 --> 00:00:00,893
So on this lesson,

2
00:00:00,893 --> 00:00:02,370
we're going to walk through some of the commands

3
00:00:02,370 --> 00:00:04,860
to properly manage our file system.

4
00:00:04,860 --> 00:00:07,920
For this example, we're going to use the same backup system

5
00:00:07,920 --> 00:00:10,050
that we just created prior.

6
00:00:10,050 --> 00:00:12,480
Because backups are critical to businesses,

7
00:00:12,480 --> 00:00:14,400
you want to make sure you perform a scheduled maintenance

8
00:00:14,400 --> 00:00:16,830
on each file system to spot any errors

9
00:00:16,830 --> 00:00:20,220
that could corrupt the data or make it inaccessible.

10
00:00:20,220 --> 00:00:22,200
Also, a common thing that happens

11
00:00:22,200 --> 00:00:24,540
in organizations is the need to expand

12
00:00:24,540 --> 00:00:27,660
or shrink storage as the entities grow.

13
00:00:27,660 --> 00:00:28,800
You'll also need to ensure

14
00:00:28,800 --> 00:00:32,040
that you resize the file system as well, or the users

15
00:00:32,040 --> 00:00:35,253
and the apps will not be able to use the newly added space.

16
00:00:36,300 --> 00:00:37,680
So let me get started. The first thing we're going to do,

17
00:00:37,680 --> 00:00:40,200
I just want to use the lsblk command.

18
00:00:40,200 --> 00:00:42,150
We're going to use the F option saying we want to look

19
00:00:42,150 --> 00:00:44,973
at the file systems associated with the storage.

20
00:00:46,110 --> 00:00:48,210
Now I love this view, it's a very clean view,

21
00:00:48,210 --> 00:00:51,030
you can see all the partitions to the left

22
00:00:51,030 --> 00:00:53,830
and you can see the file systems and you can see the UID

23
00:00:55,053 --> 00:00:56,490
and the mount points to the right.

24
00:00:56,490 --> 00:00:57,990
It's a very quick and easy way

25
00:00:57,990 --> 00:01:00,810
to kind of see how our system is laid out.

26
00:01:00,810 --> 00:01:03,330
So next thing we need to do is scan our systems

27
00:01:03,330 --> 00:01:04,560
and this is how we're going to go through

28
00:01:04,560 --> 00:01:06,510
and check to make sure that there's no errors

29
00:01:06,510 --> 00:01:07,920
on our file systems.

30
00:01:07,920 --> 00:01:09,540
So the first thing we need to do is unmounted

31
00:01:09,540 --> 00:01:12,213
the logical volume from the associated mount point.

32
00:01:14,430 --> 00:01:16,950
So going to use the dev, backup

33
00:01:16,950 --> 00:01:19,623
and we'll use the data backup system first.

34
00:01:22,890 --> 00:01:23,723
Okay.

35
00:01:28,754 --> 00:01:33,270
Next thing I want to do is use a file system check command.

36
00:01:33,270 --> 00:01:36,280
So I wanted use it on the data backup logical volume

37
00:01:37,440 --> 00:01:39,640
to make sure everything is good to go there.

38
00:01:42,990 --> 00:01:47,990
Okay. Now we see it gives us a clean response.

39
00:01:48,180 --> 00:01:51,000
That means everything is good to go on this file system.

40
00:01:51,000 --> 00:01:53,130
Whenever the system boots up,

41
00:01:53,130 --> 00:01:55,710
the file systems automatically run this check.

42
00:01:55,710 --> 00:01:58,772
Different type of shutdowns, hardware failures

43
00:01:58,772 --> 00:02:01,830
or reboots can cause an error.

44
00:02:01,830 --> 00:02:03,990
So it's always good to do this every so often

45
00:02:03,990 --> 00:02:06,720
just to make sure that the system is good to go.

46
00:02:06,720 --> 00:02:09,360
The next one we're going to do is an XFS system.

47
00:02:09,360 --> 00:02:11,670
So again, we have to unmounted that system,

48
00:02:11,670 --> 00:02:14,162
so we're going to use the dev backup

49
00:02:14,162 --> 00:02:18,330
and we're going to use the system backup logical volume.

50
00:02:18,330 --> 00:02:22,322
So let's get rid of this, unmounted that,

51
00:02:22,322 --> 00:02:26,733
and now for XFS we have to use the XFS repair command.

52
00:02:36,240 --> 00:02:39,060
Okay. Now you see, it wants to go through these phases,

53
00:02:39,060 --> 00:02:39,900
this is letting us know

54
00:02:39,900 --> 00:02:44,250
that it's checking every single piece of this file system.

55
00:02:44,250 --> 00:02:45,570
And for the XFS,

56
00:02:45,570 --> 00:02:48,033
this is the type of output you're going to receive.

57
00:02:53,460 --> 00:02:55,200
So when you get that done there at the bottom,

58
00:02:55,200 --> 00:02:57,240
that shows that there's no errors

59
00:02:57,240 --> 00:02:58,440
and we can move forward.

60
00:03:01,830 --> 00:03:03,600
Now, another command that we can use to

61
00:03:03,600 --> 00:03:07,147
check the file system is the E2F system check.

62
00:03:10,980 --> 00:03:12,450
And this of course associated

63
00:03:12,450 --> 00:03:15,933
with the EXT4 file systems or three or two,

64
00:03:17,280 --> 00:03:19,260
and we're going to use this force option.

65
00:03:19,260 --> 00:03:21,150
So this end, even if the system runs clean

66
00:03:21,150 --> 00:03:25,560
we want to make sure that we're checking everything.

67
00:03:25,560 --> 00:03:26,910
So we're going to do it again.

68
00:03:28,920 --> 00:03:32,040
Okay. So next thing we want to do is extend the volume drive.

69
00:03:32,040 --> 00:03:35,103
So we're going to do LV extend command.

70
00:03:36,330 --> 00:03:38,070
And now this option, the L option,

71
00:03:38,070 --> 00:03:39,630
is going to let us know which is

72
00:03:39,630 --> 00:03:42,240
the size that we're going to associate to this volume.

73
00:03:42,240 --> 00:03:44,910
And we're just going to do three,

74
00:03:44,910 --> 00:03:46,460
we're going to make it three gigs,

75
00:03:48,780 --> 00:03:51,993
and we're going to do that for the backup system.

76
00:03:58,050 --> 00:04:00,450
All right, so the data backup system has now changed

77
00:04:00,450 --> 00:04:02,463
from two gigabytes to three.

78
00:04:06,120 --> 00:04:08,580
Now, of course, we need to check the system again,

79
00:04:08,580 --> 00:04:12,300
make sure there was no errors after we extended that size.

80
00:04:12,300 --> 00:04:14,160
So it's going to scroll up, arrow up,

81
00:04:14,160 --> 00:04:17,103
and get to that command again for convenience.

82
00:04:18,180 --> 00:04:19,293
Run the check again.

83
00:04:21,089 --> 00:04:21,923
Good there.

84
00:04:25,890 --> 00:04:28,320
Now, since we increase the size of the volume

85
00:04:28,320 --> 00:04:31,800
we need to increase the size of the file system as well.

86
00:04:31,800 --> 00:04:33,990
It's not an automatic thing.

87
00:04:33,990 --> 00:04:37,113
So we're going to resize to FS.

88
00:04:39,150 --> 00:04:39,983
Dev

89
00:04:43,380 --> 00:04:44,213
Data back

90
00:04:46,320 --> 00:04:48,770
Now with this output, it lets us know that the file system

91
00:04:48,770 --> 00:04:51,510
is now resized and it indicates the new length

92
00:04:51,510 --> 00:04:53,670
of blocks associated with it.

93
00:04:53,670 --> 00:04:55,953
So let's go ahead and mount this back,

94
00:05:05,700 --> 00:05:08,700
all right, and ensure that it's associated.

95
00:05:08,700 --> 00:05:10,590
We can see it there at the bottom.

96
00:05:10,590 --> 00:05:13,770
Okay. The last thing we're going to do is increase the size

97
00:05:13,770 --> 00:05:16,200
of an XFS file system.

98
00:05:16,200 --> 00:05:18,363
So we're going to use the LV extend again,

99
00:05:19,770 --> 00:05:22,923
and this time I'm going to use it for the system back up.

100
00:05:24,690 --> 00:05:26,553
We're going to turn it into,

101
00:05:29,010 --> 00:05:32,463
going to get 2.75, just to save space.

102
00:05:42,720 --> 00:05:46,080
Okay. We see what's successfully resized.

103
00:05:46,080 --> 00:05:48,600
Now, when using the XFS system,

104
00:05:48,600 --> 00:05:51,420
and you're trying to increase the size of the file system,

105
00:05:51,420 --> 00:05:54,150
you must first actually mount the file system.

106
00:05:54,150 --> 00:05:59,150
So that's something of note with the XFS versus the EXT4.

107
00:06:01,814 --> 00:06:02,714
So we can go here.

108
00:06:09,540 --> 00:06:10,373
Okay.

109
00:06:11,520 --> 00:06:12,963
So I'm going to use the FXS,

110
00:06:14,190 --> 00:06:16,113
grow file system,

111
00:06:17,130 --> 00:06:20,223
go to dev/backup/sysbk,

112
00:06:25,077 --> 00:06:27,180
and the biggest thing we're looking for is the bottom

113
00:06:27,180 --> 00:06:29,850
letting us know that the data blocks changed

114
00:06:29,850 --> 00:06:31,290
from one size to another.

115
00:06:31,290 --> 00:06:33,030
And since we've tried to increase it

116
00:06:33,030 --> 00:06:34,650
the smaller number needs to be to left, of course,

117
00:06:34,650 --> 00:06:36,510
the larger number to the right.

118
00:06:36,510 --> 00:06:37,343
So in this walkthrough

119
00:06:37,343 --> 00:06:41,010
we demonstrated another command with the LS block command

120
00:06:41,010 --> 00:06:43,410
showing us a different way to view our logical volumes

121
00:06:43,410 --> 00:06:47,130
and their associated mount points and their file systems.

122
00:06:47,130 --> 00:06:50,760
We also learned how to use a file system check to make sure

123
00:06:50,760 --> 00:06:52,770
that we have great integrity and validity

124
00:06:52,770 --> 00:06:54,120
of our file systems.

125
00:06:54,120 --> 00:06:57,840
We went through how to extend the logical volumes

126
00:06:57,840 --> 00:07:00,480
and also their associated file systems.

127
00:07:00,480 --> 00:07:02,550
And also the note, there's key differences

128
00:07:02,550 --> 00:07:07,470
between the EXT4 file system versus the XFS file system.

129
00:07:07,470 --> 00:07:09,820
Thank you, and I'll see you in the next lesson.

