1
00:00:00,000 --> 00:00:11,160
In this video, you'll learn how to create GPT partitions with ParThet.

2
00:00:11,160 --> 00:00:15,520
Now let me mention one thing, ParThet is not the only utility.

3
00:00:15,520 --> 00:00:21,440
You can also use fdisk and create a GPT partition, or use the gdisk utility instead.

4
00:00:21,440 --> 00:00:26,320
And depending on where you come from, you might find that a little bit more intuitive.

5
00:00:26,320 --> 00:00:30,080
As in ParThet, you need to use options that are a bit surprising.

6
00:00:30,080 --> 00:00:32,080
So how are you going to use ParThet?

7
00:00:32,080 --> 00:00:34,119
You need to open the ParThet shell.

8
00:00:34,119 --> 00:00:38,639
So ParThet dev sdb will open the ParThet shell on your sdb device.

9
00:00:38,639 --> 00:00:42,119
And access commands that allow you to work with it.

10
00:00:42,119 --> 00:00:45,919
Like print, which will show the current partition type.

11
00:00:45,919 --> 00:00:52,560
MK label allows you to set either GPT or MBR, which is the MS-DOS partition label.

12
00:00:52,560 --> 00:00:58,400
MK part, which will prompt for the partition name, file system type, and start and end.

13
00:00:58,400 --> 00:01:01,439
This prompt for the file system type is rather confusing,

14
00:01:01,439 --> 00:01:04,160
because it won't create a file system for you.

15
00:01:04,160 --> 00:01:08,239
It will just mark the partition in the appropriate way.

16
00:01:08,239 --> 00:01:11,239
Next, you can use print to verify what you've done so far.

17
00:01:11,239 --> 00:01:17,959
And assuming that you are happy, you can use quit to exit ParThet and update the partition table.

18
00:01:17,959 --> 00:01:22,000
Let me show you how to do this on an example disk.

19
00:01:22,000 --> 00:01:28,879
So once again, I'm starting with lsblk, which is showing that my free device is NVMe 0 and 2.

20
00:01:28,879 --> 00:01:35,239
Good. So I'm using ParThet on dev NVMe 0 and 2.

21
00:01:35,239 --> 00:01:38,599
And there we can see the ParThet interface.

22
00:01:38,599 --> 00:01:43,879
At any time, you can use help for help about the commands that are available.

23
00:01:43,879 --> 00:01:48,279
That can be useful if you get lost on this interface.

24
00:01:48,279 --> 00:01:51,760
Now I'm going to start with the print command.

25
00:01:51,760 --> 00:01:55,559
And the print command is giving me partition table unknown.

26
00:01:55,559 --> 00:01:58,120
Now that's a serious, serious situation.

27
00:01:58,120 --> 00:02:01,480
And that is why I need MKLABEL GPT.

28
00:02:01,480 --> 00:02:05,440
And now we have the partition label set to GPT.

29
00:02:05,440 --> 00:02:12,080
Then I can use MKPART PRIMARY, which is surprising, but it's a requirement in ParThet.

30
00:02:12,080 --> 00:02:20,479
I mean, GPT doesn't have the notion of primary and secondary and standard and logical partitions.

31
00:02:20,479 --> 00:02:22,960
GPT just has partitions.

32
00:02:22,960 --> 00:02:29,839
But ParThet, due to its compatibility with MBR, needs you to specify primary.

33
00:02:29,839 --> 00:02:32,839
Then I need to specify the use of the partition.

34
00:02:32,839 --> 00:02:35,160
And in this case, that will be ext4.

35
00:02:35,160 --> 00:02:40,119
That is also surprising because it doesn't do anything with that information.

36
00:02:40,119 --> 00:02:42,720
It doesn't add an ext4 file system.

37
00:02:42,720 --> 00:02:46,479
You still need to add the file system separately.

38
00:02:46,479 --> 00:02:47,839
0%.

39
00:02:47,839 --> 00:02:52,279
That's how I indicate that the partition should start at the beginning of my disk.

40
00:02:52,279 --> 00:02:56,759
And 1 GB is the size of the partition.

41
00:02:56,759 --> 00:02:58,399
And now I'm going to repeat that.

42
00:02:58,399 --> 00:03:02,440
And I'm using MKPART PRIMARY once more.

43
00:03:02,440 --> 00:03:04,880
And this time I'm using Linux Swap.

44
00:03:04,880 --> 00:03:06,720
Linux Swap is a partition type.

45
00:03:06,720 --> 00:03:08,399
We will talk about it later.

46
00:03:08,399 --> 00:03:11,639
And here you can set the partition type directly.

47
00:03:11,639 --> 00:03:14,000
Then I need to indicate where it should start.

48
00:03:14,000 --> 00:03:16,399
Well, it should start at 1 GB.

49
00:03:16,399 --> 00:03:19,080
And it should end at 6 GB.

50
00:03:19,080 --> 00:03:21,119
And that is doing it.

51
00:03:21,119 --> 00:03:22,679
Hey, we are working in the blind.

52
00:03:22,679 --> 00:03:24,320
I don't like that very much.

