You are not logged in.

#1 2020-09-28 00:40:40

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

[SOLVED] Fail to hibernate "Not enough swap space for hibernation"

As indicated, my system will not hibernate.

- Arch is freshly upgraded
- Desktop environment: Xfce
- Hardware: System76 Galago Pro laptop

Goal:
Hibernate into swap file located at /home/swapfile.  Swapfile resides in /home due to space constraints in /.

What I've done:
Follow the steps at https://wiki.archlinux.org/index.php/Po … ibernation
.  Skipped the Btrfs and LVM sections because I don't think they apply.

Issue:
I continue to get "not enough swap space" messages.

Evidence 1:

$ systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation

Evidence 2:
Assigning power button to Hibernate in Xfce Power Manager and pressing the power button results in a Power Manager desktop notification reading
"GDBus.Error:org.freedesktop.login1.SleepVerbNotSupported: Not enough swap space for hibernation"


Please help.  I don't know how to further troubleshoot the problem myself.

Last edited by eigenstryker (2020-09-28 20:44:26)

Offline

#2 2020-09-28 02:27:12

mpan
Member
Registered: 2012-08-01
Posts: 1,332
Website

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

The most important question: what is the size of the swap file? Is it large enough to contain all the memory used by the programs? That is: resident size plus swap space used.  What is the output of free?


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2020-09-28 03:20:23

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

mpan wrote:

The most important question: what is the size of the swap file? Is it large enough to contain all the memory used by the programs? That is: resident size plus swap space used.  What is the output of free?

Here it is:

$ free
              total        used        free      shared  buff/cache   available
Mem:       16269068     3328444     9420160     1430460     3520464    11177832
Swap:      15922196           0    15922196

I thought the swap already was at least as large as the memory, so maybe here lies the problem.  I'll try a larger swap.

Offline

#4 2020-09-28 04:25:32

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

eigenstryker wrote:
mpan wrote:

The most important question: what is the size of the swap file? Is it large enough to contain all the memory used by the programs? That is: resident size plus swap space used.  What is the output of free?

Here it is:

$ free
              total        used        free      shared  buff/cache   available
Mem:       16269068     3328444     9420160     1430460     3520464    11177832
Swap:      15922196           0    15922196

I thought the swap already was at least as large as the memory, so maybe here lies the problem.  I'll try a larger swap.

So, I made a larger swapfile, but the same error messages persist.  Current output of free:

$ free
              total        used        free      shared  buff/cache   available
Mem:       16269068     2250156    12038648      719796     1980264    12993816
Swap:      16383996           0    16383996

Offline

#5 2020-09-28 04:58:26

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 646

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

Did you read the note in https://wiki.archlinux.org/index.php/Po … _swap_file ?

Power management/Suspend and hibernate#Hibernation into swap file wrote:

If the swap file is in /home/, systemd-logind will not be able to determine its size and thus will prevent hibernation. See systemd issue 15354 for a workaround.

Offline

#6 2020-09-28 05:10:08

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

nl6720 wrote:

Did you read the note in https://wiki.archlinux.org/index.php/Po … _swap_file ?

Power management/Suspend and hibernate#Hibernation into swap file wrote:

If the swap file is in /home/, systemd-logind will not be able to determine its size and thus will prevent hibernation. See systemd issue 15354 for a workaround.

Yes, I did.  I tried both the described workarounds that involved additions to logind:

[Service]
ProtectHome=read-only

and

[Service]       
Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1

Unfortunately, neither of the two options seems to make a difference.

Offline

#7 2020-09-28 05:34:30

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

Correction: I found a difference between the two options.

  • "ProtectHome=read-only" appears to not change the error messages.

  • "Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1" does make both error messages go away, a Hibernate button appears in my Log Out menu options, and the system appears to try hibernating.  The screen locks, but the computer does go into hibernation or suspend.  New output is also printed into the XScreensaver screen:

    xscreensaver: 22:22:13: DPMSForceLevel(dpy, DPMSModeOff) did not change monitor power state.
    xscreensaver: 22:22:13: not launching hack (throttled.)
    xscreensaver-command: window 0x03a00001 mapped.
    xscreensaver-command: suspending.
    
    xscreensaver-command: deactivating.

Offline

#8 2020-09-28 06:16:29

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 646

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

