LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-30-2010, 10:41 PM   #1
albertkao
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Rep: Reputation: 0
4 primary partitions limitation


My hard disk has windows 7 and kubuntu 9.10 installed.
The disk still has 1 unallocated partition.
How do I install another linux (fedora 12)?
I cannot install to the unallocated partition because hard disk can only have 4 primary partitions. The extended also counts as primary, so it can only have 3 primary partitions.
If I cannot install on this hard disk, may I install another linux (fedora 12) on an 200GB external USB disk to make the computer triple boot?

The partition layout is as follows:
Code:
$ sudo fdisk -l

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7fbbb3a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1785    14336000   27  Unknown
/dev/sda2   *        1785        1798      102400    7  HPFS/NTFS
/dev/sda3            1798       40634   311950680    7  HPFS/NTFS
/dev/sda4           40635       53510   103426470    5  Extended
/dev/sda5           40635       41132     4000153+  82  Linux swap / Solaris
/dev/sda6           41133       51078    79891213+  83  Linux
/dev/sda7           51079       53510    19535008+  83  Linux

$ mount
/dev/sda6 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sda7 on /home type ext3 (rw)
/dev/sda2 on /media/SYSTEM RESERVED type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
 
Old 04-30-2010, 11:07 PM   #2
rkski
Member
 
Registered: Jan 2009
Location: Canada
Distribution: CentOS 6.3, Fedora 17
Posts: 247

Rep: Reputation: 51
Quick answer: If you have free HDD space, you can create additional LOGICAL partitions (your current linux is installed on logical partitions). Can use gparted for this or create during installation. You can re-use the swap partition you already have for the new distro. Then let GRUB know about the new distro.

You can also install on the external drive but it'll run slower due to the usb interface.
 
Old 04-30-2010, 11:10 PM   #3
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 69
I believe the limit is 15 total partitions (4 primary, 1 of which contains the extended partitions; and 11 extended), so you could BACKUP /dev/sda6 and/or /dev/sda7, shrink either or both, move them so all your (resulting) unallocated space is at the end, and repartition that unallocated space for a new installation. Or you could add a second hard drive and use that. That's the beauty of linux, it's your choice! Either method leaves your first three existing primary partitions untouched. As an aside, you only need one swap for multiple linux installs (they can share it), but you will almost definitely want a separate /home for each one. I have heard of sharing /home partitions, but from the reading I have done it seems more trouble than it's worth, IMHO. Here's my laptop scheme:

Code:
Frank2:~# fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007c950

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         243     1951866   82  Linux swap / Solaris
/dev/sda2   *         244         304      489982+  83  Linux
/dev/sda3             305        3951    29294527+  83  Linux
/dev/sda4            3952       24321   163622025    5  Extended
/dev/sda5            3952       11246    58597056   83  Linux
/dev/sda6           11247       14893    29294496   83  Linux
/dev/sda7           14894       18540    29294496   83  Linux
/dev/sda8           18541       20485    15623181   83  Linux
/dev/sda9           20486       22430    15623181   83  Linux
/dev/sda10          22431       24321    15189426   83  Linux
sda1: swap 2Gb
sda2: /boot 500Mb
sda3: /data ~30Gb #shared (fstab entry in each distro to mount at /data)
sda5: / Debian Lenny ~55Gb #my primary OS, gnome DE
sda6 / Arch ~30Gb #still under construction , xfce DE
sda7: / Slackware64 13.0 ~30Gb #KDE
sda8, sda9, sda10: ~15Gb each formatted as ext3 #used for test runs

Last edited by brucehinrichs; 04-30-2010 at 11:12 PM.
 
Old 04-30-2010, 11:21 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by albertkao View Post
The disk still has 1 unallocated partition.
Explain this statement - which unallocated partition ?.

You do not need another primary partition for the install - Fedora will install into a logical; maybe you'll need the "expert" partitioning option during the install.
You have unallocated space at the end of the disk - use gparted to enlarge the extended partition to occupy all of that, then create a logical partition as part of the install.
No need to mess with your current setup at all.
 
Old 04-30-2010, 11:37 PM   #5
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 69
I didn't see that, my bad.

syg00 is correct, ignore my babble.
 
Old 05-01-2010, 04:32 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by brucehinrichs View Post
I believe the limit is 15 total partitions (4 primary, 1 of which contains the extended partitions; and 11 extended)
Presumably "11 extended" is a typo for "11 logical". According to this undated TLDP page the number of logical partitions is limited under Linux to 15 on a SCSI disk and 64 on an IDE disk but according to this April 09 thread the limit is 255.
 
Old 05-01-2010, 05:52 AM   #7
albertkao
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Explain this statement - which unallocated partition ?.

