3 ms·
> On a laptop to hibernate, which results in zero power consumption vs suspend which will drain the battery in a day or so Swap is not strictly needed for this
by 77pt77 10y ago
> On a laptop to hibernate, which results in zero power consumption vs suspend which will drain the battery in a day or so
Swap is not strictly needed for this:
(it boils down to vm.swappiness=1)
https://wiki.debian.org/Hibernation/Hibernate_Without_Swap_Partition https://wiki.debian.org/Hibernation/Hibernate_Without_Swap_P...
- Spivak 10y agoYou still need swap, just not a swap partition. I suppose we can debate if there's a meaningful difference between the two.
- 77pt77 10y agoI could swear there was a way around that but I don't remember the details and can't find them. Still, it's possible to hibernate without having the drawbacks people have been complaining about in this thread.
- rogerbinns 10y agoI have an encrypted swap partition. Hibernation works well with that. I don't believe it is possible with a swap file since the containing filesystem would also be mounted by the hibernation image.
- 77pt77 10y ago> I don't believe it is possible with a swap file since the containing filesystem would also be mounted by the hibernation image. for sure it is. Even for swap files inside an encrypted volume. https://vadim-kirilchuk-linux.blogspot.com/2013/05/swap-file-for-hibernation.html https://vadim-kirilchuk-linux.blogspot.com/2013/05/swap-file... The crux is knowing the swap-file offset and passing that argument as resume_offset on boot. Have a look. It's totally doable and you won't need to have an actual partition.
- rogerbinns 10y agoI never realised the swap header on files also provides enough information to locate the other blocks without going through the filesystem. Logical I guess. This is however more work that "works out of the box" swap partitions.