Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Linux Mint 13 LTS which is based on Ubuntu 12.04 LTS.

I installed it on my SSD and will use the HDD for data storage only. When installing the OS I skipped making a swap file/partition. The machine has 8GB RAM and I wasn't sure whether I need a swap file at all. But after some reading I understood that the swap file is used in some cases even if there is free RAM still. So, it seems that I will need it.

  1. Should I create it like a file or like a partition?
  2. Should it be on the SSD or on the HDD?
  3. If I create it on the HDD, could it be a bottleneck for the system because of the lower read/write speeds compared to the SSD where the OS is installed?
  4. What is the optimal size for a laptop with 8GB RAM?
share|improve this question

closed as off-topic by vasa1, Kevin Bowen, Mateo_, Alvar, Eric Carvalho Aug 15 '13 at 10:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – Community, Kevin Bowen, Mateo_, Alvar, Eric Carvalho
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Questions that are about Linux Mint and not about Ubuntu are off-topic. For this reason I recommend asking further question about Mint somewhere Linux Mint is supported, like the Linux Mint Forums or Unix.SE. Close-voters: However, in this particular instance, the question already has an accepted, upvoted answer that is applicable to Ubuntu and should help users of Ubuntu proper. So there is perhaps no need to close this. –  Eliah Kagan Aug 15 '13 at 1:36
    
@EliahKagan, I know that the LTS version of Mint is based on Ubuntu 12.04 LTS and except the visual things I thought that most of the actions are same. That was the reason for asking here. But thanks for the note, will know for future questions. –  enenen Aug 15 '13 at 7:58

1 Answer 1

up vote 3 down vote accepted

Yes, its recommended to create a swap partition.

You could make it on the HDD as it will be used very rarely.

Size- 4GB is recommended.

The Swap partition can be useful also when you are booting from a live DVD, which will automatically detect your Swap partition.

To create the swap partition-

Launch Gparted partition editor. From devices, choose your hard disk.

shrink an existing partition by 4gb.

In the space thats created right click, new,(options) size- 4096 mb, type- linux swap, label- Swap

Then click on accept.

After this Swap partion is created you can right click on it and select SwapOn. This will activate the swap partition.

To automatically activate (mount) the swap partition at startup, you will have to follow the following steps-

In a terminal, type

sudo blkid

This would list all your partitions and their UUIDs. From here you need to copy the UUID of your newly created swap partition.

Then in the terminal type-

sudo gedit /etc/fstab

Inside this file there will be a list of partitions. Now you need to make entry for your swap partition.

Like this-

UUID=a73fa26b-e12b-41d5-925f-58851419359a   swap                swap    sw          0   0

In the same way create the entry as I have created, but remeber to replace my Swap partition UUID with the one that you got using the sudo blkid command.

Here is a link about Swap partiton from the Ubuntu Web Wiki

SwapFAQ

If you are having any problems please let me know.

share|improve this answer
    
Thanks. I done that. One last question: how to be sure that the swap is active and working? –  enenen Aug 14 '13 at 18:26
    
In a terminal, type- "swapon" (without the quotation marks) this would indicate if swap is being used, and which partition is used for swap; and if my answer helped you, please mark it as solved :) –  Aaditya Bagga Aug 14 '13 at 18:35
1  
Source for this claim: "For best performance, make a swap partition rather than a swap file"? The FAQ you linked to explicitly contradicts you as does wikipedia. (Note even the very first ubuntu release back in 2004 was already a 2.6 kernel and there's no significant performance difference even with later kernels.) –  dr jimbob Apr 11 at 21:48
1  
@drjimbob, removed it. –  Aaditya Bagga May 3 at 18:31

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