Is there anything in the journal about hibernation?
Did you set the correct resume and resume_offset kernel parameters? Do /sys/power/resume and /sys/power/resume_offset contain the correct values?

Have you tried hibernating without using logind?

# echo disk > /sys/power/state

Edit:
Post the output of:

$ findmnt -no MAJ:MIN -T /home/swapfile
# filefrag -v /home/swapfile
$ grep . /sys/power/resume*

Last edited by nl6720 (2020-09-28 06:23:16)

Offline

#9 2020-09-28 07:26:35

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

nl6720 wrote:

Is there anything in the journal about hibernation ?

Recent journal entries, grep'd for "hibernat":

Sep 27 22:22:13 stimpy systemd-sleep[1784]: Failed to find location to hibernate to: Function not implemented
Sep 27 22:22:13 stimpy systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 22:22:13 stimpy systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
Sep 27 22:22:13 stimpy audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Sep 27 22:22:13 stimpy systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
Sep 27 22:22:13 stimpy kernel: audit: type=1130 audit(1601270533.639:110): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x00058000-0x00058fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x0009e000-0x000fffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x66143000-0x6644cfff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x67601000-0x67601fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x67602000-0x67602fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x676d0000-0x676ddfff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x769ba000-0x76b19fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x78712000-0x78712fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x79b09000-0x7a9c6fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7a9c7000-0x7a9effff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7a9f9000-0x7aa57fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7aa58000-0x7b32cfff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7b32d000-0x7b3fefff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7b400000-0x7fffffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x80000000-0xdfffffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xe0000000-0xefffffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xf0000000-0xfdffffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfe000000-0xfe010fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfe011000-0xfebfffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfec00000-0xfec00fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfec01000-0xfecfffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfed00000-0xfed00fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfed01000-0xfedfffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfee01000-0xfeffffff]
Sep 27 22:23:36 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xff000000-0xffffffff]
Sep 27 22:35:37 stimpy systemd-sleep[2587]: Failed to find location to hibernate to: Function not implemented
Sep 27 22:35:37 stimpy systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 22:35:37 stimpy systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
Sep 27 22:35:37 stimpy audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Sep 27 22:35:37 stimpy kernel: audit: type=1130 audit(1601271337.860:104): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Sep 27 22:35:37 stimpy systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
Sep 27 23:55:50 stimpy kernel: PM: hibernation: hibernation entry
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x00058000-0x00058fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x0009e000-0x000fffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x66143000-0x6644cfff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x67601000-0x67601fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x67602000-0x67602fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x676d0000-0x676ddfff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x769ba000-0x76b19fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x786e0000-0x786e0fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x79b09000-0x7a9c6fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7a9c7000-0x7a9effff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7a9f9000-0x7aa57fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7aa58000-0x7b32cfff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7b32d000-0x7b3fefff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x7b400000-0x7fffffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0x80000000-0xdfffffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xe0000000-0xefffffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xf0000000-0xfdffffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfe000000-0xfe010fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfe011000-0xfebfffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfec00000-0xfec00fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfec01000-0xfecfffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfed00000-0xfed00fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfed01000-0xfedfffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xfee01000-0xfeffffff]
Sep 27 23:56:46 stimpy kernel: PM: hibernation: Registered nosave memory: [mem 0xff000000-0xffffffff]
nl6720 wrote:

Did you set the correct resume and resume_offset kernel parameters? Do /sys/power/resume and /sys/power/resume_offset contain the correct values?

I did, but when I write values to /sys/power/resume{,_offset} per the wiki instructions, they end up being overwritten to different values after reboot.  See terminal output below.

nl6720 wrote:

Have you tried hibernating without using logind?

# echo disk > /sys/power/state

I had not.  I just did that and it made my screen go black for a couple seconds before returning.

nl6720 wrote:

Post the output of:

$ findmnt -no MAJ:MIN -T /home/swapfile
# filefrag -v /home/swapfile
$ grep . /sys/power/resume*

$ findmnt -no MAJ:MIN -T /home/swapfile

  8:3

# filefrag -v /home/swapfile

