1
00:00:00,000 --> 00:00:00,930
In this demonstration,

2
00:00:00,930 --> 00:00:02,820
I will walk you through how to partition a file system

3
00:00:02,820 --> 00:00:05,010
in Linux using the F disk tool.

4
00:00:05,010 --> 00:00:07,740
The F disk utility is a menu driven program that is used

5
00:00:07,740 --> 00:00:10,260
to create, modify or to delete partitions

6
00:00:10,260 --> 00:00:11,580
on a storage drive.

7
00:00:11,580 --> 00:00:13,500
We're also going to create an XFS

8
00:00:13,500 --> 00:00:17,130
and an EXT four file system on these partitions.

9
00:00:17,130 --> 00:00:19,440
I'm going to stay root for the walkthrough to save time

10
00:00:19,440 --> 00:00:22,410
since most of the commands require elevated privileges.

11
00:00:22,410 --> 00:00:24,750
So I'm going to start out by creating a partition

12
00:00:24,750 --> 00:00:27,720
on the second hard drive of the device.

13
00:00:27,720 --> 00:00:29,070
So I'm going to use F disk,

14
00:00:31,290 --> 00:00:34,388
by sdb,

15
00:00:34,388 --> 00:00:37,173
(indistinct) second hard drive on the device.

16
00:00:38,670 --> 00:00:40,893
Now I want to print, this.

17
00:00:42,270 --> 00:00:44,880
Now we see that there's no partitions currently

18
00:00:44,880 --> 00:00:46,500
on this drive.

19
00:00:46,500 --> 00:00:48,150
Now click M for help.

20
00:00:48,150 --> 00:00:51,420
Let's take a look at the current options that we can use

21
00:00:51,420 --> 00:00:53,130
for F disk.

22
00:00:53,130 --> 00:00:55,200
Remember, it's just a menu driven tool.

23
00:00:55,200 --> 00:00:56,730
So all I had to do is click the letter,

24
00:00:56,730 --> 00:00:58,350
and it will prompt you all the changes that you

25
00:00:58,350 --> 00:00:59,200
would like to do.

26
00:01:01,320 --> 00:01:03,983
So, first thing we want to do is create a new partition.

27
00:01:07,590 --> 00:01:08,880
And for this example, we're going

28
00:01:08,880 --> 00:01:11,370
to use a primary partition.

29
00:01:11,370 --> 00:01:13,830
A primary partition contains one file system

30
00:01:13,830 --> 00:01:15,300
or a logical drop.

31
00:01:15,300 --> 00:01:17,490
It's sometimes referred to as a volume as well.

32
00:01:17,490 --> 00:01:19,227
Now, typically the swap file system

33
00:01:19,227 --> 00:01:22,650
and the boot portions are stored on a primary partition

34
00:01:22,650 --> 00:01:26,250
and a swap file system is just the part of the hard drive

35
00:01:26,250 --> 00:01:28,800
that the system will use when the RAM is full.

36
00:01:28,800 --> 00:01:31,650
So it's able to offload some information

37
00:01:31,650 --> 00:01:34,380
and to use the RAM for more active applications.

38
00:01:34,380 --> 00:01:35,523
Okay, P.

39
00:01:37,110 --> 00:01:38,763
We use partition one default.

40
00:01:40,350 --> 00:01:42,200
We want to let the first sector stay.

41
00:01:44,640 --> 00:01:48,180
Now we're going to make this drive roughly two gigabytes.

42
00:01:48,180 --> 00:01:49,653
So I'm going to do plus,

43
00:01:51,660 --> 00:01:54,030
2048,

44
00:01:54,030 --> 00:01:54,863
million bytes,

45
00:01:54,863 --> 00:01:57,450
because that's what correlates to about two gigabytes.

46
00:01:59,130 --> 00:02:00,330
And we see that has set.

47
00:02:01,470 --> 00:02:03,303
Now, we're going to have to write,

48
00:02:05,820 --> 00:02:07,710
and that now saves the information that's

49
00:02:07,710 --> 00:02:09,120
on a partition table.

50
00:02:09,120 --> 00:02:11,039
Now, in order to update a kernel,

51
00:02:11,039 --> 00:02:14,400
we have to use a command called partprobe.

52
00:02:14,400 --> 00:02:15,960
This command is used to update the kernel

53
00:02:15,960 --> 00:02:17,820
with the changes on our partition table.

54
00:02:17,820 --> 00:02:20,270
If not, it will only read it once we do a reboot.

55
00:02:21,780 --> 00:02:22,730
So we'll do it now.

56
00:02:23,621 --> 00:02:24,454
Partprobe,

57
00:02:25,413 --> 00:02:26,403
dev, sdb.

58
00:02:29,340 --> 00:02:30,843
All right, good to go there.

59
00:02:32,160 --> 00:02:35,460
Next thing we're going to do is make the XFS file system

60
00:02:35,460 --> 00:02:38,040
on the partition that we just created.

61
00:02:38,040 --> 00:02:40,170
The XFS file system is a high performance

62
00:02:40,170 --> 00:02:43,290
journaling file system that provides fast recovery.

63
00:02:43,290 --> 00:02:46,380
It's used for typically large files.

64
00:02:46,380 --> 00:02:48,603
So we're going to do, make file system,

65
00:02:49,620 --> 00:02:50,453
XFS.

66
00:02:55,080 --> 00:02:57,150
Now, another option for this command.

67
00:02:57,150 --> 00:03:00,090
You can use the dash T after

68
00:03:00,090 --> 00:03:01,350
MKFS,

69
00:03:01,350 --> 00:03:03,300
and then just specify the type of file system you