53
00:03:24,320 --> 00:03:30,759
So please use print so that you can verify what is going on and what it has done so far.

54
00:03:30,759 --> 00:03:32,440
And this is looking good.

55
00:03:32,440 --> 00:03:37,119
So I am going to use quit to write all of it.

56
00:03:37,119 --> 00:03:40,240
And that's telling me you may need to update etcfsap.

57
00:03:40,279 --> 00:03:46,039
No, because I still need to use MKFS to create my file systems.

58
00:03:46,039 --> 00:03:47,880
Now, I want to show you a command.

59
00:03:47,880 --> 00:03:51,000
And this command is UDEFADM SETTLE.

60
00:03:51,000 --> 00:03:57,520
UDEFADM SETTLE is what the PARTET guys are recommending to update systemd UDEFD

61
00:03:57,520 --> 00:04:01,240
and make sure that the devices are created throughout.

62
00:04:01,240 --> 00:04:05,279
On modern Linux, you won't need to do that very often anymore.

63
00:04:05,279 --> 00:04:08,240
But you're preparing for an exam.

64
00:04:08,240 --> 00:04:12,360
And in the exam, this might come in handy to know about it.

65
00:04:12,360 --> 00:04:14,479
And here you can see what is going on.

66
00:04:14,479 --> 00:04:15,759
And what has it done?

67
00:04:15,759 --> 00:04:20,239
Well, it has created two partitions, the P1 and the P2.

68
00:04:20,239 --> 00:04:24,880
And kind of funny, I asked it to create a 1 GB partition.

69
00:04:24,880 --> 00:04:25,679
It did not.

70
00:04:25,679 --> 00:04:29,760
It created a 1023 MB partition.

71
00:04:29,760 --> 00:04:35,679
And that is one of the reasons that I'm not sure that PARTET is the best utility.

72
00:04:35,679 --> 00:04:37,279
You know what I'm going to do?

73
00:04:37,279 --> 00:04:40,079
I'm going to show you how to do the same with FDISK.

74
00:04:40,079 --> 00:04:44,559
So FDISK on dev NVMe 0 and 2.

75
00:04:44,559 --> 00:04:46,559
Using P to print.

76
00:04:46,559 --> 00:04:50,200
And here we can see the partitions that have been created so far.

77
00:04:50,200 --> 00:04:52,399
Using M for the menu.

78
00:04:52,399 --> 00:04:58,320
Now, in FDISK, it's important to know that FDISK is an MBR-oriented utility.

79
00:04:58,320 --> 00:05:02,320
So if you want to create GPT, you really must use G

80
00:05:02,320 --> 00:05:07,480
to create a new empty GPT partition table before you do anything else.

81
00:05:07,480 --> 00:05:10,880
Now I'm going to use N to create a new partition.

82
00:05:10,880 --> 00:05:13,239
And I like it that FDISK is telling me something.

83
00:05:13,239 --> 00:05:16,519
Hey, it's suggesting me to create a default partition 3.

84
00:05:16,519 --> 00:05:19,279
And I can go up to 128.

85
00:05:19,279 --> 00:05:23,559
And then first sector, well, I'm just going to enter what it proposes.

86
00:05:23,559 --> 00:05:29,959
And last sector, I'm going to make that plus 1 G for 1 GB.

87
00:05:29,959 --> 00:05:34,320
And there we can see new partition 3 of type Linux file system.

88
00:05:34,320 --> 00:05:35,600
I'm using P.

89
00:05:35,600 --> 00:05:39,480
And there we can see that my very first partition that I created in part,

90
00:05:39,480 --> 00:05:41,720
it is the type Linux file system.

91
00:05:41,720 --> 00:05:43,359
Oh, that is this one.

92
00:05:43,359 --> 00:05:47,160
And the FDISK partition is the type Linux file system as well.

93
00:05:47,160 --> 00:05:52,359
The funny thing is when in part that I specified I want an EXT4 partition,

94
00:05:52,359 --> 00:05:54,760
it doesn't do anything with EXT4.

95
00:05:54,760 --> 00:05:58,480
It just sets the partition type as Linux file system.

96
00:05:58,480 --> 00:06:00,320
And that is what it is doing.

97
00:06:00,320 --> 00:06:03,920
And here you can see that FDISK has done what I asked it to do.

98
00:06:03,920 --> 00:06:06,320
It created the 1 GB partition.

99
00:06:06,320 --> 00:06:07,959
And that's what I wanted, right?

100
00:06:07,959 --> 00:06:09,440
So I'm happy with it.

101
00:06:09,440 --> 00:06:11,679
And I'm going to use W to write.

102
00:06:11,679 --> 00:06:15,839
And in case you are wondering, doesn't it hurt to use two different utilities?

103
00:06:15,839 --> 00:06:17,119
No, not at all.

104
00:06:17,119 --> 00:06:21,679
Because they are just two different ways to write information to your disk.

105
00:06:21,679 --> 00:06:23,160
And it just works.

106
00:06:23,160 --> 00:06:26,880
And that is what we confirm when we use LSBLK.

107
00:06:26,880 --> 00:06:31,359
There you go, three partitions on NVMe 0 and 2.

