[Swap File] Re: Hibernation woes

NoOp glgxg at sbcglobal.net
Wed May 14 02:16:01 UTC 2008


On 05/13/2008 03:56 PM, Ted Hilts wrote:

> I read from NoOp's reference URL the following:
> 
> Hibernation needs swap
> 
> The hibernation feature (suspend-to-disk) writes out the contents of the 
> memory to the swap partition before turning off the machine. Therefore, 
> your swap partition should be at least as big as your RAM size. The 
> hibernation implementation currently used in Ubuntu, swsusp, needs a 
> swap or suspend partition, and ***can not use a swap file on an active 
> file system***.

By golly you are right, and I missed that comment in the SwapFaq. My
apologies & thanks for pointing that out.

To test the comment, I disabled my swap _partition_ (commented out in
/etc/fstab) on the laptop that I installed the swap _file_ on. I then
shut down the laptop completely, rebooted and checked to make sure that
the laptop was only using the swap _file_ - it was only using the _file_
(sorry for the underlining, but I want to make sure there is no
confusion re partition or file in this test).  So, no swap _partition_
and leaving at least one application open (terminal):

1. Suspend - works
2. Hibernate - I get at shut down error that it cannot find swap device,
'try swapon -a'. Tried that, and it didn't work. I put the swap
_partition_ back in & then Hibernate works.

The comment in the SwapFaq is correct; you do need a swap _partition_ to
use Hibernate. However, a swap _file_ works just fine for Suspend - that
may be because it is only using RAM and may not even be using the swap
_file_ - don't know.

So, the end result is that my suggestion wasn't such a good suggestion
afterall when it comes to _Hibernation (suspend-to-disk)_... sorry about
that.





More information about the ubuntu-users mailing list