LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-28-2006, 11:41 PM   #1
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware 14.1 64-bit with multilib
Posts: 2,074

Rep: Reputation: 199Reputation: 199
Primary vs. Logical


On my notebook I have a ~ 115GB HD, I resized the NTFS partition to get ready for Slackware 11.0. NTFS is now 54.7GB, made a 26.5GB FAT32 partition for sharing files between Linux and XP, made a 100MB ext2 partiton for boot, 22GB ext3 for home, though I will probably change that to reiser or jfs, but thats far as I can get, I get limited to only 4 primary partitons... Why the limit to only 4? I originally wanted this kind of setup....

NTFS Primary 54.7GB
FAT32 Primary 26.5GB
ext2 boot Primary 100MB
home Primary 22GB
/ ReiserPrimary 8.97GB

I thought I heard that you could have a much higher number of primary partition, but apparantly not. So should I make / as a logical partition then?
 
Old 09-29-2006, 12:50 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,210

Rep: Reputation: 292Reputation: 292Reputation: 292
You can only have 4 primary partitions I think. You can make 1 primary NTFS for windows, then make an extended partition of the remaining space and create as many logical drives in that as you like. So it will look like:
Code:
[Primary][-------------Extended-------------]
[-------][logical1][logical2][logical3][etc-]
Anyway I think that's how it works. Someone correct me if I'm wrong.

Last edited by dive; 09-29-2006 at 12:51 AM.
 
Old 09-29-2006, 01:10 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
You can have 4 primary maximum. If you want more than 4
partitions, you can make 1 (as dive said) or up to 3 as
primary, then the rest must be logical partitions in the
extended partition.

Windows is going to want to have it's boot partition in
the primaries -- Linux doesn't care -- it's just happy
to be selected and will run anywhere.
 
Old 09-29-2006, 01:14 AM   #4
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Dive's already correct. This is only for a bit of more info.

Code:
[HEADER][Primary][------------------Extended-------------------]
[HEADER][-------][ExtHEADER][logical1][logical2][logical3][etc-]
The ExtHEADER's consider as primary in HEADER and the logicals means nothing to the HEADER. The extended header's only as little as 1 sector i guess. And the number of logicals can be up to at least 15 depending on the partitioner. Please correct me too if I'm wrong.
 
Old 09-29-2006, 01:27 AM   #5
Galaxy_Stranger
Member
 
Registered: Oct 2003
Distribution: CentOS 6 and Fedora
Posts: 230

Rep: Reputation: 36
You can only have 4 primary partitions. If you need MORE partitions, you can have up to 3 primary and the last extended containing logical partitions.

So, you could have 1-3 be primary and 4 be extended while containing more logical partitions.

-=[EDIT]=-
Duh - you beat me to it.

Last edited by Galaxy_Stranger; 09-29-2006 at 01:28 AM.
 
Old 09-29-2006, 02:59 AM   #6
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 245

Rep: Reputation: 30
I know this has already been covered but I just thought I'd share the way I've partitioned my HD so you can perhaps put it into perspective....
Code:
[----------------------------HD-------------------------------]
[Primary][Primary][Primary][--------------Extended------------]
[--hda1-][--hda2-][--hda3-][--hda5-][--hda6-][--hda7-][--hda8-]
Where

hda1 - NTFS 10GB /mnt/windows for Windows XP
hda2 - ext2 60MB /boot
hda3 - ext3 15GB / for Main Linux distr
hda5 - swap 1GB
hda6 - ext3 25GB /home
hda7 - fat32 5GB /mnt/shared for sharing between Linux and XP, shows up as D:\ in XP
hda8 - ext3 4GB /mnt/extra for testing distros, or re-mastering knoppix etc, anything else basically.

So as you can see you can pretty much partition your HD anyway you want as far as Linux is concerned.

Last edited by mickyg; 09-29-2006 at 03:00 AM.
 
Old 09-29-2006, 03:07 AM   #7
Galaxy_Stranger
Member
 
Registered: Oct 2003
Distribution: CentOS 6 and Fedora
Posts: 230

Rep: Reputation: 36
That's an excellent illustration.
 
Old 09-29-2006, 03:32 AM   #8
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
yes and as you can see there's no hda4. it's simply the extended partition header. btw it's not just 1 sector perhaps it's 1 head.
 
Old 09-29-2006, 07:07 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,856

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Just to be more confusing....
When hard drives became available for the PC one could only create 4 total partitions. As hard drives started increasing in capacity this became a big limitation. The extended partition was developed to overcome this limitation but still retain backwards compatabilty. The original 4 partitions are now known as primary.

An IDE drive can be subdivided into 64 partitions, 4 primary (1 designated as extended) and 60 logical partitions. A SCSI can be subdivided into 16 partitions (AFAIK this is a linux limitation). BTW Windows has a limitation of 26 total partitions i.e. A-Z. Any primary partition can be designated as an extended partition.

konsolebox, I believe you are refering to the boot sector as a header. Each primary partition has a boot sector. The extended partition has an extended master boot record which is just a pointer to the first logical. Probably too much information for the OP to comprehend at this time.
 
