Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If my only "hard drive" is a smallish SSD, are there any advantages to setting up a swap partition rather than a swap file?

share|improve this question
I don't even have a swap on my 80GB SSD as I've 8GB of RAM and do not need hibernation. – Lekensteyn Jun 23 '11 at 14:29
No swap here. my system is so quick booting I do not touch suspend and hibernation. – Rinzwind Jun 23 '11 at 16:15
up vote 1 down vote accepted

It makes no difference either way.

share|improve this answer
That's wrong. The kernel does support hibernating to a swap file. This works out of the box on some Ubuntu releases, others require manual tuning of the kernel command line in the bootloader configuration. – Gilles Jun 23 '11 at 15:08
I am pretty sure it has never worked out of the box since it requires manually pointing the resume_offset boot parameter to the location of the file, but I guess that does work if you bother. Answer corrected. – psusi Jun 23 '11 at 15:18
@psusi I know there is at least one hibernation framework on at least one Ubuntu version where you just issue the hibernate command and it takes care of setting up resume_offset. I don't remember which version that was, possibly 9.04 or 9.10 or 10.04, and I think the framework was uswsusp but I'm not sure. – Gilles Jun 23 '11 at 15:24
@Gilles uswsusp is something you have to install yourself. Out of the box Ubuntu has always just used the built in kernel implementation. – psusi Jun 23 '11 at 15:57
@punsi Thank you for your answer. Why would anyone choose a swap partition over a swap file, then, especially for smaller drives? What do you gain? – Closure Cowboy Jun 23 '11 at 23:20

Your Answer


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.