1
00:00:00,320 --> 00:00:01,340
Hello, everyone.

2
00:00:01,460 --> 00:00:06,680
In this demo, I'm going to show you how to reduce and extend logical volumes.

3
00:00:07,190 --> 00:00:10,730
And also I'm going to show you how to extend group value.

4
00:00:11,570 --> 00:00:17,360
Finally, I'm going to show you how to remove physical volume, group volume and logical value.

5
00:00:18,090 --> 00:00:21,660
Before I'm going to create anything, I'm going to run the command LVS.

6
00:00:21,690 --> 00:00:27,900
As you can see here, these are the two logical volumes that we have created them.

7
00:00:28,230 --> 00:00:30,570
And also I can type the command LS block.

8
00:00:30,600 --> 00:00:37,470
As you can see here we have this is the device, and here are the two logical volumes and the mount

9
00:00:37,470 --> 00:00:39,720
points for these two logical volumes.

10
00:00:41,530 --> 00:00:47,110
So the first example, I'm going to reduce the logical volume.

11
00:00:47,990 --> 00:00:51,290
This one the LV underscore department one.

12
00:00:51,620 --> 00:00:56,390
Then I'm going to extend the LV underscore department two.

13
00:00:57,890 --> 00:01:02,630
So you can see here are the size of this logical value.

14
00:01:02,630 --> 00:01:06,050
And also this is the size of the second logical value.

15
00:01:06,080 --> 00:01:09,050
So I'm going to reduce this and extend this one.

16
00:01:09,410 --> 00:01:17,540
But before I'm going to do that, I'm going to unmount the two logical volumes.

17
00:01:18,380 --> 00:01:27,470
So I'm going to type U mount slash slash mapper then V one.

18
00:01:29,680 --> 00:01:32,130
Dash lv underscore Department one.

19
00:01:32,140 --> 00:01:37,210
I'm going to do the same thing for department two double check LZ.

20
00:01:37,210 --> 00:01:42,880
Block As we can see, we don't have the mount point for these two logical volume anymore.

21
00:01:42,970 --> 00:01:43,720
Right now.

22
00:01:43,720 --> 00:01:48,790
What we're going to do, we're going to reduce this one.

23
00:01:50,050 --> 00:01:51,880
LV Reduce.

24
00:01:53,230 --> 00:01:58,600
Then I'm going to use the option L that uppercase L.

25
00:01:59,770 --> 00:02:07,480
Since we're going to use the reduce, then I have to type minus and I'm going to reduce, for example,

26
00:02:07,480 --> 00:02:10,120
600MB.

27
00:02:10,240 --> 00:02:12,510
Then I have to use the option dash r.

28
00:02:13,340 --> 00:02:20,930
This dash R is going to reduce the underlying file system together with the logical value.

29
00:02:21,350 --> 00:02:26,270
Then I have to type the path of the logical value.

30
00:02:26,360 --> 00:02:29,180
VG one then slash.

31
00:02:30,310 --> 00:02:32,760
LV underscore Department one.

32
00:02:34,120 --> 00:02:34,810
Enter.

33
00:02:36,760 --> 00:02:39,040
Is going to resize right now the logical volume.

34
00:02:39,610 --> 00:02:47,320
As we can see here, we don't have the one gigabyte anymore for this logical volume.

35
00:02:47,320 --> 00:02:49,430
So I can double check here with the Vgs.

36
00:02:49,480 --> 00:02:55,300
As you can see, we have the free size right now with the 600 right now, I'm going to use this one,

37
00:02:55,330 --> 00:03:00,220
the 600 to assign it to to this logical value.

38
00:03:00,220 --> 00:03:03,040
So I'm going to use right now the extent.

39
00:03:04,310 --> 00:03:06,410
The extend command.

40
00:03:07,940 --> 00:03:17,750
Then I'm going to use the lowercase L because I want to assign whatever left here in the volume group

41
00:03:17,750 --> 00:03:19,370
to this logical value.

42
00:03:19,400 --> 00:03:21,710
So I'm going to use the plus.

43
00:03:21,830 --> 00:03:24,740
So we know the difference with the reduce here.

44
00:03:25,070 --> 00:03:34,940
I have used the minus and with the extend, I'm going to use the plus before the number or the size.

45
00:03:35,120 --> 00:03:38,570
Then I'm going to type 100.

46
00:03:39,660 --> 00:03:46,380
And the percentage sign free, then space.

47
00:03:46,380 --> 00:03:51,630
We don't forget the dash r in order to resize the underlying file system together with the logical value.

48
00:03:52,360 --> 00:04:06,970
Then def v one and v one slash and I'm going to type this one here, underscore Department two.

49
00:04:07,940 --> 00:04:09,800
And I'm going to hit Enter.

50
00:04:10,800 --> 00:04:12,630
And I'm going to type LVS.

51
00:04:12,930 --> 00:04:20,880
As you can see here, we have extended the logical value for the underscore department to I'm going

52
00:04:20,880 --> 00:04:21,970
to type Vjz.