You do not need another primary partition for the install - Fedora will install into a logical; maybe you'll need the "expert" partitioning option during the install.
You have unallocated space at the end of the disk - use gparted to enlarge the extended partition to occupy all of that, then create a logical partition as part of the install.
No need to mess with your current setup at all.
Running GParted in kubuntu indicates that the disk has a 186GB unallocated "partition" after /dev/sda7. However, selecting that unallocated space and clicking the "New" button results in a "4 primary partitions limit" error.
Selecting the /dev/sda4 extended partition and clicking the "Partition" menu result in a popup menu which has the "New" menu being active, the other menus such as "Resize/Move" are unactive, so I cannot use GParted to enlarge the extended partition.
Please help.
Thanks.

Last edited by albertkao; 05-01-2010 at 05:57 AM.
 
Old 05-01-2010, 05:54 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Can you post a screenshot of gparted showing the partition layout?
 
Old 05-01-2010, 05:59 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Try it from a liveCD.
 
Old 05-01-2010, 06:02 AM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by albertkao View Post
Running GParted in kubuntu
I assume you mean running it in the installed copy of kubuntu. That is the problem. You need to boot a Linux liveCD and run GParted from the liveCD.

I assume you have one or two of those liveCDs, the one you earlier installed kubuntu from and the one you want to install another Linux from.

Quote:
indicates that the disk has a 186GB unallocated "partition" after /dev/sda7. However, selecting that unallocated space and clicking the "New" button results in a "4 primary partitions limit" error.
Right. You can't create the new partition that way.

Quote:
the other menus such as "Resize/Move" are unactive, so I cannot use GParted to enlarge the extended partition.
I assume from the fact that you want to enlarge it that the unpartitioned space is outside the extended partition. I think the reason it won't let you enlarge the extended partition is that Linux has mounted a logical partition inside that extended partition.

BTW, depending on the specific liveCD you boot from, that might also mount swap space or file partitions in your extended partition, so you may need to unmount those after booting the liveCD before GParted can change the extended partition.

Last edited by johnsfine; 05-01-2010 at 06:07 AM.
 
Old 05-01-2010, 03:10 PM   #11
albertkao
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnsfine View Post
I assume you mean running it in the installed copy of kubuntu. That is the problem. You need to boot a Linux liveCD and run GParted from the liveCD.

I assume you have one or two of those liveCDs, the one you earlier installed kubuntu from and the one you want to install another Linux from.



Right. You can't create the new partition that way.



I assume from the fact that you want to enlarge it that the unpartitioned space is outside the extended partition. I think the reason it won't let you enlarge the extended partition is that Linux has mounted a logical partition inside that extended partition.

BTW, depending on the specific liveCD you boot from, that might also mount swap space or file partitions in your extended partition, so you may need to unmount those after booting the liveCD before GParted can change the extended partition.
Following your advice, I use gparted from sysrescuecd to maximize the size of the extended (sda4) primary partition which have room to add logical drives for other distributions.
The fedora 12 installation program keep the existing partitions and suggest these new partitions:
Code:
/dev/sda8           /boot       ext4                      199MB    
/dev/sda9                       physical volume (LVM)   67000MB
I think they are ok, aren't they?
 
Old 05-01-2010, 03:19 PM   #12
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by albertkao View Post
The fedora 12 installation program keep the existing partitions and suggest these new partitions:

I think they are ok, aren't they?
I think LVM is needlessly complex for ordinary users and I think a separate /boot partition is unnecessary. Assuming the Fedora installer allows it, I think a single logical partition for / should be simplest.

But hopefully the fedora 12 installer in suggesting a more complicated partitioning would also follow through and help you use it. So doing it their way should be OK.
 
Old 05-01-2010, 07:30 PM   #13
albertkao
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Should I install boot loader from Fedora 12?
My computer had a boot loader from kubuntu 9.10.
 
Old 05-01-2010, 08:00 PM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I always give one partition to each Linux, including every member of the Red Hat family that try to sell me the LVM. Just partition the disk first, select a partition and tell the installer to get on with it. A user only needs a separate /boot if he/she has been persuaded by the Red Hat installer to have a LVM because boot loaders can't read a LVM. People running servers have their own reasons to put a Linux over several partitions.

The maximum number of partitions Linux can create is 130, using sfdisk. 4 primaries or 3 primaries with an extended partition. AFAIK there is no limit on the number of logical partitions in an extended partition. This thread show a Xp bootable in any one of them. Linux's partitioning tools are not all coherent but most, like fdisk and cfdisk, will list up to only 63 partitions. Gparted is the only program willing to offer beyond the 130 partitions limit but a few lines of script with sfdisk can generate 130 partitions in seconds.

