Why are logical partitions preferred over primary?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why are logical partitions preferred over primary?
So I noticed while using guided partitioning that most distro installers will attempt to create a logical partition for the root file system besides the swap and /boot on the HDD. Why is this the case? Why does the partition for root file system have to be logical and not primary?
It is to make it easy to create multi-boot systems.
The partition system that is now widely used only allows four primary partitions, so it is not a good idea to waste these (especially since some other operating systems will only boot from a primary partition).
Doesn't have to be. Merely makes sense when there is an absolute limit of 4 primaries on what is generally called a MBR disk layout. Extended/logicals was created to alleviate this restriction.
I am aware of the limitations. But considering that most of the time I was doing a fresh install after a complete format, there were no other operating systems present on the HDD at the time of installation. I am guessing the logical partitions are made to address the possibility of installing another OS in the future.
The reason I don't so much like extended partitions is because they mess up my partition table index. Instead of /dev/sda1, /dev/sda2, /dev/sda3 I get /dev/sda1, /dev/sda4, /dev/sda5 or something like that. Kind of confusing.
Hard drives are limited to 4 primary partitions. Originally, logical partitions were meant as a way to overcome this limit, acting as a 'container' for extra partitions. Now, with storage devices reaching capacities of 2+TB, partitions in general are pretty much used like filing cabinets. These days /swap partitions are also created within a logical partition. Last I checked, the /boot partition had to be a normal partition, because logical partitions can't be mad bootable. Correct me if I'm wrong
Last edited by PhoenixAndThor; 05-09-2011 at 07:35 AM.
The reason I don't so much like extended partitions is because they mess up my partition table index.
This is just because the primary partitions are allocated IDs before the logical ones. So it makes sense to start the logical ones at '5', otherwise when you added a new primary partition, all the logical partition IDs would change (which would mess up configurations). Now that we are moving to UUIDs, you will be able to use them instead
Last edited by neonsignal; 05-09-2011 at 07:47 AM.
A DOS type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 par-
titions (called `primary'). One of these may be an extended partition; this is a box holding logical partitions, with descriptors
found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or
not, get numbers 1-4. Logical partitions start numbering from 5.
You can't get a simpler description than the above from 'man fdisk' for DOS type use.
This is just because the primary partitions are allocated IDs before the logical ones. So it makes sense to start the logical ones at '5', otherwise when you added a new primary partition, all the logical partition IDs would change (which would mess up configurations). Now that we are moving to UUIDs, you will be able to use them instead
Oh, that makes total sense now... 4 primary are from 1 to 4 and the 5th logical starts at 5. I had completely no idea it worked like that! I always thought the extended partition creates some invisible containers that store other partitions, but for some reason they didn't show up as /dev/sda3 and /dev/sda4. Thanks for clarifying.
Since M$ is now shipping?/supporting? GUID partitioned disks, and most Linux partitioning tools (and GRUB2, I believe) are happy with such partitioning, I suspect that you'll soon see installer developers changing the defaults. The GUID scheme still has four "primary" partitions - for "backward compatibility with older boot programs" - but doesn't need to use one of them for an "extended partition" holder.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.