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.

New installation coming up. 120gb SSD for OS and HOME and 1tb HDD for storage. 16gb of ram which means 16gb of swap if I recall correctly. SSD space is too valuable for a swap partition right? If my thinking is correct can someone guide me through or point me in the right direction for putting a swap partition on a second hard drive? I have always selected the automatic settings when installing ubuntu. Thanks!

share|improve this question
add comment

4 Answers

up vote 7 down vote accepted

A swap partition on your SSD will let you wake up faster from hibernation (aka "suspend to disk") as compared to swap on a hard drive. But given the incredibly fast boot time of Ubuntu when booting from SSD a wake up from hibernation may be slower than a reboot.

If you do not hibernate you may never need to swap at all.

Only in case you often have very many RAM intensive applications running in parallel, your system may eventually use swap. Then a swap on SSD will be somewhat faster than a swap on a hard drive. Still there is no need to worry about wearing of your SSD from extensive swapping.

If not used for hibernation you can alway add a swap partition or swap on file later:

share|improve this answer
    
Thanks for your response. I don't think I will be hibernating if boot times are as quick as I have read. Thanks again! –  user197088 Oct 2 '13 at 3:07
add comment

SSDs are faster (although speeds decrease in time here too) but also have a smaller lifespan. Before making this choice think about the swapping habits of your distro.

Correct me if I'm wrong but this setup is your home PC, right? With 16GB I really doubt that you'll be doing much swapping especially since for example hibernation rarely works properly and is disabled in Ubuntu by default.

As an alternative to a swap partition you can use a swap file. The huge advantage with the second is that it can grow and shrink according to your needs where a partition is usually harder to deal with especially if it is between two other partitions and there is no space left.

Read here for more information on SSD for swap space:

For swap size see:

share|improve this answer
add comment

Personally with 16gb of memory to your disposal I wouldn't even bother with a swap partition... Just make sure that you add the following line to the end of the /etc/sysctl.conf file and things should run as normal:

vm.swappiness = 0

...save and reboot and no swap needed... I use this for my 2gb machine and never had a problem or slowdown since...

share|improve this answer
    
I would suggest the same thing. I have 8gb RAM on my thinkpad and the only time swap even got activated so far was while running 2 virtual machines and eclipse side by side...and that took up about >100mb swap (while there where still ~2gb RAM available) –  Daniel Oct 1 '13 at 6:55
1  
However, if you intend to hibernate, then you will need swap. –  Paddy Landau Oct 1 '13 at 13:09
    
I don't plan on hibernating any with the implied boot times I have been reading. The 16gb of ram is due to this being a light video editing rig. Not sure yet if it will max out the ram. –  user197088 Oct 2 '13 at 3:10
add comment

Apart from the other great answers, I just wanted to ask that you can have more than one swap partition. So you could put 4GiB of swap on the SSD and the rest in the HDD so if you need to swap something during your computers usage it goes to the fast swap. If you hibernate, probably the SSD swap won't be enough and you'll need the HDD swap too.

To do this, you'll need to create one swap partition in each disk, and once installed you'll need to open /etc/fstab so your system gives preference to the fast swap. So open a terminal and execute sudo gedit /etc/fstab. You'll need to locate the pair of lines referencing your swap partitions, and edit them to add the pri setting (a higher number on the fastest disk):

# before
UUID=some-large-number  none  swap    sw   0 0
UUID=another-large-number  none   swap  sw  0 0

#after
UUID=some-large-number  none  swap    sw,pri=10   0 0
UUID=another-large-number  none   swap  sw,pri=20  0 0

You need to know which of this is in the fast disk and which on the slow disk. Executing the blkid on the terminal will help you identifying each one.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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