0

I'm dual-booting Windows 10 and Manjaro 17 and when I installed the latter I forgot to add a swap partition.

Noticed that and tried to create one from GParted but it is returning the following error when I click on 'New':

It is not possible to create more than 4 primary partitions

If you want more partitions you should first create an extended partition. Such a partition can contain other partitions. Because an extended partition is also a primary partition it might be necessary to remove a primary partition first.

/dev/sda1 is the Windows system reserved partition.

/dev/sda2 is the Windows boot partition.

/dev/sda3 is the other NTFS partition I've been using to store stuff.

/dev/sda4 is the Linux partition.

Already shrinked /dev/sda3 by about 8 GB which I want to use as swap.

Not sure how to proceed.

  • What Error do you get from gparted when trying this? – Stese Aug 16 '17 at 15:06
  • Quoted it below: "It is not possible to create more than 4 primary partitions If you want more partitions you should first create an extended partition. Such a partition can contain other partitions. Because an extended partition is also a primary partition it might be necessary to remove a primary partition first." Can't add images for some reason. – Alexandru Burada Aug 16 '17 at 15:08
  • You should do as directed: "You should first create an extended partition." this requires you to delete a partition then recreate the partition you deleted and create the partition for the swap. You should delete dev/sda4 in order to accomplish this. – Ramhound Aug 16 '17 at 15:10
  • You don't need swap partition. Make a swap file. – jiggunjer Aug 16 '17 at 15:22
  • It may be possible to convert one primary partition to a logical partition using fixparts. See this page for details, and in particular the "Adjusting Your Partitions" section. – Rod Smith Aug 16 '17 at 16:36
0

This process is relatively easy.

You will have to delete a partition.

Create an Extended Partition

Create the additional partitions inside the extended partition.

OR The hard way!

First research if your hardware supports GPT.

If it does then converting to GPT might make more sense.

  • If he has a second drive with enough spare unformatted space he can clone the partition onto that before deleting it. Then copy it back after creating the extension. – jiggunjer Aug 16 '17 at 15:26
0

The easiest way may be to resize /dev/sda3 back to what it was and create a file on the disk to use as swap rather then a partition. One way to do this is to issue a command

dd if=/dev/zero of=/swap.file bs=1048576 count=X

Where X is the size of the swap partition in megabytes.

The next step is to format it -

mkswap /swap.file

Then add it to fstab as you would a partition, then type swapon -a to activate (or reboot)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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