LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2007, 04:25 AM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 472

Rep: Reputation: 30
Question Number of primary partitions: Still at 4?


Several years back, you could have only 4 primary partitions. You could create several logical partitions in the last primary - thereby bypassing having to have only 4 partitions.
Does it still hold good? Is that still the case?

Last edited by concoran; 06-11-2007 at 04:30 AM.
 
Old 06-11-2007, 04:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
this is a M$ thing from DOS and will never chamge. blame them. or just use things like LVM with make these limitations largely irrelevant.
 
Old 07-28-2007, 04:56 AM   #3
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 472

Original Poster
Rep: Reputation: 30
so I can create /hda5 as a primary?
 
Old 07-28-2007, 06:18 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
were did i say that? i just said (well 6 weeks ago...) it would never change...
 
Old 07-28-2007, 06:45 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by concoran
so I can create /hda5 as a primary?
No.
The partition table in the MBR holds 4 entries, any one of which can be an extended partition. the extended partition entry is a pointer to another partition table (not in the MBR), which points to the first logical partition. Thus, by definition, the first logical partition will be /xxx5.

It is common to describe an extended partition as a "container" for all the logical partitions, but this is not physically what happens. The more correct term is "linked list"---The first extended partition (EP), points to the first logical partition (LP). If there is a 2nd LP, it is linked from another EP, which is part of the partition table in the 1st LP.

Attempted graphic follows:
PP=primary partition
EP=extended partition
LP=logical partition
Assumes disk is hda

MBR:
PP (hda1)
PP (hda2)
EP (hda3)----> 1stLP boot sector:
.................LP (hda5)
.................EP ----> 2ndLP boot sector:
............................LP (hda6)
............................EP----> 3rd (last) LP boot sector:
......................................LP (hda7)

In this example, you could still add one more primary (hda4)
 
Old 07-28-2007, 07:23 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
There is a good Wikipedia article on the MBR.
 
Old 07-28-2007, 07:28 AM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
You can actually have way more than just four if you use Ranish Partition Manager (30+ the last time I checked). Ranish is getting on in age, however, so I don't know how reliable it is nowadays.
 
Old 07-28-2007, 03:11 PM   #8
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Or 255 primary partitions on one drive with software. There are ways around any limitation. And most limitations are present because old hardware is still in use, which forces designers to design new hardware/features to be backwards compatible with the ancient stuff.
 
Old 07-28-2007, 03:38 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
We're getting deep into the guts now.....

My reading has led me to believe that "primary" meant an entry in the MBR partition table (which holds 4 entries). Is there another definition of "primary"?

Also, at what point does the SATA limitation on total partitions become relevant---eg is that overridden by any of the cited solutions?

Note that Linux does not care about the distinction between primary and logical partitions so--at least for Linux-only setups--the point may be moot.
 
Old 07-28-2007, 05:14 PM   #10
Lunate
LQ Newbie
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 16

Rep: Reputation: 0
There is a 15-partition limit for SATA and SCSI drives.
 
Old 07-28-2007, 05:29 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The 4 primaries, as pointed out by Pixellany are the 4x16 bytes entries in the partition table inside the 512 bytes of the first sector of the hard disk. Primary partitions are in name only as there is no advantage in the operation over the logical partitions, as far as Linux is concerned.

The Bios always reads just the first sector or the MBR for booting a hard disk so this is a hardware standard. That is why acid_kewpie said it will never change.

Like the Unix-systems Linux has a major number and minor numbers controlling the device names and there are 256 for a hard disk, currently achieved by 16 hard disks each with 15 partition plus a name reserved for the disk itself.

Getting more than 4 primaries is just a trick by a management-layer software. If a user want his partitions readable across various platform he/she better sticks with the PC standard.

As Pixellany has already stated Linux can boot from either a primary or a logical partition so primaries have no usefulness in Linux. Only Dos, MS Windows, Solaris and most of the BSD need to reside in a primary partition.

The number of partitions has actually been reduced by Linux by the release of 2.6.20 kernel making thhe 63 partitions in a Pata disk to become history. In Linux the first partitions are reserved for primaries and that doesn't change either.

Last edited by saikee; 07-28-2007 at 05:32 PM.
 