53
00:04:22,130 --> 00:04:27,810
As you can see here, we don't have a free size left in this value group.

54
00:04:28,700 --> 00:04:34,820
Now, the next example, I'm going to extend the volume group.

55
00:04:36,720 --> 00:04:42,360
The Vichy one in order to use this the new size.

56
00:04:44,250 --> 00:04:47,880
To extend the two logical volumes else.

57
00:04:47,880 --> 00:04:50,460
Block So you can see we have a free disk.

58
00:04:50,460 --> 00:04:57,600
I'm going to use this single disk to assign it to this volume group.

59
00:04:57,750 --> 00:05:04,770
So as I said, I'm going to add a new disk as a storage device to the volume group.

60
00:05:05,370 --> 00:05:07,800
And this is an important point.

61
00:05:07,800 --> 00:05:08,580
We know about that.

62
00:05:08,580 --> 00:05:15,720
So the volume group we consider the volume group is like a single storage and we can add many devices

63
00:05:15,720 --> 00:05:17,820
storages in that volume group.

64
00:05:20,340 --> 00:05:28,320
Then I'm going to use the command V extend, I'm going to extend this volume group.

65
00:05:28,350 --> 00:05:34,600
Then I have to type the disk name or the path slash slash SD.

66
00:05:35,400 --> 00:05:36,450
I hit enter.

67
00:05:36,600 --> 00:05:43,740
Then as you can see here we have right now the one gigabyte.

68
00:05:46,180 --> 00:05:48,550
Available to this volume group.

69
00:05:49,300 --> 00:05:51,040
Now I'm going to do an x LVS.

70
00:05:51,070 --> 00:05:54,700
I'm going to extend this to logical value.

71
00:05:55,850 --> 00:05:58,550
So I'm going to type V extend.

72
00:05:59,150 --> 00:06:09,020
Then for the first one, I'm going to use a fixed size, so I'm going to use the uppercase L plus 700

73
00:06:09,020 --> 00:06:10,850
megabyte.

74
00:06:10,860 --> 00:06:12,020
Then dash R.

75
00:06:12,020 --> 00:06:21,440
We don't forget the dash R in order to resize the underlying file system together with the logical value,

76
00:06:21,920 --> 00:06:25,490
then the name or the path of that logical value.

77
00:06:26,930 --> 00:06:28,160
Department one.

78
00:06:28,490 --> 00:06:28,700
Hit.

79
00:06:28,700 --> 00:06:29,260
Enter.

80
00:06:29,270 --> 00:06:29,960
Perfect.

81
00:06:29,960 --> 00:06:33,800
I'm going to do that now for the next one.

82
00:06:34,040 --> 00:06:36,290
Just extend.

83
00:06:38,580 --> 00:06:42,090
And I'm going to use right now whatever lift.

84
00:06:43,290 --> 00:06:44,700
Let me check here.

85
00:06:45,390 --> 00:06:51,510
As you can see here, whatever left here, I would like to assign it to department.

86
00:06:52,690 --> 00:06:57,880
To hear lv underscore department so lv extend.

87
00:06:59,490 --> 00:07:05,400
Lowercase l then we don't forget the plus hundred and percentage sign.

88
00:07:05,430 --> 00:07:06,330
Three.

89
00:07:07,570 --> 00:07:18,280
Then we don't forget the AR dev vg one then slash NV underscore department too.

90
00:07:18,580 --> 00:07:29,470
Sometimes this path might not work so we can use another 1// mapper slash VG one then dash lv.

91
00:07:30,780 --> 00:07:33,300
Underscore department, too, but we will try here.

92
00:07:33,810 --> 00:07:34,610
It's worked.

93
00:07:34,620 --> 00:07:39,630
So we can go both ways because there is two baths or directories.

94
00:07:39,750 --> 00:07:43,800
Baths directories can point to to the same logical value.

95
00:07:44,340 --> 00:07:48,920
Clear the screen, LVS and v GS.

96
00:07:48,960 --> 00:07:55,230
As we can see here, we have extended the sizes of these to logical value and we can see for the volume

97
00:07:55,230 --> 00:08:02,700
group we don't have any size left here or a free size left in this value group.

98
00:08:04,470 --> 00:08:12,120
The last example I'm going to delete a remove the physical value and the group value and the logical

99
00:08:12,120 --> 00:08:12,690
value.

100
00:08:13,410 --> 00:08:18,240
So in this case, I'm going to start removing from the bottom.

101
00:08:18,890 --> 00:08:20,030
To the top.

102
00:08:21,980 --> 00:08:24,560
I'm going to type this commands just to explain.

103
00:08:24,560 --> 00:08:32,990
So I'm going to start to remove from the logical value first, then the volume group second, then the.

104
00:08:35,299 --> 00:08:37,120
The physical volume.

105
00:08:37,130 --> 00:08:41,120
The last one is going to be if we remember what we did.

106
00:08:42,010 --> 00:08:46,660
Indecision, how we can create the physical volume and the group volume.

