Linux - NewbieThis 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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
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:
Assumes disk is hda
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.
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.
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.
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.
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.