For RAM of size N Bytes we will need a swapfile size of N to 2*N Bytes for both virtual memory and hibernation to work properly.
Having swap larger than 2*N Bytes is usually unnecessary and just wastes space, unless you are planning to upgrade RAM in the near future.
So by simple math it brings you over 1GB of needed space in the swapfile.Some argue rightfully for 2 separate files - one for swap, one for hibernation.Swapfile approach should make it very easy to have 2 separate files and avoid problems.Now let's run the tools to make them work: For pre-grub2: Verify that all your kernel stanzas (menu entries) got updated in /boot/grub/(or in /boot/grub/for grub2) with resume=...and resume_offset=..., if not - verify your # kopt= line - it should have # and space (GRUB_CMDLINE_LINUX_DEFAULT= line for grub2 should have quotes). It may keep your old file if you chose wrong answer above.You can dry-run dd with of=/dev/null to see if your numbers will get the desired swapfile size. You can go ahead and check stock quotes while dd creates the new file for a few minutes.- will show you that you are indeed using swapfile PART 2 - HIBERNATION Now we will make the hibernation work again.This HOWTO explains how to use swapfile and still have hibernation working.(For advanced console users / cmdline junkies - you may find compressed list of commands at the end of this HOWTO) Why would you want a swapfile? Swap partition does work fine, but there are 3 cases when you may want a swapfile instead: This HOWTO was tested only on Intrepid, but may work on other versions.UPDATE 7 Sept 2011: I tested it with Ubuntu 10.04 LTS (Lucid Lynx) and made appropriate edits.To reverse back to swap partition: DISCLAIMER: Messing up with disk partitions may make your system unusable, cause loss of data, loss of hair and/or sleep.