LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   4 primary partitions limitation (https://www.linuxquestions.org/questions/linux-general-1/4-primary-partitions-limitation-805261/)

albertkao 04-30-2010 10:41 PM

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)


rkski 04-30-2010 11:07 PM

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.

brucehinrichs 04-30-2010 11:10 PM

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

syg00 04-30-2010 11:21 PM

Quote:

Originally Posted by albertkao (Post 3953536)
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.

brucehinrichs 04-30-2010 11:37 PM

I didn't see that, my bad. :redface:

syg00 is correct, ignore my babble. ;)

catkin 05-01-2010 04:32 AM

Quote:

Originally Posted by brucehinrichs (Post 3953554)
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.

albertkao 05-01-2010 05:52 AM

Quote:

Originally Posted by syg00 (Post 3953562)
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.

catkin 05-01-2010 05:54 AM

Can you post a screenshot of gparted showing the partition layout?

syg00 05-01-2010 05:59 AM

Try it from a liveCD.

johnsfine 05-01-2010 06:02 AM

Quote:

Originally Posted by albertkao (Post 3953719)
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.

albertkao 05-01-2010 03:10 PM

Quote:

Originally Posted by johnsfine (Post 3953728)
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?

johnsfine 05-01-2010 03:19 PM

Quote:

Originally Posted by albertkao (Post 3954065)
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.

albertkao 05-01-2010 07:30 PM

Should I install boot loader from Fedora 12?
My computer had a boot loader from kubuntu 9.10.

saikee 05-01-2010 08:00 PM

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.

albertkao 05-01-2010 08:44 PM

Quote:

Originally Posted by saikee (Post 3954243)
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


All times are GMT -5. The time now is 06:35 PM.