# Ubuntu – Does 12.04 support hibernating to a swap file

12.04hibernateswap

I'm about to reinstall Ubuntu on a netbook with a tiny disk. Because of the tiny disk size, I'd strongly prefer to have a swap file than a swap partition. However, I want to be able to hibernate.

I know that hibernation needs to be manually enabled. I also know that hibernation to a swap file works on the old Eeebuntu that I'll be replacing, so hardware support is not a concern.

Does the precise kernel support hibernation to a swap file? What if anything do I need to configure?

Please note that I'm looking for reliable, up-to-date information. I don't mind if hibernation isn't supported out-of-the-box, but I'd prefer not to have to recompile a kernel if I can do without. I'll balk at patching the kernel for that machine.

As far as I know the file /etc/initramfs-tools/conf.d/resume has the parameter from where to fetch the hibernation data and it was originally a device, but in (many) recent versions uses UUID. It defaults to the swap partition you installed and I know this because if you by some chance change your swap partition or UUID you need to update it there and run sudo update-initramfs -u for hibernation to work again. This is true for at least Quantal, Precise and Lucid so I guess its true for current supported versions too.