1 00:00:00,000 --> 00:00:11,680 In this video, I'll show you how to work with extended and logical partitions in an MBR 2 00:00:11,680 --> 00:00:13,360 environment. 3 00:00:13,360 --> 00:00:19,080 So let me explain primary, extended and logical partitions which you are using in MBR. 4 00:00:19,080 --> 00:00:20,080 It's easy. 5 00:00:20,080 --> 00:00:24,799 If this is your hard disk, not a perfect circle, but that doesn't matter, in your hard disk 6 00:00:24,799 --> 00:00:27,559 you create different partitions. 7 00:00:27,559 --> 00:00:32,119 So in MBR, you are placed for four partitions only. 8 00:00:32,119 --> 00:00:37,439 So if each of these pizza pies is a partition, well, you are placed for one more. 9 00:00:37,439 --> 00:00:41,560 But what happens if you want to create more than just four partitions? 10 00:00:41,560 --> 00:00:46,880 Well, in MBR, due to the limited disk space, you don't have space for it. 11 00:00:46,880 --> 00:00:51,080 So what you are going to do, you treat one of them as an extended partition, and within 12 00:00:51,080 --> 00:00:56,119 the extended partition, you are going to add your logical partitions. 13 00:00:56,119 --> 00:01:00,480 And that makes that you can get beyond the limitation of four partitions only. 14 00:01:00,480 --> 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 LSBOK to list your block devices. 16 00:01:08,199 --> 00:01:16,480 I'm going to use fdisk on dev nvme 0 n1. 17 00:01:16,480 --> 00:01:21,160 And I like to use P. You should always use P so that you know what you are doing. 18 00:01:21,160 --> 00:01:24,199 Next I'm using N to create a new partition. 19 00:01:24,199 --> 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,839 But I'm going directly for the extended partition. 22 00:01:34,839 --> 00:01:40,400 The reason that normally you first consume all of your primary partitions is that primary 23 00:01:40,400 --> 00:01:42,900 partitions are direct partitions. 24 00:01:42,900 --> 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:33,559 And you can see the extended partition ranges from 2099200 up to 41943039. 36 00:02:33,559 --> 00:02:34,559 Good. 37 00:02:34,559 --> 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,119 And it's adding logical partition five. 40 00:02:48,119 --> 00:02:55,559 If you have no more space in your MBR partition table, you start using your logical partition. 41 00:02:55,559 --> 00:02:59,800 And the first logical partition is always partition number five. 42 00:02:59,800 --> 00:03:05,160 So I am going to press enter on the first sector, which is within the range of the extended 43 00:03:05,160 --> 00:03:07,679 partition, as we discussed before. 44 00:03:07,679 --> 00:03:15,399 And next, I'm going to use last sector plus one uppercase G to make it a one-gig partition. 45 00:03:15,399 --> 00:03:19,960 So logical partitions are always created in order. 46 00:03:19,960 --> 00:03:25,800 And here also goes that this order might change if you delete a logical partition, for instance. 47 00:03:25,800 --> 00:03:27,720 But for now, we are not going to do that. 48 00:03:27,720 --> 00:03:33,360 I'm just showing you the current partitioning, where we have NVMe 0 and 1P2. 49 00:03:33,360 --> 00:03:39,440 And you can see that NVMe 0 and 1P5 falls within the range of the logical partition. 50 00:03:39,440 --> 00:03:45,520 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,520 --> 00:03:50,160 And let's use LSBLK to verify. 52 00:03:50,160 --> 00:03:53,119 So so far, we have only created partitions. 53 00:03:53,119 --> 00:03:56,839 The next step would be to create a file system on top of it. 54 00:03:56,839 --> 00:04:00,679 Because right now, the partitions are just a reservation of disk space. 55 00:04:00,679 --> 00:04:03,259 They are not usable at all. 56 00:04:03,259 --> 00:04:08,020 So in one of the next videos, you'll learn how to create file systems on top of them. 57 00:04:08,020 --> 00:04:12,179 But before that, we will talk about GPT partitions in the next video.