I know that you can only have 4 primary partitions on a hard drive. But if you're using less than 4, is there a benefit/penalty for using logical partitions?
Primary vs Logical partition
partition
Related Solutions
The partitions are spaced well enough, and you could transform the primary partitition sda4
into a logical one sda10
, if you first resize the extended partition sda3
.
See below for a modified table that you could use with sfdisk /dev/sda < new_partition
, and for a diff showing the modifications made. After this, you should have a free slot for another primary partition (a new sda4
).
However I strongly advice you to first try it on a dummy file that you could create with
$ dd if=/dev/null of=/tmp/dummy bs=1 seek=1000G
$ sfdisk /tmp/dummy < new_partition
Then, as root:
# kpartx -a /tmp/dummy
The last step will let the kernel attach a loop device (/dev/loop0
if it isn't already in use) to /tmp/dummy
and scan all the partitions that you have created on it. Then you could check with partitioning tools like fdisk
or gparted
if they're able to parse the partitioning of /dev/loop0
fine. Only after all that proceed with the
# sfdisk /dev/sda < new_partition
followed by a reboot.
You should also change any references to sda4
to sda10
(and (hd0,msdos4)
to (hd0,msdos10)
) in /etc/fstab
and /etc/grub.d/*
(the latter followed by an update-grub
).
By all means, do not accuse me of anything if you're hosing your system ;-)
It may be better to wait for another answer, there are probably automated tools that could convert your partition table to GPT or such things, or more friendly partitioning programs that let you do it in a guided way.
new_partition:
/dev/sda1 : start= 2048, size= 1124352, type=7, bootable
/dev/sda2 : start= 1126400, size= 408475648, type=7
/dev/sda3 : start= 409602048, size= 1040963584, type=f
/dev/sda5 : start= 409602056, size= 409599984, type=7
/dev/sda6 : start= 819204096, size= 78123008, type=83
/dev/sda7 : start= 897329152, size= 9762816, type=82
/dev/sda8 : start= 907094016, size= 195309568, type=83
/dev/sda9 : start= 1102403592, size= 307199984, type=7
/dev/sda10 : start= 1409605632, size= 40960000, type=83
diff:
@@ -1,9 +1,9 @@
/dev/sda1 : start= 2048, size= 1124352, type=7, bootable
/dev/sda2 : start= 1126400, size= 408475648, type=7
-/dev/sda3 : start= 409602048, size= 1000001528, type=f
-/dev/sda4 : start= 1409605632, size= 40960000, type=83
+/dev/sda3 : start= 409602048, size= 1040963584, type=f
/dev/sda5 : start= 409602056, size= 409599984, type=7
/dev/sda6 : start= 819204096, size= 78123008, type=83
/dev/sda7 : start= 897329152, size= 9762816, type=82
/dev/sda8 : start= 907094016, size= 195309568, type=83
/dev/sda9 : start= 1102403592, size= 307199984, type=7
+/dev/sda10 : start= 1409605632, size= 40960000, type=83
Best Answer
Today, it doesn't really matter if you use primary or extended partitions.
There have been times where /boot had to be a primary partition but this isn't true any more. Also earlier incarnations of MS Windows required that you installed Windows to a primary partition.
When I set up a new disk, I make the first partition primary and put /boot there and put the rest as logical partitions into one big extended but this is just a personal preference.