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

I found answer near to this question but not exact answer in Ubuntu-forums.I found answer to

  1. How to create swap partition after installing Ubuntu.
  2. How to create or add swap file to existing swap partition.

But now for this question. Since at the time of installation i don't know the use of swap partition, i installed Ubuntu 12.10 without swap partition and i used second method as mentioned in "" to create swapfile and got this error while using mkswap

# mkswap /root/myswapfile
Setting up swapspace version 1, size = 1048572 KiB
**no label, UUID=cc477ba5-e2d9-495c-a63b-300c4e5e0048**

and each time UUID differs. But i ignored and continued with next steps and when i tried to hibernate my system i got these errors

PM: swap header not found,
cannot get swap device try swapon -a,
cannot get swap writer

I just want to hibernate my system only using swapfile without creating swap partition. Is it possible? I'm new to ubuntu.

share|improve this question
related:… – Takkat Feb 28 '13 at 7:58
No @Takkat, I've followed the same steps to create swapfile and to make Ubuntu know about this file. But no luck. Only at first time it went off so i thought swap did worked for hibernation but when i boot my system again every work was gone. Any other suggestions? – learner Mar 1 '13 at 17:10
yeah, sorry for the confusion - you can no longer hibernate with a swap file. See Ubuntu SwapFAQ. This question here shows a rather hacky way (untested by me): – Takkat Mar 1 '13 at 17:22
up vote 0 down vote accepted

Due to the various concerns voiced here and also here I would caution against using a swap file. Maybe change your question and we can walk you through the retroactive installation of a swap partition.

share|improve this answer

Try installing USWSUSP package.... I hope this will work....

share|improve this answer
hi @Alex i installed uswsusp package but how to use it i didn't find its usage in its home page. I think it should be used by command. – learner Mar 11 '13 at 2:35
@learner . can u answer me a set of questions... do you have a separate swap partition ??? Or have you created a swap file using "dd" command ?? In the default installation of Ubuntu 12., suspend to disk is disabled by default due to kernel bugs.. I have created a swap file of 8gb using this sucessfully. – Alex Mar 11 '13 at 11:43

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.