- In this video
I'll show you how to create MBR partitions.
Before creating any partitions
I'm going to use LSBLK.
LSBLK is for list block device
where we can see that I currently have an SDA,
and on that I have SDA1 and SDA2.
I also have SDB, SDC, and SDD.
And for this demo I'm going to use SDB.
To create MBR I'm going to use the good old F disk utility.
And this utility requires the name of the device
on which you want to create the partitions.
F disk is not the only partitioning utility
that you can use.
You could also use partlet,
but I don't like partlet very much
because it's hiding the advanced features,
and F disk is just more powerful.
So that's why I'm using F disk.
Now we get some message,
and this message is telling me,
"Oh, we don't have a recognized partition table,"
and created a new DOS disk label.
DOS disk label, that's an MBR disk label.
So we can use P to figure out what is going on.
And while using P
we see some generic information about the disk.
We don't see any partitions yet.
If I want to get help, I need to press the M key.
And after pressing the M key
I see what is more like a menu.
That's probably what the M is coming from.
And I can decide what I want to do.
Well, generic, I want to add a new partition.
So let me use N to create a new partition.
And then it is prompting me what do I want to do?
It's telling me I can choose between primary and extended.
And there are four primaries free.
You should always use all of your primaries
before starting to use extended and logical partitions
because primaries are easier to troubleshoot
in case anything goes wrong.
So I'm pressing P, partition number,
well partition number one.
And the first sector,
I'm pressing enter to accept the default first sector.
And then it asks for the last sector,
which can also be specified as a size.
I'm using plus 2G to create a two gigabytes partition here.
And there we go.
Create a new partition, one of type Linux
and size two gigabytes.
Using P again, we can see this new partition.
Now that was easy.
I'm going to create two more primary partitions.
And then I want to show you how to work
with an extended partition.
So I do this real fast, partition number two, first sector.
I accept the default.
I make this one gigabytes,
and likewise, partition number three, primary again.
Number three, default first sector plus 1G
to make it one gigabytes.
And now I'm pressing N again.
And what is happening?
Well, you can see that the utility
is defaulting to E for extended.
That is because I'm creating my fourth partition.
And in a master book records
you can create a maximum of four partitions.
So I'm accepting the default for extended.
And if you create an extended,
then you should allocate all of the remaining disk space
to the extended partition.
Logical partitions are created
within the extended partition.
And if you don't allocate all of your disk space
at this moment, you cannot do anything with it later on.
So I'm pressing enter and enter
to use all of the remaining disk space,
which creates six gigabytes extended partition.
B will show me SDB4,
which is ID five type is extended.
That's what I needed.
Now if I use N
then it's telling me
all primary partitions are in use,
and it is going to create a logical partition.
I want to have two logical partitions.
So partition number five is the first one.
I want it to be one gigabyte.
And partition number six will be the second one.
I also want it to be one gigabyte.
Now I'm using P again.
And what do we see?
We see that the extended partition
has this range of sectors,
and if you look at the range of sectors for SDB5,
then you can see it falls within the range of sectors
for the extended partition and likewise for SDB6.
So logical partitions are a part of the extended partition,
and that's what I need you to realize.
Once we are done,
use W to write and then everything is good.
You can use LSBLK to verify,
or if you want to do it a fancy way,
you can also use cat on the file slash proc
slash partitions.
That's the kernel interface file in the proc file system
where you can see that these partitions
really have been created.
And that's how you work with MBR partitions.
Now the next thing will be to create a file system
on top of it.
That's what you will learn in the next lesson.
First, we are going to explore
how to work with GPT partitions.