Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On a Linux Virtual Machine that i recently setup, I had a disk /dev/sdb of size 20G in which i created 8 partitions (3 primary, 1 extended containing 5 logical partitions), using upto 10G of space. So there's 10G unpartitioned.

I can't use fdisk as the maximum allowable partitions 4 already created. Is there any other way to create new partitions on the remaining 10G space, without modifying or deleting existing partitions?

I could add a new disk /dev/sdc and use it, but i want to see what else can be done on /dev/sdb.

Any ideas will be much appreciated.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Before attempting to create a new partition, you have to grow the existing extended partition to fill the whole space and then create a new logical partition inside the extended partition.

share|improve this answer
add comment

You should be able to use fdisk to add an extended partition with no trouble. I've done so a number of times in Ubuntu as well as in several other ancient distros. But I prefer the graphical program GParted. It's available as a live CD if you don't have X installed.

share|improve this answer
    
Actually i couldn't, it says 'No free sectors available'. It would have been possible if i had atleast one spare primary partition, but i've used all 4 of them already –  Jay Sep 18 '12 at 5:08
    
In that case, you're doing something wrong. The fact that you're up to the limit tells me that you're still trying to create a primary partition instead of a logical one. –  Scott Severance Sep 18 '12 at 8:11
    
$fdisk /dev/sdb | Then, command (m for help): n | No free sectors available | I need to type 'n' followed by 'p' or 'l' to create a primary or logical partition right? Can't get there. –  Jay Sep 19 '12 at 1:45
    
Are you sure that you have free space on the disk? If fdisk can't do it, then it probably can't be done. I suspect that there's a misconfiguration somewhere. Please post the results of a session, including printing the partition table. Alternatively, try GParted. It's much easier than fdisk. I used fdisk a lot back in the day, but I now use GParted nearly exclusively. It's that much easier. –  Scott Severance Sep 19 '12 at 15:31
add comment

You damn newbs. Extended partition take one logical partition by itself, It's why it is called extent, it take one logical and permit to repartition it's content.

My advice would be to swapoff, delete swap. Resize root to take place of the swap, then create your extended partition, at the end of it, create your new swap. It doesn't matter if it is on extent.

Modify your fstab accordingly and you're done.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.