1
00:00:00,000 --> 00:00:12,480
In this video, I'll show you how to work with extended and logical partitions in an MBR

2
00:00:12,480 --> 00:00:13,480
environment.

3
00:00:13,480 --> 00:00:18,320
So let me explain primary extended and logical partitions which are used in MBR.

4
00:00:18,320 --> 00:00:19,320
It's easy.

5
00:00:19,320 --> 00:00:24,840
If this is your hard disk, not a perfect circle, but that doesn't matter, in your hard disk

6
00:00:24,840 --> 00:00:27,600
you create different partitions.

7
00:00:27,600 --> 00:00:32,160
So in MBR, you are placed for four partitions only.

8
00:00:32,160 --> 00:00:37,480
So if each of these pizza pies is a partition, well, you are placed for one more.

9
00:00:37,480 --> 00:00:41,680
But what happens if you want to create more than just four partitions?

10
00:00:41,680 --> 00:00:46,919
Well, in MBR, due to the limited disk space, you don't have space for it.

11
00:00:46,919 --> 00:00:51,119
So what you are going to do, you treat one of them as an extended partition, and within

12
00:00:51,119 --> 00:00:56,160
the extended partition, you are going to add your logical partitions.

13
00:00:56,160 --> 00:01:00,439
And that makes that you can get beyond the limitation of four partitions only.

14
00:01:00,439 --> 00:01:05,199
Okay, at any time, if you start working with partitions, it's a good idea to start with

15
00:01:05,199 --> 00:01:08,199
LSBLK to list your block devices.

16
00:01:08,199 --> 00:01:17,800
I'm going to use fdisk on dev nvme 0 n1, and I like to use p.

17
00:01:17,800 --> 00:01:21,160
You should always use p so that you know what you are doing.

18
00:01:21,160 --> 00:01:24,160
Next I'm using n to create a new partition.

19
00:01:24,160 --> 00:01:29,879
Normally, you would always use all your primary partitions before you start using an extended

20
00:01:29,879 --> 00:01:30,879
partition.

21
00:01:30,879 --> 00:01:34,800
But I'm going directly for the extended partition.

22
00:01:34,800 --> 00:01:40,360
The reason that normally you first consume all of your primary partitions is that primary

23
00:01:40,360 --> 00:01:42,879
partitions are direct partitions.

24
00:01:42,879 --> 00:01:47,760
And if ever you need to do troubleshooting on disk, it is much easier if you can troubleshoot

25
00:01:47,760 --> 00:01:49,680
primary partitions.

26
00:01:49,680 --> 00:01:54,519
Then by the time you start using your extended partition, you address all of the remaining

27
00:01:54,519 --> 00:01:58,080
disk space in your extended partition.

28
00:01:58,080 --> 00:02:04,000
So here I'm going to add partition number two as the extended partition.

29
00:02:04,000 --> 00:02:06,879
It's asking for the first sector, I'm pressing enter.

30
00:02:06,879 --> 00:02:10,440
And then it's asking for the last sector, and I'm pressing enter again.

31
00:02:10,440 --> 00:02:16,520
Particularly, if this is partition number four that you create in MBR, after creating

32
00:02:17,039 --> 00:02:20,800
partition number four, there's no more place in your partition table.

33
00:02:20,800 --> 00:02:24,080
And that is why I'm pressing enter on the second question.

34
00:02:24,080 --> 00:02:26,559
So now I have my extended partition.

35
00:02:26,559 --> 00:02:34,119
And you can see the extended partition ranges from 2099200 up to 41943039.

36
00:02:34,119 --> 00:02:36,639
Good.

37
00:02:36,639 --> 00:02:40,119
Next I'm going to use n to create a new partition.

38
00:02:40,119 --> 00:02:44,559
And this time it is telling me all space for primary partitions is in use.

39
00:02:44,600 --> 00:02:48,160
And it's adding logical partition five.

40
00:02:48,160 --> 00:02:55,600
If you have no more space in your MBR partition table, you start using your logical partition.

41
00:02:55,600 --> 00:02:59,839
And the first logical partition is always partition number five.

42
00:02:59,839 --> 00:03:05,199
So I am going to press enter on the first sector, which is within the range of the extended

43
00:03:05,199 --> 00:03:07,720
partition, as we discussed before.

44
00:03:07,720 --> 00:03:15,320
Next, I'm going to use last sector plus one uppercase G to make it a one gig partition.

45
00:03:15,320 --> 00:03:19,839
So logical partitions are always created in order.

46
00:03:19,839 --> 00:03:25,720
And here also goes that this order might change if you delete a logical partition, for instance.

47
00:03:25,720 --> 00:03:27,839
But for now, we are not going to do that.

48
00:03:27,839 --> 00:03:33,240
I'm just showing you the current partitioning, where we have NVMe 0 and 1P2.

49
00:03:33,240 --> 00:03:39,320
And you can see that NVMe 0 and 1P5 falls within the range of the logical partition.

50
00:03:39,320 --> 00:03:45,240
So if that is what you wanted, and that is what I want right here, let's do W to write.

51
00:03:45,240 --> 00:03:50,039
And let's use LSBLK to verify.

52
00:03:50,039 --> 00:03:53,039
So, so far, we have only created partitions.

53
00:03:53,039 --> 00:03:56,559
The next step would be to create a file system on top of it.

54
00:03:56,559 --> 00:04:00,559
Because right now, the partitions are just a reservation of disk space.

55
00:04:00,559 --> 00:04:03,119
They are not usable at all.

56
00:04:03,119 --> 00:04:07,839
So in one of the next videos, you'll learn how to create file systems on top of them.

57
00:04:07,839 --> 00:04:12,160
But before that, we'll talk about GPT partitions in the next video.