70
00:03:03,300 --> 00:03:04,133
want to use.

71
00:03:04,133 --> 00:03:07,260
But the faster simpler way is just to use the period after

72
00:03:07,260 --> 00:03:09,750
and add the type of file system you would like to use.

73
00:03:09,750 --> 00:03:11,910
So in this example, its going to be XFS.

74
00:03:11,910 --> 00:03:14,520
All right, we're going to assume is that there

75
00:03:14,520 --> 00:03:17,610
is currently a file system on that particular portion.

76
00:03:17,610 --> 00:03:20,430
So I'm just going to use the dash F, to force it.

77
00:03:20,430 --> 00:03:22,950
Now it looks like everything went through correctly.

78
00:03:22,950 --> 00:03:24,510
Next we're going to make another partition

79
00:03:24,510 --> 00:03:26,550
using the parted tool.

80
00:03:26,550 --> 00:03:28,860
The gnu new parted tool is very similar to F disk,

81
00:03:28,860 --> 00:03:31,660
it's menu driven and it's just used to create partition.

82
00:03:33,000 --> 00:03:33,960
All right, now I'm going to print

83
00:03:33,960 --> 00:03:36,930
out the list of partitions.

84
00:03:36,930 --> 00:03:38,580
So we can see here,

85
00:03:38,580 --> 00:03:40,110
the partition that we created earlier

86
00:03:40,110 --> 00:03:42,090
using the F disk tool.

87
00:03:42,090 --> 00:03:43,800
Now to make the partition,

88
00:03:43,800 --> 00:03:45,250
we use the make part command.

89
00:03:47,010 --> 00:03:49,410
And again, we use the primary command on here.

90
00:03:49,410 --> 00:03:50,243
Primary,

91
00:03:51,180 --> 00:03:52,013
hard drop,

92
00:03:53,070 --> 00:03:53,903
file system we are going to use this time is

93
00:03:53,903 --> 00:03:55,833
going to be EXT four.

94
00:03:56,880 --> 00:04:01,053
So I'm going to use use 2, 1, 4, 9 megabytes.

95
00:04:02,700 --> 00:04:05,310
We just end it at the end of the hard drive,

96
00:04:05,310 --> 00:04:07,683
it's going to be 8, 9, 8, 5, 9, 0 megabytes.

97
00:04:13,830 --> 00:04:18,450
Now just note, when we put in that type of file system

98
00:04:18,450 --> 00:04:20,820
that's not actually formatting the disk

99
00:04:20,820 --> 00:04:22,200
to be that file system.

100
00:04:22,200 --> 00:04:24,210
That's just letting the system know that an

101
00:04:24,210 --> 00:04:28,203
EXT four file system will be formatted on this partition.

102
00:04:29,340 --> 00:04:32,373
Now we have to go through and actually make the file system.

103
00:04:32,373 --> 00:04:33,567
So we're going to do,

104
00:04:33,567 --> 00:04:34,400
EXT four.

105
00:04:38,102 --> 00:04:38,935
SDB two.

106
00:04:41,160 --> 00:04:42,600
We can see by this information,

107
00:04:42,600 --> 00:04:44,750
that the command was executed successfully.

108
00:04:45,600 --> 00:04:48,663
Now, last thing we want to do is to label the partitions.

109
00:04:49,800 --> 00:04:51,450
So for the XFS one,

110
00:04:51,450 --> 00:04:56,230
we have to use the XFS underscore admin command

111
00:04:58,440 --> 00:04:59,643
and this will list out,

112
00:05:01,770 --> 00:05:04,503
the actual partition.

113
00:05:06,870 --> 00:05:08,580
And we can see that the label is empty.

114
00:05:08,580 --> 00:05:10,800
So now we're just going to arrow up,

115
00:05:10,800 --> 00:05:12,148
change this to capital L,

116
00:05:12,148 --> 00:05:14,340
which in that case, that we're going to label

117
00:05:14,340 --> 00:05:16,200
the actual partition,

118
00:05:16,200 --> 00:05:17,900
so we can call that system backup.

119
00:05:22,410 --> 00:05:24,390
Okay. That went through successful.

120
00:05:24,390 --> 00:05:27,480
Now for the EXT four file system,

121
00:05:27,480 --> 00:05:29,013
we are going to have to use a different command.

122
00:05:29,013 --> 00:05:30,463
I'm going to use E two label,

123
00:05:32,550 --> 00:05:33,383
dev,

124
00:05:35,850 --> 00:05:36,683
two.

125
00:05:36,683 --> 00:05:38,910
And that blank currently indicates that there's no label

126
00:05:38,910 --> 00:05:41,223
for the EXT four partition.

127
00:05:42,240 --> 00:05:45,210
Now to set it, we're simply going to arrow up

128
00:05:45,210 --> 00:05:46,920
and label it,

129
00:05:46,920 --> 00:05:48,450
data

130
00:05:48,450 --> 00:05:49,283
back up.

131
00:05:51,090 --> 00:05:53,070
And now, she got through successfully.

132
00:05:53,070 --> 00:05:54,513
Let's go back to verify,

133
00:05:56,580 --> 00:05:58,083
looks like we are good there,

134
00:05:59,010 --> 00:05:59,880
Okay.

135
00:05:59,880 --> 00:06:01,740
We just did a walk through of how to create partitions

136
00:06:01,740 --> 00:06:05,100
on Linux using the F disk and the parted tool.

137
00:06:05,100 --> 00:06:08,430
We also used the XFS command to make file systems

138
00:06:08,430 --> 00:06:09,450
on the partitions.

139
00:06:09,450 --> 00:06:11,300
And I'll see you, in the next lesson.

