LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't create additional partition using diskdruid.... (https://www.linuxquestions.org/questions/linux-newbie-8/can%27t-create-additional-partition-using-diskdruid-585055/)

chickenjoy 09-16-2007 07:24 AM

Can't create additional partition using diskdruid....
 
I'm going to dual boot windows and linux but the CentOS partioner (disk druid I presume) is not allowing me to make a 3rd partition (3: /boot, swap and /) so I possible can't continue on.

this is the structure of my HD:

-/dev/sda
---/dev/sda1.........ntfs
---/dev/sda2.........Extended
------/dev/sda5......ntfs
------/dev/sda6......ntfs
------/dev/sda7......fat32
---/dev/sda3........./boot.......ext3
---/dev/sda4.........SWAP........ext3
---FREE..............Free space.......... 8103


I get the error when creating the / partition from the FREE space:

Quote:

Could not allocate requested partitions: Partitioning failed: Not enough space left to create partition for /.
I believe its got to do with the sda numbering since sda5 which is next from sda4 (SWAP) is already taken by one of my NTFS partitions and so the program is not smart enough to give it sda8 instead.

Is there a solution to this? or am I do I have to resort to using LVM?

Thanks in Advance for any inputs.

bigrigdriver 09-16-2007 08:54 AM

1) delete /dev/sda3 and /dev/sda4

2) reconfigure the Extended partition to include all the free space on the drive.

3) make the /boot, /swap, and / (root) partitions inside the extended partition (they will cohabit with the ntfs and fat partitions without any problems). The new partitions numbers will then be: /dev/hda8 (/boot), /dev/hda9 (/swap) and /dev/hda10 (/).

The reason for all this is that the MBR can only hold info on 4 partitions (hda1, hda2, hda3 and hda4). The partitions inside the Extended are handled seperately. If you try to add a fifth partition (/), there is no room (in the partition table). By using a large Extended partition, and putting your other partitions inside it, you get around the limit of 4 partitions.

saikee 09-16-2007 09:01 AM

bigrigdriver has beat me to it. Same information is provided but described by two different persons.

-----------------------------------------------------

This is a bad disk management on your part.

In Linux the first 4 partitions of sda1 to sda4 are permanently reserved primaries regardless if any or all of them are used or not.

When the first logical partition is created it does so by turning the first available primary into an extended partition. In your case your first logical partition is sda5 and so sda2 immediately used up as the extended partition.

In PC standard only one extended partition is allowed. Also all logical partitions must be consecutive and in a continuous chain because one logical partition carries the hard disk address of the next logical partition.

You would have been no problem at all if /boot was created as a logical partition sda8 and swap sda9. In such a case all your space is available for sda10 to sda15 if you so desire.

No you didn't do that. You make /boot and swap using the last two remaining primaries and these effectively force an abrupt end to your extended partition. The space after hda4 is "dead" because it cannot form a continuous chain with sda7.

-------------------------------------

Now how to dig yourself out of this hole.

Use any Live CD. Boot it up. Use its cfdisk program (Sytnax "cfdisk /dev/sda") in terminal to copy the content of /boot temporarily to say a USB pen drive. Delete sda3 of /boot and sda4 of swap.

Reboot the system and use cfdisk again. This time you will find sda8 to sda15 are available if you create them. Create sda8 and sda9 of any size you want. You need to use "Type" in cfdisk to change the default partition type ID from 83 to 82 to make sda9 a swap. Format sda8, mount it and copy the original content of /boot back to it. No need to do anything on sda9 except as long as it has a partition ID 82.

Edit your Linux's /etc/fstab and change the location of sda3 to sda8 for /boot and sda4 to sda9 for swap.

You Linux will boot as before but the hard disk empty space is now live and not dead.

chickenjoy 09-17-2007 08:55 AM

Big Thanks bigrigdriver and saikee. Both were great detailed answers that I never expected. Saikee's suggestion was the hardest for me to accomplish out of the two so the first method I tried was bigrigdriver's. Easier done than said; I increased the extended the extended partition to consume the 11gb+ free space so that the next partitions created would start at sda8 and beyond. It worked!

thanks!


All times are GMT -5. The time now is 04:54 AM.