Old 09-29-2006, 07:09 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,135
Blog Entries: 3

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
Hi,

Quote:
Originally Posted by konsolebox
yes and as you can see there's no hda4. it's simply the extended partition header. btw it's not just 1 sector perhaps it's 1 head.
I don't want to be agruementative here just to clarify this.
If you do a fdisk -l on your system you will find something like this;
Code:
Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         499     4008186    c  W95 FAT32 (LBA)
/dev/hda2             500         561      498015   82  Linux swap
/dev/hda3             562         811     2008125   83  Linux
/dev/hda4             812        4864    32555722+   5  Extended
/dev/hda5             812        1061     2008093+  83  Linux
/dev/hda6            1062        1438     3028221   83  Linux
/dev/hda7            1439        1563     1004031   83  Linux
/dev/hda8            1564        2062     4008186   83  Linux
The partition /dev/hda4 exists but is an extended partion containing the logical partitions. As for the proper terms of disk layout I suggest that you read this tutorial. A good example of the ext2 filesystem layout.

Quote:
Originally Posted by Galaxy_Stranger
You can only have 4 primary partitions. If you need MORE partitions, you can have up to 3 primary and the last extended containing logical partitions.

So, you could have 1-3 be primary and 4 be extended while containing more logical partitions.

-=[EDIT]=-
Duh - you beat me to it.
You can create the extended partition anywhere on the device that has primary partition numbers available. If you have a /dev/hda that has /dev/hda3 available and you wish to create an extended on that partition then do it. Of course the first logical will be /dev/hda5.

My personal taste is too create my swap if needed as device /dev/hda2 as seen in the below fstab example. Reasoning is the device access times for primary vs extended. You could create the swap on an extended but there would be propagation.

A fstab example;
Code:
/dev/hda2        swap             swap        defaults         0   0
/dev/hda3        /                ext3        defaults         1   1
/dev/hda5        /home            ext3        defaults         1   2
/dev/hda8        /usr             ext3        defaults         1   2
#
#12-31-05 12:00 gws old /usr
#/dev/hda6        /usr             ext3        defaults         1   2

/dev/hda6        /archive         ext3        defaults         1   2
/dev/hda7        /tmp             ext3        defaults         1   2
/dev/hda1        /mnt/win98       vfat        defaults         1   0
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0

#09-12-06 23:00 gws
#mount bookmarks
192.168.0.1:/mnt/bookmarks /mnt/bookmarks nfs rw,suid,nolock,soft,intr   0 0

#192.168.0.1:/mnt/bookmarks /mnt/bookmarks nfs defaults   0 0
#192.168.0.1:/mnt/bookmarks /mnt/bookmarks nfs rw,intr     0 0
#192.168.0.1:/mnt/bookmarks /mnt/bookmarks nfs
#192.168.0.1:/mnt/bookmarks /mnt/bookmarks nfs rw,suid,nolock,soft,intr   0 0
As others have stated, partition scheme are varied and personal. But the terminology is not.

edit: correct spelling missed by LQ spell check.

Last edited by onebuck; 09-29-2006 at 09:00 AM.
 
Old 09-29-2006, 07:56 AM   #11
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by gwsandvik
The partitition /dev/hda4 exists but is an exetended partion containg the logical partitions. As for the proper terms of disk layout I suggest that you read this tutorial. A good example of the ext2 filesystem layout.
No need thanks. I believe you're correct. That's what I believed about extended partitions before and I don't know how it changed. Perhaps it was the time when I created perfect-sized partitions (i mean *,000,000,000 in size) and I found out that creating a partition next to the header makes this impossible as this require at least that the partition starts on a cylinder and the header's only 1 head and not 1 cylinder. I don't know how but suddenly I've been thinking that the extheader is a primary partition.

About the illustration I posted above I think there's still nothing to change.

Thanks for the correction.
 
Old 09-29-2006, 02:13 PM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
A bit of advice for keeping windows happy on the same HD as Linux:
Make the first and last logical partitions either NTFS or FAT. Otherwise Windows may have trouble reading the partition table. This is covered in several MS Knowledge Base advisories.
The easiest way to accomplish this is to create all your partitons as windows-type, then afterwards change the ones you want to be Linux using Linux fdisk, but without destroying them or changing the size.

About that tutorial -I never in my life saw so much disinformation in so little space. It may help you to understand in a round-about way, but that guy needs to read up before writing anymore...

Last edited by gnashley; 09-29-2006 at 02:17 PM.
 
  


Reply

Tags
dual boot, partitioning


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
logical partition to a primary one britcoms9 Linux - Newbie 4 01-20-2008 06:46 PM
advantage of primary over logical abunsair Linux - Hardware 4 07-04-2005 05:37 PM
Primary or Logical? Brahl Linux - Newbie 1 01-29-2005 09:50 AM
Primary vs Logical djgerbavore Linux - Hardware 2 08-16-2004 06:02 PM
logical or primary partition Socrates Linux - Software 1 02-25-2001 03:50 AM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration