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: http://imgur.com/YMTr879

image

How can I create swap in my current setup?

4
  • please upload your gparted screenshot to imgur.com and post the link here. Nov 11, 2013 at 16:04
  • For a system with higher ram, it is not required. I had 6GB RAM, and I never saw 1% usage in SWAP. So as of now I removed it (I don't use hibernation). Convert data partition if to extended partition (I guess it is already), split it & use as SWAP. SWAP & ubuntu both can live on logical partition.
    – Web-E
    Nov 11, 2013 at 16:12
  • You can only add a new swap partition when you create(add) some-more partition. As all four partitions are already used, you've to first delete one partition(the last one will be easy) and create an Extended partition. There you can create two or more Logical partition. Then one of them you can use as Swap Nov 11, 2013 at 16:39
  • 1
    You can add a swap file in your Linux filesystem. It is explained in help.ubuntu.com/community/SwapFaq, search for "Four-step Process to Add Swap File".
    – Rmano
    Nov 11, 2013 at 16:51

2 Answers 2

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.

-1

You can check this link: https://askubuntu.com/questions/9092/importance-of-swap-partition

And This: https://help.ubuntu.com/community/SwapFaq

Best Wishes :)

3
  • 1
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Web-E
    Nov 11, 2013 at 16:15
  • Thanks, I guess I'll stick to using SWAP. The question I face now is how to set it up
    – 3l4ng
    Nov 11, 2013 at 16:16
  • You need to edit /etc/fstab and add the new swap partition. You need to add a line that looks like UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none swap sw 0 0 and you get the UUID using the command sudo blkid /dev/sda3 (substitute /dev/sda3 with the appropriate device name). source:askubuntu.com/questions/33697/…
    – Abood
    Nov 11, 2013 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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