Filesystem type is: ef53
File size of /home/swapfile is 16777216000 (4096000 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..    2048:    7018495..   7020543:   2049:            
   1:     2049..   18431:    7028736..   7045118:  16383:    7020544:
   2:    18432..  313343:    7045120..   7340031: 294912:    7045119:
   3:   313344..  804863:    7372800..   7864319: 491520:    7340032:
   4:   804864..  870399:    7897088..   7962623:  65536:    7864320:
   5:   870400.. 1294335:    7964672..   8388607: 423936:    7962624:
   6:  1294336.. 1785855:    8421376..   8912895: 491520:    8388608:
   7:  1785856.. 2277375:    8945664..   9437183: 491520:    8912896:
   8:  2277376.. 2768895:    9469952..   9961471: 491520:    9437184:
   9:  2768896.. 3260415:    9994240..  10485759: 491520:    9961472:
  10:  3260416.. 3751935:   10518528..  11010047: 491520:   10485760:
  11:  3751936.. 3948543:   11042816..  11239423: 196608:   11010048:
  12:  3948544.. 3958783:   11241472..  11251711:  10240:   11239424:
  13:  3958784.. 3960831:   11259904..  11261951:   2048:   11251712:
  14:  3960832.. 3973119:   14503936..  14516223:  12288:   11261952:
  15:  3973120.. 4003839:   14518272..  14548991:  30720:   14516224:
  16:  4003840.. 4012031:   14551040..  14559231:   8192:   14548992:
  17:  4012032.. 4030463:   14563328..  14581759:  18432:   14559232:
  18:  4030464.. 4046847:   14592000..  14608383:  16384:   14581760:
  19:  4046848.. 4050943:   14610432..  14614527:   4096:   14608384:
  20:  4050944.. 4052991:   14624768..  14626815:   2048:   14614528:
  21:  4052992.. 4073471:   14641152..  14661631:  20480:   14626816:
  22:  4073472.. 4075519:   14667776..  14669823:   2048:   14661632:
  23:  4075520.. 4077567:   14671872..  14673919:   2048:   14669824:
  24:  4077568.. 4079615:   14675968..  14678015:   2048:   14673920:
  25:  4079616.. 4083711:   14663680..  14667775:   4096:   14678016:
  26:  4083712.. 4085759:   30760960..  30763007:   2048:   14667776:
  27:  4085760.. 4087807:   37101568..  37103615:   2048:   30763008:
  28:  4087808.. 4091903:   37109760..  37113855:   4096:   37103616:
  29:  4091904.. 4093951:    2244608..   2246655:   2048:   37113856:
  30:  4093952.. 4095999:    2250752..   2252799:   2048:    2246656: last,eof
/home/swapfile: 31 extents found

$ grep . /sys/power/resume*

/sys/power/resume:8:2
/sys/power/resume_offset:452608

The last two values are what get written upon reboot despite me changing them manually.

Offline

#10 2020-09-28 07:38:14

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 646

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

eigenstryker wrote:
nl6720 wrote:

Have you tried hibernating without using logind?

# echo disk > /sys/power/state

I had not.  I just did that and it made my screen go black for a couple seconds before returning.

Was that after you set the correct /sys/power/resume and /sys/power/resume_offset ?

eigenstryker wrote:

The last two values are what get written upon reboot despite me changing them manually.

On boot they are overwritten by the values from the kernel command line. Post your boot loader configuration and the output of:

$ cat /proc/cmdline

Offline

#11 2020-09-28 18:12:12

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

nl6720 wrote:
eigenstryker wrote:
nl6720 wrote:

Have you tried hibernating without using logind?

# echo disk > /sys/power/state

I had not.  I just did that and it made my screen go black for a couple seconds before returning.

Was that after you set the correct /sys/power/resume and /sys/power/resume_offset ?

No.  It appears that running that command with the incorrect parameters leads to the screen simply turning off and back on as I described.

With the correct parameters written, the screen blanks and the laptop shuts off within moments (with DE still running).  When I boot back up, it is like any other time I boot up; my previous session is not restored.

nl6720 wrote:
eigenstryker wrote:

The last two values are what get written upon reboot despite me changing them manually.

On boot they are overwritten by the values from the kernel command line. Post your boot loader configuration and the output of:

$ cat /proc/cmdline

Output of # cat /boot/grub/grub.cfg :

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  6a3faece-fa53-4cac-ad19-511cb7ceb84b
else
  search --no-floppy --fs-uuid --set=root 6a3faece-fa53-4cac-ad19-511cb7ceb84b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6a3faece-fa53-4cac-ad19-511cb7ceb84b' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  6a3faece-fa53-4cac-ad19-511cb7ceb84b
	else
	  search --no-floppy --fs-uuid --set=root 6a3faece-fa53-4cac-ad19-511cb7ceb84b
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b rw  quiet resume=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b resume_offset=452608
	echo	'Loading initial ramdisk ...'
	initrd  /boot/intel-ucode.img /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-6a3faece-fa53-4cac-ad19-511cb7ceb84b' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-6a3faece-fa53-4cac-ad19-511cb7ceb84b' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  6a3faece-fa53-4cac-ad19-511cb7ceb84b
		else
		  search --no-floppy --fs-uuid --set=root 6a3faece-fa53-4cac-ad19-511cb7ceb84b
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b rw  quiet resume=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b resume_offset=452608
		echo	'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-6a3faece-fa53-4cac-ad19-511cb7ceb84b' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  6a3faece-fa53-4cac-ad19-511cb7ceb84b
		else
		  search --no-floppy --fs-uuid --set=root 6a3faece-fa53-4cac-ad19-511cb7ceb84b
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b rw  quiet resume=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b resume_offset=452608
		echo	'Loading initial ramdisk ...'
		initrd  /boot/intel-ucode.img /boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Output of # cat /proc/cmdline :

BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b rw quiet resume=UUID=6a3faece-fa53-4cac-ad19-511cb7ceb84b resume_offset=452608

I notice that the resume parameters printed above do not match what I have explicitly written at /etc/default/grub :

# cat /etc/default/grub
#
# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=3227d5ae-809e-431c-93f9-ea5f19c2f05b resume_offset=7018495"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

Last edited by eigenstryker (2020-09-28 18:14:10)

Offline

#12 2020-09-28 19:48:56

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 646

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

eigenstryker wrote:

When I boot back up, it is like any other time I boot up; my previous session is not restored.

That's because the boot loader is configured with incorrect resume* kernel parameters.

eigenstryker wrote:

I notice that the resume parameters printed above do not match what I have explicitly written at /etc/default/grub

I'll make an educated guess. You missed the note in https://wiki.archlinux.org/index.php/GR … d_grub.cfg .

Last edited by nl6720 (2020-09-28 19:49:49)

Offline

#13 2020-09-28 20:43:45

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

nl6720 wrote:
eigenstryker wrote:

I notice that the resume parameters printed above do not match what I have explicitly written at /etc/default/grub

I'll make an educated guess. You missed the note in https://wiki.archlinux.org/index.php/GR … d_grub.cfg .

Success!!!  That was it.  Somewhere along the way I had generated an initial ramdisk environment; I think what I was really supposed to do/meant to do was generate the main GRUB configuration file, as the note points out.

Thank you so much, nl6720.  Finally getting this issue solved just made my afternoon.

Offline

#14 2020-09-28 21:01:31

eigenstryker
Member
From: Seattle, Washington
Registered: 2018-02-16
Posts: 17

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

Summary of how my problem got solved:

  • Enlarged the swapfile (probably unnecessary)

  • Used

    # systemctl edit systemd-logind.service

    and inserted the text

    [Service]       
    Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1

    as suggested at https://github.com/systemd/systemd/issues/15354.

  • Regenerated the grub configuration file with

    # grub-mkconfig -o /boot/grub/grub.cfg

Offline

#15 2020-09-29 18:16:25

mpan
Member
Registered: 2012-08-01
Posts: 1,332
Website

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

eigenstryker wrote:

Enlarged the swapfile (probably unnecessary)

Just to make it clear: yes, in this case this wasn’t neccessary.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#16 2024-01-27 02:28:16

somekool
Member
Registered: 2008-08-27
Posts: 25

Re: [SOLVED] Fail to hibernate "Not enough swap space for hibernation"

nl6720 wrote:

Is there anything in the journal about hibernation?
Did you set the correct resume and resume_offset kernel parameters? Do /sys/power/resume and /sys/power/resume_offset contain the correct values?

Have you tried hibernating without using logind?

# echo disk > /sys/power/state

Values are correct. The above line worked for me. It hibernate fully.

And I could resume as expected.

But hibernation through logind still complain about missing space.

I guess I will try setting the env var in the systemd setting

Edit: I have updated the service with

Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1

Still not working through systemd.



Thanks

Last edited by somekool (2024-01-27 04:12:55)

Offline

Board footer

Powered by FluxBB