last day (18 days later) » 

10:35 PM
3
A: Two swapfiles, hibernate working, how to correctly configure hibernate to not run out of space, or fail somehow

Charles GreenIn short, no you have to use a single file or partition for hibernation. TL;DR There is nothing in the basic kernel documentation for Sleep States or Power Interface which says that the swap has to be in a single file. Indeed, there is some indication that the hibernation data is written to av...

 
@dessert Thanks! I had just read https://meta.askubuntu.com/questions/16091/why-arent-most-qu‌​estions-answered-‌​wit‌​h-references-to-docu‌​mentation-or-mention‌​-t yesterday... When I had swap off, choosing 'hibernate' simply did nothing. I thought nothing of it, re-enabled swap and went on with my life!
@dessert Edited question - I tested with a small swapfile.
@dessert I think it would! My own system has a lot of trouble when I use swap (laptop, slow disk) and I think I'd like to hack the system calls for hibernate/resume to disable swap after resume, and enable swap at the start of the hibernation calls.
@dessert Looping back over OP's original question, I note that he has both swaps set for default priority - I don't know what this means, except that if the system picks the second file as higher priority, the system will not find the correct swapfile at boot. I suppose I should dig into what the default priority listing is...
 
Updated question. Seems hibernate don't respect swap priority.
 
@ leonid - man 2 swapon seems to indicate that there is also an "order loaded" preference in swap areas. This is an interesting question, and I migh suggest that for normal operations you load the SSD swap with a high priority, and the HDD swap with low priority, but load the HDD swap first in fstab.
 
I did it. HDD swap first with lower priority. Updated kernel parameters to restore from that swap - fail. It still uses SSD swap for hibernation and suspect resume kernel parameters for SSD(tried both). Need a hiberfil.sys linux support :)
So there is one possbility: to disable/enable swaps and update-grub on hibernate. What files are respond for this? I`ll try to add larger swap, disable smaller one, change grub config, update grub in shell script, however not fully undestood how to do it
 

  last day (18 days later) »