weixin_39556853
weixin_39556853
2021-01-06 18:30

Hibernation with swapfile not working

Since I forgot to create a partition for the swap, I'm trying to setup the hibernation with a swapfile instead I'm using an SP4 i5 version with 8Gb of RAM. I created a swapfile of 8Gb (as it was suggested on some forums), then added the resume command with the resume_offset of the swapfile to /etc/grub/default and I updated the bootloader. However, when I try to launch pm-hibernate, in the /var/log/pm-suspend log file there is an error when launching s2disk but it fails with this message s2disk: Invalid resume device. Reason: Success Am I settings something wrong, or it is not possible to setup the hibernation with a swapfile? Thanks for your help in advance and congrats for the job done so far

该提问来源于开源项目:jakeday/linux-surface

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39556853 weixin_39556853 4月前

    I kept the resume option in both of them, namely: /etc/default/grub/:

    
    ...
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep=old_ordering resume=UUID=b7c9dc97-fd48-408a-bc2d-faa68faa737d resume_offset=1024000 resumedelay=1"
    ...
    

    /etc/initramfs-tools/conf.d/resume:

    
    resume=UUID=b7c9dc97-fd48-408a-bc2d-faa68faa737d resume_offset=1024000
    
    点赞 评论 复制链接分享
  • weixin_39581716 weixin_39581716 4月前

    Hi, I could fix issue with hibernate, look in my comment , maybe it can help with you issue.

    点赞 评论 复制链接分享
  • weixin_39556853 weixin_39556853 4月前

    thanks for pointing me out your solution. However I tried to follow the steps you listed but I'm still having the same problem. By the way, how do you put your device in hibernation? Do you launch the sudo pm-hibernate or do you do you use the suspend button after having overwrite the suspend mode with the hibernation?

    点赞 评论 复制链接分享
  • weixin_39581716 weixin_39581716 4月前

    I didn't test with this command , the hardware button press (set up in the setting), or close the lid put device in the hibernation. Also the setting is working where device after giving time automatically go in the hibernation state

    点赞 评论 复制链接分享
  • weixin_39556853 weixin_39556853 4月前

    I set the hardware power button to put the device in hibernation and at least the device powers off (it takes some time, first the screen turns off, and then after 20-30seconds the keyboards turns off as well with the rest of the device) However, when I turn it back on, everything is like no hibernation was done It is true, however, that after turning it on after having hibernated it, it some more time to boot up the OS, maybe it means that it tries to load the old state from the disk but something goes wrong. As always, debugging this kind of things is never easy, but I'll try to find some logs where it might be displayed the cause of the issue

    点赞 评论 复制链接分享
  • weixin_39556853 weixin_39556853 4月前

    I think I fixed. The issue was that while in /etc/initramfs-tools/conf.d/resume I had resume=UUID=<UUID>, in /etc/default/grub/ I had resume=<UUID>. (I also uninstalled pm-utils and uswsusp and updated the initramfs for safety -- as pointed out in this Question/Solution) Thank you really much for your help.

    点赞 评论 复制链接分享
  • weixin_39951419 weixin_39951419 4月前

    could you please tell us where you kept the resume option: in /etc/initramfs-tools/conf.d/resume or /etc/default/grub? Thanks.

    点赞 评论 复制链接分享

相关推荐