Hi,
I have just upgraded to the new 5.8 kernel on Fedora 32.
I have also configured my swap as a swap file of 8GB.
But when I try to hibernate using the following command:
$ systemctl hibernate Failed to hibernate system via logind: Not enough swap space for hibernation
I have no idea why this is happening when I have 8GB of free swap space :
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.6Gi 4.1Gi 269Mi 2.0Gi 5.6Gi Swap: 8.0Gi 0B 8.0Gi
My RAM is also 8GB.
Any ideas ?
On Fri, Nov 13, 2020 at 09:24:52PM +0530, Sreyan Chakravarty wrote:
Hi,
I have just upgraded to the new 5.8 kernel on Fedora 32.
I have also configured my swap as a swap file of 8GB.
But when I try to hibernate using the following command:
$ systemctl hibernate Failed to hibernate system via logind: Not enough swap space for hibernation
I have no idea why this is happening when I have 8GB of free swap space :
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.6Gi 4.1Gi 269Mi 2.0Gi 5.6Gi Swap: 8.0Gi 0B 8.0Gi
My RAM is also 8GB.
Any ideas ?
I believe that using a swap *file* for hibernation requires special steps, as described here:
https://www.kernel.org/doc/html/latest/power/swsusp-and-swap-files.html
I believe you need to add the kernel parameters to make it work, or you have to switch to the userland suspend interface.
On Fri, Nov 13, 2020 at 9:29 PM Jonathan Billings billings@negate.org wrote:
I believe that using a swap *file* for hibernation requires special steps, as described here:
https://www.kernel.org/doc/html/latest/power/swsusp-and-swap-files.html
I believe you need to add the kernel parameters to make it work, or you have to switch to the userland suspend interface.
I already have the required kernel parameters set.
On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:
I have no idea why this is happening when I have 8GB of free swap space :
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.6Gi 4.1Gi 269Mi 2.0Gi 5.6Gi Swap: 8.0Gi 0B 8.0Gi
My RAM is also 8GB.
The old recommendation always was to have *MORE* swap space than RAM.
On 11/13/20 9:39 PM, Tim via users wrote:
On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:
I have no idea why this is happening when I have 8GB of free swap space :
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.6Gi 4.1Gi 269Mi 2.0Gi 5.6Gi Swap: 8.0Gi 0B 8.0Gi
My RAM is also 8GB.
The old recommendation always was to have *MORE* swap space than RAM.
That's a good point. The memory usage is quite low at that point, but if he ever ended up using swap space, there could easily not be enough to hibernate. However, it should work in this current case.
On Fri, Nov 13, 2020 at 11:10 PM Samuel Sieb samuel@sieb.net wrote:
On 11/13/20 9:39 PM, Tim via users wrote:
On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:
I have no idea why this is happening when I have 8GB of free swap space :
$ free -h total used free shared buff/cache available Mem: 7.7Gi 1.6Gi 4.1Gi 269Mi 2.0Gi 5.6Gi Swap: 8.0Gi 0B 8.0Gi
My RAM is also 8GB.
The old recommendation always was to have *MORE* swap space than RAM.
That's a good point. The memory usage is quite low at that point, but if he ever ended up using swap space, there could easily not be enough to hibernate. However, it should work in this current case.
Hibernation is pretty complicated. What should happen is the kernel evicts dirty pages to swap in order to free up 50% RAM. Then the kernel uses that free memory to create the hibernation image and compress it and then it gets written into swap. So there are some opportunities for it to fail.
There's a bunch of tests to do to help narrow down the problem. https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html
Note that swapfiles on Btrfs additionally need an offset boot parameter added. https://bugzilla.kernel.org/show_bug.cgi?id=202803#c9
On Sat, Nov 14, 2020 at 11:40 AM Samuel Sieb samuel@sieb.net wrote:
That's a good point. The memory usage is quite low at that point, but if he ever ended up using swap space, there could easily not be enough to hibernate. However, it should work in this current case.
Exactly, it should work. It use to work before I upgraded to the latest release of F32.
Thank you to everyone here.
I guess the problem was not putting the correct kernel parameters.
Now hibernation actually works faster.
Thanks again.