107
00:08:47,920 --> 00:08:54,100
And the logical value what we did we have to start creating from.

108
00:08:54,810 --> 00:08:57,240
The top to the bottom.

109
00:08:58,360 --> 00:09:01,060
It's the opposite here in the removing.

110
00:09:01,060 --> 00:09:03,160
So we start from the bottom to the top.

111
00:09:06,010 --> 00:09:09,730
So what I'm going to do first right now, I'm going to.

112
00:09:11,880 --> 00:09:17,110
First, first thing I have to go to the etsy slash fstab.

113
00:09:17,880 --> 00:09:20,580
We already did the unmount.

114
00:09:21,150 --> 00:09:22,770
Just to double check that.

115
00:09:22,770 --> 00:09:28,080
We don't maybe do it here so we don't have any mount for this.

116
00:09:28,290 --> 00:09:30,270
Two logical volumes as we can see here.

117
00:09:30,270 --> 00:09:34,920
Also after we have added this disk to the volume group.

118
00:09:34,920 --> 00:09:40,530
So it's also we extend it and use the one giga to this two logical volumes.

119
00:09:41,220 --> 00:09:46,560
So now we don't have let me check over here.

120
00:09:46,560 --> 00:09:47,100
The grid.

121
00:09:47,760 --> 00:09:50,640
As we can see, we don't have the Mount Point.

122
00:09:50,640 --> 00:09:54,750
Also, we can see over here we don't have the mount point for these two logical volumes.

123
00:09:55,710 --> 00:10:01,500
So the first command right now, what I'm going to do, vim slash etsy slash fstab.

124
00:10:02,840 --> 00:10:06,560
Then I'm going to delete these two lines.

125
00:10:06,560 --> 00:10:07,460
I can delete them.

126
00:10:07,460 --> 00:10:08,810
Or I can.

127
00:10:11,130 --> 00:10:16,230
I cannot comment these two lines, so I don't want to use them anymore.

128
00:10:17,970 --> 00:10:18,720
Perfect.

129
00:10:19,350 --> 00:10:21,360
I'm going to save the file and exit.

130
00:10:23,970 --> 00:10:24,800
Elves.

131
00:10:24,840 --> 00:10:30,770
I'm going to right now to remove the logical value first.

132
00:10:31,790 --> 00:10:34,020
Def V1.

133
00:10:35,200 --> 00:10:37,990
And then lv underscore Department one.

134
00:10:38,110 --> 00:10:39,490
Yes.

135
00:10:39,490 --> 00:10:40,910
And the second one?

136
00:10:40,960 --> 00:10:41,920
Perfect.

137
00:10:42,040 --> 00:10:43,090
Yes.

138
00:10:43,870 --> 00:10:46,630
Then we need to move on.

139
00:10:46,630 --> 00:10:48,130
Just double check here.

140
00:10:48,460 --> 00:10:51,700
As you can see, we don't have this two logical volumes anymore.

141
00:10:52,030 --> 00:10:56,020
So I'm going to move on to the volume group.

142
00:10:56,020 --> 00:10:58,720
I need to delete the volume group.

143
00:10:58,720 --> 00:11:00,550
So what I'm going to type.

144
00:11:01,480 --> 00:11:02,980
We remove?

145
00:11:05,070 --> 00:11:08,160
Violin group remove then VG one.

146
00:11:08,430 --> 00:11:11,370
Hit enter vg s hit Enter.

147
00:11:11,370 --> 00:11:13,380
We don't have that volume group anymore.

148
00:11:13,650 --> 00:11:20,490
Last step the physical value for these two devices blocks.

149
00:11:20,490 --> 00:11:25,590
So I'm going to type p v remove.

150
00:11:26,730 --> 00:11:38,790
Then the disk, the path of the disk here, the name SDC, then dev SD hit enter.

151
00:11:39,240 --> 00:11:40,230
As you can see over here.

152
00:11:40,260 --> 00:11:45,930
BVS As you can see here, we don't have physical volume anymore.

153
00:11:46,440 --> 00:11:48,470
Block Can see over.

154
00:11:48,480 --> 00:11:51,540
I'm going to just clear the screen.

155
00:11:51,540 --> 00:11:58,590
As you can see here right now, we have two fresh and new disk.

156
00:11:59,010 --> 00:12:07,080
Last thing if I would like to use also this command part Puerto prop for this to just in case to inform

157
00:12:07,080 --> 00:12:10,530
that the operating system that we have made changes.

158
00:12:10,530 --> 00:12:14,380
So then def SD.

159
00:12:14,940 --> 00:12:19,170
Hit enter ls block perfect.

160
00:12:19,200 --> 00:12:27,840
As you can see here, we don't have any logical volumes right now for these two devices and also we

161
00:12:27,840 --> 00:12:29,490
don't have a mount points.

162
00:12:30,450 --> 00:12:32,100
Thus concludes our session.

163
00:12:32,100 --> 00:12:34,140
Thank you and see you in the next lesson.

