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

Ive learned that one should allot a swap space inorder to have Hibernate option in Ubuntu, Why isnt it same with Windows? My Win 7 doesnt have any Swap space but still hibernates without a glitch.

share|improve this question
It is possible to make Windows put the pagefile on another partition. – Dalton Miller Dec 1 '11 at 15:13
up vote 5 down vote accepted

Typically a swap file is used when the RAM is exceeded to free the RAM by storing its content to a swap file. In Windows environments this is a file (usually pagefile.sys) which is stored on the system partition. In Linux it is recommended to create an extra partition for swap. As far as I know this is not needed, you should be able to hibernate without an extra partition because linux should be able to use a file, too. For further information:

The advantages of an extra swap partition are:

  1. Security: Linux wipes the swap file securely before shutdown so nobody can restore it.
  2. Performance: You may wish to map your swap partition to an SSD to increase speed.
  3. Even if your system partition is full, you have some space for your swap data.
share|improve this answer
Why was this answer accepted? It completely misses the point of the question. The question is asking why Ubuntu needs swap to hibernate, not what is a swap partition and why should you have one. – psusi Dec 2 '11 at 1:09

Windows uses a file for that instead of a partition. According to wikipedia

A file, "hiberfil.sys" is used to store the contents of RAM when the computer hibernates, and is always the same size as the total RAM. A hidden system file resides in the root of the system partition, usually "C:\hiberfil.sys".

Regarding why linux uses a partition by default. Honestly, I don't know, but I guess it's because of performance reasons.

Edit: As pointed out in a comment, you can also swap to a file as explained in the answers to this question.

share|improve this answer
You can use a swap file in Linux. You typically don't as to try to avoid filesystem overhead. – user606723 Dec 1 '11 at 15:54
@user606723 You're right, I'll update my response to make it clear that a file can also be used. – jcollado Dec 1 '11 at 16:40

Linux uses the swap partition for both paging and hibernation. Windows uses a separate file for each. It uses pagefile.sys for paging, and hiberfil.sys for hibernation, so while you might not have a pagefile, you still have a hibernation file.

share|improve this answer
+1 for answering the question! – richard Aug 11 '13 at 20:05

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.