Linux's Grub and Win7's bootmgr can multi-boot possibly any number of OSes as I have them done over 150 systems each. Any Grub, either Grub1 or Grub2, from any Linux in any partition can be used take over the MBR to multiboot all systems in the box.

The space after the 4 primaries (or 3 primaries + an extended) is dead unless it follows an extended partition like the OP. The cfdisk program can be run to increase the number of logical partitions.

The OP partition table is
Code:
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7fbbb3a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1785    14336000   27  Unknown
/dev/sda2   *        1785        1798      102400    7  HPFS/NTFS
/dev/sda3            1798       40634   311950680    7  HPFS/NTFS
/dev/sda4           40635       53510   103426470    5  Extended
/dev/sda5           40635       41132     4000153+  82  Linux swap / Solaris
/dev/sda6           41133       51078    79891213+  83  Linux
/dev/sda7           51079       53510    19535008+  83  Linux
The blue bits tell us the extended partition terminates at 53510 cylinders but the red bit tells us there are 77825 cylinders in total. Therefore extended partition can be pushed downward and the correct tool to do this is cfdisk using command
Code:
cfdisk /dev/sda
. The 3 primaries sda1, sda2 & sda3 are all before the extended partition sda4 and will not interfere with the additional logical partitions creation. A set of logical partitions must be created as a continuously and consecutively in a hard disk because the (i)th logical partition carries the address of (i+1)th logical partition.

Last edited by saikee; 05-02-2010 at 04:36 AM.
 
Old 05-01-2010, 08:44 PM   #15
albertkao
LQ Newbie
 
Registered: Jan 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee View Post
I always give one partition to each Linux, including every member of the Red Hat family that try to sell me the LVM. Just partition the disk first, select a partition and tell the installer to get on with it. A user only needs a separate /boot if he/she has been persuaded by the Red Hat installer to have a LVM because boot loaders can't read a LVM. People running servers have their own reasons to put a Linux over several partitions.

The maximum number of partitions Linux can create is 130, using sfdisk. 4 primaries or 3 primaries with an extended partition. AFAIK there is no limit on the number of logical partitions in an extended partition. This thread show a Xp bootable in any one of them. Linux's partitioning tools are not all coherent but most, like fdisk and cfdisk, will list up to only 63 partitions. Gparted is the only program willing to offer beyond the 130 partitions limit but a few lines of script with sfdisk can generate 130 partitions in seconds.

Linux's Grub and Win7's bootmgr can multi-boot possibly any number of OSes as I have them done over 150 systems each. Any Grub, either Grub1 or Grub2, from any Linux in any partition can be used take over the MBR to multiboot all systems in the box.

The space after the 4 primaries (or 3 primaries + an extended) is dead unless it follows an extended partition like the OP. The cfdisk program can be run to increase the number of logical partitions.

The OP partition table is
Code:
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa7fbbb3a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1785    14336000   27  Unknown
/dev/sda2   *        1785        1798      102400    7  HPFS/NTFS
/dev/sda3            1798       40634   311950680    7  HPFS/NTFS
/dev/sda4           40635       53510   103426470    5  Extended
/dev/sda5           40635       41132     4000153+  82  Linux swap / Solaris
/dev/sda6           41133       51078    79891213+  83  Linux
/dev/sda7           51079       53510    19535008+  83  Linux
The blue bits tell us the extended partition terminates at 53510 cylinders but the red bit tells us there are 77825 cylinders in total. Therefore extended partition can be pushed downward and the correct tool to do this is cfdisk using command
Code:
cfdisk /dev/sda
. The 3 primaries sda1, sda2 & sda3 are all before the extended partition sda4 and will not interfere with the additional logical partitions creation. A set of logical partitions must be created as a continuously and consecutively in a hard disk because the (i)th logical partition carries the address of (i=1)th logical partition.
Please confirm that your suggestions are:
- a single logical partition for / should be simplest. i.e. no need for LVM and /boot partition
- no need for Fedora boot loader, the existing linux boot loader is ok

Last edited by albertkao; 05-01-2010 at 08:48 PM.
 
  


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 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
Primary partitions Gins General 23 03-20-2008 04:16 AM
4 primary partitions? sycamorex Linux - Hardware 13 06-04-2007 01:52 AM
Can you have more than 4 primary partitions? lyonsd Linux - General 3 06-06-2005 12:08 AM
four primary partitions? linuxtesting2 General 6 05-04-2004 10:17 AM

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

All times are GMT -5. The time now is 05:42 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
Open Source Consulting | Domain Registration