0

I am running Ubuntu 13.10 64bit on a system with 4GB RAM, dual booting with Windows

Most people say that it is good to have swap on a system, and results in speed, so I used it with my previous Ubuntu installations.

In my new HDD, I use 3 primary partitions: 1 for Windows OS(ntfs), 1 for Ubuntu(ext4) and 1 for data(ntfs). I did this so that any crashes in an OS would not cause data loss

The windows system also took up one primary partition for system, and I have only 4 MBR slots. Effectively I have no primary partition for SWAP. I do not know it happened earlier, but back then I had a partition for swap as well

My CURRENT disk partitioning looks like this: https://i.sstatic.net/3VLl1.jpg

image

How can I create swap in my current setup?

Saurav Kumar
  • 15,174
3l4ng
  • 926
  • 2
  • 9
  • 26

2 Answers2

0

First, swap space doesn't generally result in significant speed increases. Swap space is used when RAM fills up, so it enables you to run more programs in a limited amount of RAM. Because disk access is slower than RAM access, by the time you need swap for this purpose, your system's speed will start to decline. Swap space is also used by suspend-to-disk operations, and for that purpose, you need at least as much swap space as you've got RAM. (That said, because Linux uses RAM for disk caches, putting little-used data in swap space can result in more disk-cache use, which can increase speed just a little, so there can be some speed benefit to having swap. I don't have any benchmark data handy, but AFAIK this effect is usually pretty small.)

Second, you can convert partitions from primary to logical form with my FixParts program, which is part of the gdisk package in Ubuntu. See the FixParts Web page for more information and documentation. You may need to resize at least one partition using GParted to make this conversion, but you'd need to do this to create new partitions anyhow, so that's probably not too big a hurdle.

Finally, the 4-primary-partition limit applies to the older Master Boot Record (MBR) partitioning system. The newer GUID Partition Table (GPT) system has a limit of 128 partitions by default, and that value can be raised. GPT doesn't use extended or logical partitions. My hunch is that you're using MBR, since if your computer is booting Windows from the disk you show, it would need an EFI System Partition (ESP) to boot from a GPT disk, and your screen shot shows no hint of such a partition. Thus, I don't think that this paragraph really applies to you. I mention it on the off chance that your screen shot is incomplete or misleading, and for the benefit of other readers with a similar question who might be using GPT.

Rod Smith
  • 45,120
  • 7
  • 66
  • 108