LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-09-2011, 07:12 AM   #1
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Rep: Reputation: 15
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?

~Ol
 
Old 05-09-2011, 07:21 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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).
 
Old 05-09-2011, 07:21 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
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.
 
Old 05-09-2011, 07:28 AM   #4
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Original Poster
Rep: Reputation: 15
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.
 
Old 05-09-2011, 07:34 AM   #5
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
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.
 
Old 05-09-2011, 07:38 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
You're wrong...
Using grub I'm not aware it was ever required to be a primary. Maybe very early on ...
 
Old 05-09-2011, 07:46 AM   #7
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
Originally Posted by <Ol>Origy View Post
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.
 
1 members found this post helpful.
Old 05-09-2011, 08:02 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,927
Blog Entries: 45

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

'man fdisk';

Quote:
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.
 
1 members found this post helpful.
Old 05-09-2011, 09:32 AM   #9
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
It was right on the tip of my terminal onebuck, well said. I knew it had to be some kind of built-in thing that everyone followed.
 
Old 05-09-2011, 11:23 AM   #10
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by neonsignal View Post
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.

Have some rep++.
 
Old 05-09-2011, 12:04 PM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change primary partitions to logical partitions AND migrate their data? chickenlinux Linux - Hardware 10 04-04-2010 04:31 PM
Partitions, logical vs primary AphoxemaG General 15 02-16-2007 12:33 AM
to many partitions? (IDE: 4 primary, 3 logical) drkstr Linux - Software 13 06-14-2006 10:16 AM
primary or logical partitions? blotch Slackware 10 09-09-2004 04:36 AM
Partitioning - Primary and Logical partitions quietguy47 Linux - General 2 07-06-2003 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration