0

This question already has an answer here:

Using Ubuntu 12.04 LTS, upgraded from 11.10. Had no idea while installing Ubuntu for the first time. So missed SWAP partition. Now, at times Ubuntu hangs and system monitor shows the memory usage full. Is there any method that I can create a partition from the current Ubuntu partition and assign it as SWAP partition ? If yes, kindly guide me to do the same.

How much SWAP partition space is recommended ? Current specs - 6 GB RAM, 1 GB Radeon GPU.

marked as duplicate by Takkat, karel, user117103, Eric Carvalho, falconer Feb 6 '14 at 16:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • In case you don't hibernate you may also add a swap on file: askubuntu.com/questions/126018/… – Takkat Feb 4 '14 at 13:21
  • Tip: Use top or I would suggest using htop to observe what type of application/service cause RAM overload. – AzkerM Feb 4 '14 at 13:29
0
  • To resize your Ubuntu partition and create a new swap partition from that space,follow the below steps,

    1. Boot Ubuntu live disk and then open Gparted.

    2. Right-click on the Ubuntu partition and select Resize option to create a new unallocated space of the desired size.

    3. From that unallocated space,create a new SWAP partition.

    4. Now right-click on the swap partition and select and select swap-on.

    5. Add an entry for your swap partition in /etc/fstab file to make swap-on the partition on startup.

    6. See this for how much space did you have to allocate for your swap partition.

  • Thanks Avinash. I hope it is that simple. Hope I won't spoil my Ubuntu installation. Will update here. – user227495 Feb 5 '14 at 2:56
  • It won't spoil your installed Ubuntu. – Avinash Raj Feb 5 '14 at 5:11
0

First of all, thumbs up for this question. This is indeed a good one though there are similar questions which has been already asked such as "I have 16GB RAM. Do I need 32GB swap?". This will help you to decide how much swap that you may need to allocate. Even, it is said that a good rule of thumb on deciding a swap allocation is to double the actual RAM size. Having said that it doesn't mean you will need 12GB of swap allocation since you have a 6GB physical RAM. Swap may vary on what actual purpose that a user or their system has to deal with.

But by the look of your question, I doubt that something cocky going on the background or some sort of application/services hogging your memory (just an assumption). While moving on with the swap, there's an interesting article available on the Official Ubuntu page itself about swap FAQ's on creating, expanding swap... etc.

I would suggest you to refer the part explained in-detail as; "Four-step Process to Add Swap File".

Some Interesting Source: Importance of Swap Partition

0

you have plenty of ram so dont need too much Swap space,

Load a Live enviroment (from CD or USB) so that your filesystem is free and you can edit its partition.

use gparted and lower your ext partition a couple of Gb

Add a new 'Linux_swap' partition

reboot

open gparted right click on that section of partition and turn it on (alternatively use the disks program click on the swap partition and click the little 'play' button beneath)

you have plenty of RAM so don't need too much swap space, 2Gb is plenty enough, probably overkill. you can increase performance of swap by using a different HDD than your filesystem, using the same technique just on a different HDD, this way you won't have to use a live enviroment either.

P.S. Backup if you don't want to lose anything. playing with partitions can seriously damage data. Defragging first can help stop this also, but no guarantee

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