Old 07-30-2007, 01:57 AM   #12
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Quote:
Originally Posted by saikee
Primary partitions are in name only as there is no advantage in the operation over the logical partitions, as far as Linux is concerned.
Maybe the Linux kernel is OK with this, but I, as a user can point out two advantages of primary partitions over logical.

Because we are all human (I'm assuming), we are prone to making mistakes, like administering a bad dd command or inviting a virus to play with our bits and bytes, (you can have Windows in a logical partition if it's boot files are in a primary partition). It is not un-common for us to render our PBR (Partition boot record) useless by chance or by mistake. If this were to happen in a primary partition, we can still boot up any of the other boot-able partitions and carry on with our day. If this happens to a PBR of a logical partition, all boot-able logical partitions that follow cannot be booted till we stop the progress and remedy the situation.

The spindle speed of a hard drive is constant, (the RPMS stay at a constant rate). Modern hard drives use "Zone bit recording". What that means is there are well over 63 sectors per cylinder to the outer edge of a hard drive. If the read/write heads are at the inner most cylinder near the spindle, the heads will have access to 63 sectors in one revolution. When the read/write heads are at the outer most cylinder, depending on the make/model of the hard drive, the heads will have access to 140+ sectors in one revolution. What that means, is that the outer edge of a hard drive is the fastest area of a drive. And because hard drives are written from the outer edge inwards (contrary to CD/DVD disks), the fastest partition is the first partition.

Because I use bootitng (trickery), I can optimize my system and put my swap partition in the fastest area of the drive since I use swap often, (after my bootitng partition which is only 8MB). My third partition is my most used, every day, Linux operating system. Then there are three different flavors of Windows in the next three partitions, etc. etc. etc..

If you stick to the "old ways", chances are, Windows is occupying the fastest part of your drive, which is OK if Windows is your primary operating system.
 
Old 07-30-2007, 02:43 AM   #13
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Quote:
Originally Posted by saikee
so primaries have no usefulness in Linux.
Spoken from the tongue of a Windows user.
 
Old 07-30-2007, 03:20 AM   #14
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Quote:
Originally Posted by Lunate
There is a 15-partition limit for SATA and SCSI drives.
The first "Serial ATA" drives had an ATA interface, and were no different than an ATA drive as far as partitions are concerned. Eventually they went the way of the SCSI standard. All modern SATA drives are SCSI/SATA.
 
Old 07-30-2007, 05:28 AM   #15
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Junior Hacker ,

The 4 primaries are not an "old way" of doing things. There are the raw information every bios from every motherboard reads from the 447th to 510th bytes of every hard disk it is asked to boot.

If you are happy that a partition is being labelled as "primary" because a "management layer" package, that you have previously installed, tells you so that is fine but it is originated from the 4 primaries read by the Bios and nothing can change it.

I agree one can optimize the performance of a hard disk by concentrating the frequently-used information in the fastest access area in the disk. You do pay the price of having the frequently-used part worn out faster than the rest and so ending up with a shorter life for the hard disk.

A Primary partition does not enjoy the fastest access area of a hard disk. We have have nothing but logical partitions in a hard disk! This applies to any MS systems as well as Linux.

You only need a primary partition to boot a MS system because that is the way its boot loaders wrok, by searching like a blind man the 4 primaries and boot up any one that has the booting flag switched on. That is what I would called the "true old ways" of doing things because that was exactly what the Dos operating system started from.

In Linux the first command to be declared, by both boot loaders Lilo and Grub, is the "root partition" number and so a logical or primary partition makes no difference and the booting flag is never used.

Any MS Windows installed in a primary can be booted up by a Linux boot loader residing in a logical partition. Thus my statement primaries partitions have no usefulness in Linux.

Last edited by saikee; 07-30-2007 at 05:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
4 primary partitions? sycamorex Linux - Hardware 13 06-04-2007 02:52 AM
define Primary number or not... dicksonmakts Programming 9 04-05-2006 12:04 AM
Can you have more than 4 primary partitions? lyonsd Linux - General 3 06-06-2005 01:08 AM
DNS security / primary names server down after large number of requests rioguia Linux - Networking 1 10-07-2004 12:27 PM
four primary partitions? linuxtesting2 General 6 05-04-2004 11:17 AM


All times are GMT -5. The time now is 07:01 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration