1

I am not allowed to have more than 4 partitions.During installing Ubuntu I am not allowed to have swap area because of this problem.What should I do?

enter image description here

Kaz Wolfe
  • 34,680

1 Answers1

1

The 37.52 GB is the unallocated space in your hard disk. With MBR partitioning scheme, you can not create a new partition with it. So your option is to merge in some other partition.

Your merger options:

  1. Merge the unallocated space to your 20.98 GB Ubuntu installation. [easiest and quickest]

  2. Merge it into your Windows' install partition (the C drive in Windows), OR move the Windows' install partition [risk involved] to bring it next to your Ubuntu root / partition, thus shifting unallocated space to right of Windows' partition which would then be merged to the extended partition (the D drive). [Moving Windows' install/system partition involves risks and can take a long time to complete.]


Regarding Swap space:

You can create one more logical partition (in the extended partition container /dev/sda4) and use it for swap.

For this you'll have to:

  • Start a partition manager say GParted,
  • To create a new logical partition in the extended partition you'll have to shrink your current and only logical partition /dev/sda5. You can do this by right clicking the partition and selecting resize/move option. Then in the Resize/Move window that appears, you can move the slider from right end towards left (preferred option) to create an unallocated space of appropriate size that you want for your swap,

    snap1 (this snapshot shows a resize/move operation being selected for a logical partition.)

    snap2

    (here I've selected a size of 2051 MB for the new partition. Make sure your Align to: option is set for MiB)

  • Right click the newly created unallocated space, and select New, snap3

    then set File System to linux-swap and click Add; snap4

  • Finally click Apply All Operations button. snap5


  • After you've created the swap partition, you can turn it on with sudo swapon -a (-a implies turn on all available swap, check man swapon for more.)

    To bring it in use each time you boot into your system, open the file /etc/fstab, with root privilege, using the text editor of your choice. Then add an entry like UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none swap sw 0 0 where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is replaced by the UUID of your swap partition. (You can use sudo blkid | grep swap to check your UUID.) Save and close the file.

References:

rusty
  • 16,917