In this video, you'll learn how to create GPT partitions with ParThet.
Now let me mention one thing, ParThet is not the only utility.
You can also use fdisk and create a GPT partition, or use the gdisk utility instead.
And depending on where you come from, you might find that a little bit more intuitive.
As in ParThet, you need to use options that are a bit surprising.
So how are you going to use ParThet?
You need to open the ParThet shell.
So ParThet dev sdb will open the ParThet shell on your sdb device.
And access commands that allow you to work with it.
Like print, which will show the current partition type.
MK label allows you to set either GPT or MBR, which is the MS-DOS partition label.
MK part, which will prompt for the partition name, file system type, and start and end.
This prompt for the file system type is rather confusing,
because it won't create a file system for you.
It will just mark the partition in the appropriate way.
Next, you can use print to verify what you've done so far.
And assuming that you are happy, you can use quit to exit ParThet and update the partition table.
Let me show you how to do this on an example disk.
So once again, I'm starting with lsblk, which is showing that my free device is NVMe 0 and 2.
Good. So I'm using ParThet on dev NVMe 0 and 2.
And there we can see the ParThet interface.
At any time, you can use help for help about the commands that are available.
That can be useful if you get lost on this interface.
Now I'm going to start with the print command.
And the print command is giving me partition table unknown.
Now that's a serious, serious situation.
And that is why I need MKLABEL GPT.
And now we have the partition label set to GPT.
Then I can use MKPART PRIMARY, which is surprising, but it's a requirement in ParThet.
I mean, GPT doesn't have the notion of primary and secondary and standard and logical partitions.
GPT just has partitions.
But ParThet, due to its compatibility with MBR, needs you to specify primary.
Then I need to specify the use of the partition.
And in this case, that will be ext4.
That is also surprising because it doesn't do anything with that information.
It doesn't add an ext4 file system.
You still need to add the file system separately.
0%.
That's how I indicate that the partition should start at the beginning of my disk.
And 1 GB is the size of the partition.
And now I'm going to repeat that.
And I'm using MKPART PRIMARY once more.
And this time I'm using Linux Swap.
Linux Swap is a partition type.
We will talk about it later.
And here you can set the partition type directly.
Then I need to indicate where it should start.
Well, it should start at 1 GB.
And it should end at 6 GB.
And that is doing it.
Hey, we are working in the blind.
I don't like that very much.
So please use print so that you can verify what is going on and what it has done so far.
And this is looking good.
So I am going to use quit to write all of it.
And that's telling me you may need to update etcfsap.
No, because I still need to use MKFS to create my file systems.
Now, I want to show you a command.
And this command is UDEFADM SETTLE.
UDEFADM SETTLE is what the PARTET guys are recommending to update systemd UDEFD
and make sure that the devices are created throughout.
On modern Linux, you won't need to do that very often anymore.
But you're preparing for an exam.
And in the exam, this might come in handy to know about it.
And here you can see what is going on.
And what has it done?
Well, it has created two partitions, the P1 and the P2.
And kind of funny, I asked it to create a 1 GB partition.
It did not.
It created a 1023 MB partition.
And that is one of the reasons that I'm not sure that PARTET is the best utility.
You know what I'm going to do?
I'm going to show you how to do the same with FDISK.
So FDISK on dev NVMe 0 and 2.
Using P to print.
And here we can see the partitions that have been created so far.
Using M for the menu.
Now, in FDISK, it's important to know that FDISK is an MBR-oriented utility.
So if you want to create GPT, you really must use G
to create a new empty GPT partition table before you do anything else.
Now I'm going to use N to create a new partition.
And I like it that FDISK is telling me something.
Hey, it's suggesting me to create a default partition 3.
And I can go up to 128.
And then first sector, well, I'm just going to enter what it proposes.
And last sector, I'm going to make that plus 1 G for 1 GB.
And there we can see new partition 3 of type Linux file system.
I'm using P.
And there we can see that my very first partition that I created in part,
it is the type Linux file system.
Oh, that is this one.
And the FDISK partition is the type Linux file system as well.
The funny thing is when in part that I specified I want an EXT4 partition,
it doesn't do anything with EXT4.
It just sets the partition type as Linux file system.
And that is what it is doing.
And here you can see that FDISK has done what I asked it to do.
It created the 1 GB partition.
And that's what I wanted, right?
So I'm happy with it.
And I'm going to use W to write.
And in case you are wondering, doesn't it hurt to use two different utilities?
No, not at all.
Because they are just two different ways to write information to your disk.
And it just works.
And that is what we confirm when we use LSBLK.
There you go, three partitions on NVMe 0 and 2.