I am using a dual boot setup (Windows 7 and Ubuntu 12.04 LTS).

The first two partitions belong to Windows and the third and fourth are the ubuntu system and swap partions respectively. All of these are primary and there is remaining unallocated space.

My plan was to allocate the remaining space as a shared partition for both operating systems, but since I defined all of the current partitions as primary, this is not possible (max. 4 primary).

Is is possible to create a new primary partition from the ubuntu swap partition and the unallocated space, and place the new swap partition inside - or will this break my system?

I know that logical swap partitions are possible, but not if such a change is possible retrospectively.

  • SWAP is not an obligation for Linux, but it is recommended to avoid a memory-full error. You can do whatever you want with it, that means you can do what you're asking about.
    – MrVaykadji
    Feb 13, 2014 at 18:18
  • 1
    first check you disk has GPT or MBR.if it was GPT you can create upto 128 partitions.If it has MBR partition table,delete the Ubuntu swap partition.create a new extended partition.Then you can create any number of logical partitions. Feb 13, 2014 at 18:29

1 Answer 1


As Avinash Raj says, a GPT disk doesn't have the 4-primary-partition limit, so you may be worrying over nothing.

Beyond that, on an MBR disk you can convert a primary partition to a logical partition (with surrounding extended partition) with my FixParts utility, which is part of the Ubuntu gdisk package. There are caveats and limitations, though; see the FixParts page for details.

Alternatively, if your swap partition is the one adjacent to the free space, you can delete it, create a new extended partition, and create a new logical swap partition within the extended partition. Because swap partitions hold inherently transient data, this type of operation doesn't require backing up the data, although you will have to reconfigure the swap entry in /etc/fstab. You'll also need to disable swap before doing this, and maybe perform the operations from a live CD rather than from your regular installation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .