In this video, I'll show you how to create MBR primary partitions using the fdisk utility.
In case you are wondering, do we still need to know about that? Yes, because you want
to pass Linux Plus and also because in some systems you'll still encounter MBR partitions.
You know, some Linux systems stay around for a long time, and if you want to be certified
to manage them, you better have some basic skills regarding MBR. For this demo, I've
used my virtualization layer to add some storage. If we use LSB-LK, we can find information
about it. Hey, talking about changing device names, do you see that? I was just talking
about it. And the device previously known as dev-nvme-0-n1 has now suddenly changed
to dev-nvme-0-n3. But fortunately, FSTEP is using UUIDs, and these UUIDs are written
on the device itself, so that will always correctly be detected. I'm going to use fdisk
on dev-nvme-0-n1, and that is my first disk. Always make sure that you use your partitioning
utility on a disk. You can't use it on a partition. Now, we can see that FVS is telling us that
the device does not contain a partition table, and it created a new DOS or MBR disk label,
and that's exactly what we want. You can also use M for help. You should see that as M for
menu because you can see all the useful options in this menu. And there's a couple of options
that I like. To start with, the option P. Let me put it on the top of my screen. P is
for print. So here we can find some generic disk information, including that this is a
20-gigabyte disk. This is the amount of bytes, and we are using sectors with the size of
512 bytes. Now, let me use N to create a new partition. And there we have the choice between
primary or extended. Remember, in MBR, you can only address four partitions. But as this
is the first one, I'm going to start with a primary partition, partition number one.
The first sector starts at 2048. In case you are wondering, why doesn't it start at the
beginning? Well, there's a simple explanation. Every disk, the first megabyte is reserved
for metadata storage, administrative information about what you are doing on your disk. So
your first partition will always start at MB number one. Then it's asking for the size.
In the last sector, well, I'm going for the plus size in KMGT or P. So I'm using plus
one uppercase G. Don't forget, Linux is case-sensitive. Lowercase G is really not going to work. And
now we can see that the new partition one of type Linux and a size of one gigabyte has
been set. It's a good idea to verify that using P for print partition table. And here
we can see that the device NVMe 0 and 1P1 has been added. If that is what you wanted,
use W to write, and then use LSB OK to verify that the new partition is visible. And as
you can see, it is visible. So mission accomplished. We still need to create a file system on top
of it. I'm showing you how to work with file systems in one of the upcoming videos.