You are not logged in.

#1 2023-05-02 11:31:19

zakrush
Member
Registered: 2023-03-20
Posts: 28

[SOLVED] Can't hibernate Not enough swap space for hibernate errror

Hello.
I can't to setup hibernation.

I have brtfs filesystem.

I get this error:

systemctl hibernate
Call to Hibernate failed: Not enough swap space for hibernation

I increase swap file to 34 GB from 24Gb but it don't help me.

Some my debug outputs:
free -h

               total        used        free      shared  buff/cache   available
Mem:            31Gi       1,8Gi        27Gi       740Mi       2,0Gi        28Gi
Swap:           33Gi          0B        33Gi

swapon --show

NAME      TYPE SIZE USED PRIO
/swapfile file  34G   0B   -2

/etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/cryptdisk
UUID=f9c9d233-99a5-4deb-a409-14279cad247b	/         	btrfs     	rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=256,subvol=/@	0 0

# /dev/nvme0n1p4
UUID=8281-BEC0      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/mapper/cryptdisk
UUID=f9c9d233-99a5-4deb-a409-14279cad247b	/home     	btrfs     	rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=257,subvol=/@home	0 0

#/swapfile
/swapfile				none		swap 				default	 0 0

/boot/loader/entries/arch.conf

title Arch Linux Zen
linux /vmlinuz-linux-zen
initrd /initramfs-linux-zen.img
options cryptdevice=UUID=c6fef343-9918-42bb-b56f-05a54fe1497b:cryptdisk root=/dev/mapper/cryptdisk rootflags=subvol=@ rw resume=UUID=c6fef343-9918-42bb-b56f-05a54fe1497b resume_offset=3763994 quiet
options ibt=off

Last edited by zakrush (2023-05-10 15:18:45)

Offline

#2 2023-05-04 05:36:06

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Somebody can help me?

Offline

#3 2023-05-04 06:20:48

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,789

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Online

#4 2023-05-04 08:55:29

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Ok.
Thanks, but I didn't have any idea what I can enable hibernation.
Yes. I all did as describe instructions.

this is my history of commands:

 sudo btrfs filesystem mkswapfile --size 34G /swapfile
 sudo swapon /swapfile
 sudo ./btrfs_map_physical /swapfile

the result of ./btrfs_map_physical /swapfile

FILE OFFSET	FILE SIZE	EXTENT OFFSET	EXTENT TYPE	LOGICAL SIZE	LOGICAL OFFSET	PHYSICAL SIZE	DEVID	PHYSICAL OFFSET
0	4096	0	regular	268435456	14335188992	268435456	1	15417319424
4096	268431360	4096	prealloc	268435456	14335188992	268435456	1	15417319424
268435456	268435456	0	prealloc	268435456	41906339840	268435456	1	44062212096
getconf PAGESIZE
4096

Offline

#5 2023-05-04 12:08:56

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,789

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Yes. I all did as describe instructions.

No, you did obviously not.

What is "./btrfs_map_physical", why does it produce completely unaligned output and where does "resume_offset=3763994" come from?

Online

#6 2023-05-04 12:55:48

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

seth wrote:

Yes. I all did as describe instructions.

No, you did obviously not.

What is "./btrfs_map_physical", why does it produce completely unaligned output and where does "resume_offset=3763994" come from?

I get it from old version of wiki
see here
https://wiki.archlinux.org/index.php?ti … did=758420

where does "resume_offset=3763994"

It is first phisical offset devided to PAGESIZE

The
btrfs inspect-internal map-swapfile -r /swapfile
has the same result:

sudo  btrfs inspect-internal map-swapfile -r /swapfile
3763994

Offline

#7 2023-05-04 13:29:52

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

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Did you create the swap file on a non-snapshotted subvolume like https://wiki.archlinux.org/title/Btrfs#Swap_file instructs?

Offline

#8 2023-05-04 14:15:16

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

wiki wrote:

Note:

  • For a stacked block device such as an encrypted container (LUKS), RAID or LVM, the resume parameter must point to the unlocked/mapped device that contains the file system with the swap file.

Offline

#9 2023-05-04 14:54:15

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

nl6720 wrote:

Did you create the swap file on a non-snapshotted subvolume like https://wiki.archlinux.org/title/Btrfs#Swap_file instructs?

I all did as describe instruction. I create snapshot file on root subvolume.
It's

rootflags=subvol=@ 
Raynman wrote:

wiki wrote:
Note:

For a stacked block device such as an encrypted container (LUKS), RAID or LVM, the resume parameter must point to the unlocked/mapped device that contains the file system with the swap file.

As I understand I'm using LUCS:

cryptsetup -y -v luksFormat /dev/nvme0n1p5

How should to be looks my loader file on start topic message?


Here is my hooks in /etc/mkinitcpio.conf

HOOKS=(base udev resume autodetect modconf encrypt keyboard keymap consolefont block filesystems fsck)

Last edited by zakrush (2023-05-05 09:14:20)

Offline

#10 2023-05-05 11:51:01

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

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

Looking at your posted fstab, the resume= parameter looks correct. A lot of people would likely use the same device specifier for both root= and resume=, but there's nothing wrong with using different ones as long as they resolve to the same block device.

Post the output of:

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

Last edited by nl6720 (2023-05-10 13:59:50)

Offline

#11 2023-05-10 06:03:55

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

nl6720 wrote:

Post the output of:

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

There is output

findmnt -no MAJ:MIN -T /swapfile
  0:25

sudo grep ./sys/power/resume*
zsh: no matches found: ./sys/power/resume*

Offline

#12 2023-05-10 06:10:49

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,789

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

sudo grep ./sys/power/resume*

grep . /sys/power/resume*

Online

#13 2023-05-10 13:05:38

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

So, sorry. I didn't see

findmnt -no MAJ:MIN -T /swapfile
  0:25

grep . /sys/power/resume*
/sys/power/resume:259:5
/sys/power/resume_offset:3763994

Offline

#14 2023-05-10 14:03:29

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

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

The resume= parameter in /boot/loader/entries/arch.conf is wrong.
I could have sworn the UUID in the resume= parameter matched with the "/" UUID in fstab when I first looked at it. I guess I can't read, shame on me. sad

Offline

#15 2023-05-10 15:08:26

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

nl6720 wrote:

The resume= parameter in /boot/loader/entries/arch.conf is wrong.
I could have sworn the UUID in the resume= parameter matched with the "/" UUID in fstab when I first looked at it. I guess I can't read, shame on me. sad

What is wrong?
I tried to reinstall swapfile. Then I set up HOOK resume between filesystems and fsck as describe arch wiki. It didn't help me.

setup resume=/swapfile in bootloader also didn't help. I get /swapfile not found error on boot

Offline

#16 2023-05-10 15:18:11

zakrush
Member
Registered: 2023-03-20
Posts: 28

Re: [SOLVED] Can't hibernate Not enough swap space for hibernate errror

I understand.
nl6720 thank you very much. I'm see error. It was incorrect UUID in bootloader.
the command

findmnt -no UUID -T /swapfile

helped me to see it.

Offline

Board footer

Powered by FluxBB