LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 01-08-2007, 09:06 AM   #1
chess380
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
Misunderstanding Logical Drives


What are the steps to creating a logical drive?

I think you create a extended partition, write it, and then format. I think I am right, but could some one tell me a little more or correct me if I am wrong?
 
Old 01-08-2007, 11:24 AM   #2
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
If you use the cfdisk program the first logical partition you create will be at the 5th position. The extended partition will be generated as a by-product. As long as you do not create a primary partition after the this logical partition you can go up to 63th logical or another 58 logical partitions.

In a PC the hda1 to hda4 are reserved names for the 4 primaries. If you want logical partitions then one of the primary must be given up to turn into an extended partition inside which you can have 59 logical partition maximum.

The whole disk itself say hda, 3 primaries, one extended and 59 logicals make up the 64 devices of a hard disk.

Last edited by saikee; 01-08-2007 at 11:26 AM.
 
Old 01-08-2007, 01:05 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
A common misconception is that a logical is somehow created inside of a special place called "extended". What actually happens is that the extended partition is just a pointer to the first logical. Then, in the boot sector of the first logical, is ANOTHER extended--to point to the next logical. All these extra extended partitions are never seen by the partition manager.

There is actually an even more precise way of saying this if you are interested.
 
Old 01-08-2007, 04:22 PM   #4
kinematic
LQ Newbie
 
Registered: Dec 2005
Location: behind you
Distribution: Debian testing
Posts: 18

Rep: Reputation: 0
if a partition manager doesn't see extended partitions how do you explain this
http://img351.imageshack.us/img351/4...mafdrukiv7.png
 
Old 01-08-2007, 04:52 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,613

Rep: Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718Reputation: 1718
In a nutshell an extended partition is a container for logical drives. It can not be formated or mounted. Once the extended partition has been created you can then add logical drives.
 
Old 01-08-2007, 05:16 PM   #6
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
Actually an extended partition occupies the same 16 bytes of any primary partition because it comes from one of them except its partition ID tells the Bios that it is an extended partition.

The boundary limit of an extended partition is the starting point of the first logical partition and the finishing point of the last logical partition. To locate the hard address of a logical partion some where in between the two extrems the operating system has to scann the logical partitions sequentially.

One can image the hard disk is a deck of card from A to Z. One can have 3 primary partition of hda1 from A to C, hda2 from D to F and hda3 from G to I. From J to Z is an extended partition hda4 inside which the user can have hda5 from J to L, hda6 from M to P, hda7 form R to T and hda8 from U to Z.

Therefore it makes no sense to format the extended partition (hda4 in the above example) as it can destroy all the logical partitions inside. A decent operating system would not entertain such a move.

Last edited by saikee; 01-08-2007 at 05:17 PM.
 
Old 01-08-2007, 05:56 PM   #7
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 kinematic
if a partition manager doesn't see extended partitions how do you explain this
http://img351.imageshack.us/img351/4...mafdrukiv7.png
The partition manager does see the first extended partition--it does not see all the others. (What I called the "extras" in my other post.)
Take any situation where there are at least 2 logical partitions. Look in the 1st sector of the 1st logical partition and you will see another extended partition pointing to the 2nd logical.
 
Old 01-08-2007, 06:01 PM   #8
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 michaelk
In a nutshell an extended partition is a container for logical drives. It can not be formated or mounted. Once the extended partition has been created you can then add logical drives.
It behaves as if it were a container but--as I pointed out earlier--it is not a container, but rather a pointer. The size of the extended partition basically just tells a partition manager that the owner of the system has decided to use some portion of the disk for logicals. That portion can be increased at will by simply modifying the extended partition parameters.

If there is anything here relevant to the original question it is perhaps that extended partitions do not occupy disk space, and are normally formatted, written to, etc.
 
Old 01-08-2007, 06:33 PM   #9
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
Ref 1
Ref 2

Some articles with in-depth information on the subject.

Last edited by saikee; 01-08-2007 at 06:38 PM.
 
Old 01-09-2007, 08:53 AM   #10
chess380
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Original Poster
Rep: Reputation: 0
thanks

thanks I figured it out with everyone's reply.
 
Old 01-09-2007, 09:04 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,405

Rep: Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011Reputation: 2011
Glad to see chess380 is happy ...

However, this has opened a (small) can of worms.
Everyone (including me) seems to agree with the "standard line" re the extended partition being a container for the logical(s).
Except pixellany ...

The nominal structure of the linked list for the logicals is pretty well known, but pixellany's insistence that it is basically unrelated to the (extended) entry in the partition table in sector zero needed some investigation.
So I did some.

Short answer appears to be that the linked list for the logicals does indeed indicate each "next" is an extended.
However ....
Each new logical can only be allocated within the extent defined in the sector zero partition table extended entry. That is, within the bounds of the container - which may get adjusted as new logical(s) are created.

I started to add the evidence I collected here, but it might be better where it can get wider exposure.
What do you all think ???.
Wiki, elsewhere, waste of time .... ???

@michaelk - any thoughts from the mods ???.

Last edited by syg00; 01-09-2007 at 09:05 PM.
 
Old 01-10-2007, 04:06 AM   #12
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
I thought I have explained it in Post #6 that the extended partition must come from one of the 4 primaries in it all information is the same except the partition type. Therefore when a Bios or any operating system reads it the following information are not available without a second or multiple passes of scanning of the actual hard disk

(1) No information on how many logical partition inside
(2) No information of sizes of any of the logical partitions.

But the extended partition does has the starting and finishing positions of the hard disk (as with every primary partition) and so the system can go to the first logical partition to read its reduced partition table. Since each logical partition carried the hard disk address of the next one then the operating system eventually can build up the accessing addresses of all the logical partitions.

Thus Pixellany's assertion isn't wrong and everybody's view is his/her own interpretation.

It is quite interesting to note that the MS systems has a common MBR to boot from one of the 4 primaries if it has the booting flag marked active because it is a one pass read of the MBR by the Bios. Traditionally a MS system must reside inside a primary partition for this reason.

Linux on the other hand can be booted anywhere in the hard disk from a logical partition because the root partition is declared up front and so the hard disk location can be worked out by the boot loader (like the manner described above) or hard-coded with the assistance of the kernel.
 
  


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
Help Again! Not seeing logical drives on WinXP dual boot mailforbiz Linux - Software 9 05-11-2006 10:33 PM
Logical drives, and Primary Partitions Infernolinux Linux - Hardware 19 01-09-2006 07:44 PM
How to add Logical Drives kool_kid Slackware 10 03-18-2005 07:08 AM
to view the windows logical drives from linux. ks_krishna76 Linux - Software 6 10-14-2004 02:30 AM
Need help to recover extended partitions/logical drives dwmass Linux - Hardware 1 11-06-2002 07:27 PM


All times are GMT -5. The time now is 09:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration