My understanding is that suspend-to-swap (swsusp) will fail if there is not enough free space in swap.
Is there a way to reserve swap space for swsusp, such that the space will never be used for "normal" swap purposes?
I have seen another answer that suggests creating a swap partition, let it mount, and set
vm.swappiness = 0. But there are two issues with that solution:
- It's not bullet-proof;
vm.swappiness = 0doesn't completely prevent the kernel to use swap - it only makes the kernel really hold off using swap until it absolutely needs it.
- And if the kernel holds off using swap, well, I don't get to use regular swap at all.
What I'm envisioning is to have two separate swap partitions:
swap1will be exactly as big as my RAM and reserved for
swap2will be whatever size I want and used for normal swap.
Is that setup possible?
That would be similar to how Windows works; in Windows, you would have:
pagefile.sysfor normal swap
hiberfile.sysreserved for hibernation