hibernate with swap+swapfile?
Franz Waldmüller
waldbauernbub at gmx.at
Tue Apr 5 19:14:32 UTC 2011
Hi Marius,
Am 2011-03-28 19:25, schrieb Marius Gedminas:
> On Mon, Mar 28, 2011 at 04:21:34PM +0200, Franz Waldmüller wrote:
>> Am 2011-03-28 15:16, schrieb Karl Larsen:
>>> On 03/28/2011 07:07 AM, Franz Waldmüller wrote:
>> [snip]
>>>> i am going to upgrade my RAM this week from 4 to 12 GB. Since my swap
>>>> partition is only 4,5GB in size I will have to increase the swap space
>>>> because I want to use the hibernate on this machine.
>>>>
>>>> I would like to know, if creating a swapfile of around 8GB and adding
>>>> it to fstab is all I need to do?
>>>>
>>>> Will ubuntu use both, the swap partition and the swap file?
> ...
>> Thank you for your help. When a system hibernates Linux stores the
>> content of the RAM in the swap space or in a swap file. If you want
>> to hibernate you need some sort of swap regardless if it is used
>> during normal operation.
>
> To the best of my knowledge, hibernation requires a single swap
> partition and cannot make use of swap files.
>
> Also note that if you reformat a swap partition with mkswap, you'll need
> to write the new UUID to /etc/initramfs-tools/conf.d/resume and
> regenerate your initramfs image with
>
> dpkg-reconfigure linux-image-$(uname -r)
>
> or you won't be able to resume from hibernation.
>
> Marius Gedminas
>
Thank you for your advice, I created a new swap partition and everything
works fine.
Just out of curiosity: Is there an reason why Linux needs can only
resume from one swap partition or swapfile?
If you upgrade your RAM, adding more swap space can be difficult! I am
using mirrored hard disks, but luckily left some unused space at the
end. Otherwise it would have been a pain to add a large swap partition.
I do not object the need for a swap partition, but if there is a swap
partition of any given space there should be a possibility to save
information if a resume image is spread across several swap partitions
or swap files.
Is there some simple explanation?
Franz
More information about the ubuntu-users
mailing list