- So in this video
we are going to actually create some partitions.
Now what you need to know in order to create partitions
there are two different systems.
To start with, there is MBR.
MBR stands for mass boot record
and MBR is the old solution for addressing discs.
It was introduced in 1981 together
with the original PC standard.
So it's very old and very minimal
but it is still used, especially in cloud environments.
And for that reason, you should know how to work with MBR.
In MBR, a maximum of four partitions can be written
to a 512 bytes boot sector on the hard desk.
And to address beyond four partitions,
three of them are configured as primary
and one is configured as an extended partition.
Extended partitions can only be used to
include logical partitions.
And the first logical partition is always numbered
as partition number five.
Fdisk is the most important utility
to create NBR partitions.
But before I'm going to show you
I want you to understand why
and when you need to do this.
Well, you need to do this if ever you are going to
add new, hard risk to Linux.
Because before you can use it
you need to create a partition
and you need to create a file system.
And that is what we are going to discover right now.
All right.
So first step in order to create a partition is to do LSBLK.
LSBLK is an important command.
It lists block devices.
We have already seen it when I introduce mounting.
Now, although, we see that there are four hard discs.
SDA is a primary hard disc.
And on SDA we already have a couple of partitions.
SDB is a second hard disk.
There's an SDC and an SDD as well.
I am going to use fdisk on def SDB.
So sudo fdisk on dev SDB.
To address these hard discs.
You need to address them as a file.
So this SDA, SDB, SDC, et cetera
exists as file in the dev directory.
Dev is for devices.
And if you want to create partitions
pseudo fdisc on dev SDB is what you need.
Now, here, you can see that fdisc is telling us
that the devices does not contain a
recognized partition table.
That is correct because this is a brand new device.
And that is why we can see that it created a new disk label
with DOS disc identifier, whatever.
And the interesting thing is
that it is telling us it's a DOS disk label.
And yes, that is DOS,
as in the disc operating system that was introduced
by Microsoft in 1981.
Good. Let me use end to create a new partition
and here it's asking what type of partition.
I wanna keep it simple.
And we just go for primary partition
and I'm creating partition number one, and the first sector
I'm just accepting the default.
And I want to specify a size
and I make this a five gigabyte partition.
So plus five, and then an uppercase G.
If this kindly tells us
what it expects us to do.
And here we can see plus sign in K M G, T, or P.
So plus 5g is what I want to do.
So as you can see, it created a new partition.
one of type Linux and a size five gigabyte.
That's exactly what I need.
In F this gets nice to use P to verify.
P for print.
And we can see everything that has done so far
on the 10 gigabyte hard disk.
The thing that really matters, is here.
We see the dev SDB one.
And if you're happy with that use w to write
and then you have your partition.
Of course you want to verify.
And in order to verify
that everything worked all right, sudo, LSB, okay.
Is the right thing.
And now we can see that on SDB.
We now have an SDB one device as well.
Oh, and by the way, I have just demonstrated fdisk.
Fdisk is an old and very powerful utility.
You may hear about parted as well.
Honestly, I don't like parted
because it's not a very intuitive tool.
Even if it has been developed
to be more intuitive than Fdisk.
So if I may give you strong advice
invest some time learning fdisk.
Because you will be better off on the long term, especially
if later you want to continue with one of the exams
certification exams for Linux, and you need to
be able to do advanced stuff with partitions as well.
Then fdisk definitely is the best.