All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs swapfile - Not enough swap space for hibernation.
@ 2020-12-10 11:28 Sreyan Chakravarty
  2020-12-10 19:02 ` Chris Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Sreyan Chakravarty @ 2020-12-10 11:28 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I have a swapfile in a swap subvolume, I have used the
btrfs_map_physical script to get the resume_offset, and the swap file
was created with the +C attribute.

But when I try to do a `systemctl hibernate`
                 Not enough swap space for hibernation.

This usually happens if the resume_offset parameter is not right. But
I don't know what I am doing wrong. I have followed all the correct
steps.

My swap file is 10GB and my RAM is 8GB.

'swapon' on gives the following output:

                       NAME                  TYPE      SIZE USED PRIO
                       /dev/zram0            partition 3.8G   0B  100
                      /var/swap/fedora.swap file       10G   0B   -2

$ lsattr /var/swap/fedora.swap
---------------C---- /var/swap/fedora.swap

My layout is as follows:

toplevel (level 5)
|
|--->root
|--->swap

$ btrfs subvolume list -p /
ID 425 gen 17482 parent 5 top level 5 path root
ID 426 gen 16880 parent 5 top level 5 path swap

My kernel command line is as follows:

root=UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 ro
rootflags=subvol=root
rd.luks.uuid=luks-1136a62b-955b-4391-b9a4-b48ab11a862d
resume=/dev/disk/by-uuid/7d9dbe1b-dea6-4141-807b-026325123ad8
resume_offset=3599978


I got the resume_offset via the btrfs_map_physical.c which I got from
here : https://github.com/osandov/osandov-linux/blob/master/scripts/btrfs_map_physical.c

and then dividing the physical offset via my disk block size which is
4096, which equals the resume offset.

My fstab is as follows:

UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /
btrfs   subvol=root,x-systemd.device-timeout=0 0 0
UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /var/swap
   btrfs   subvol=swap,rw,nodatacow,noattime,nosuid,x-systemd.device-timeout=0
0 0
UUID=0e9cf655-eaef-44d6-8b5d-3f84e7449c0e /boot                   ext4
   defaults        1 2
UUID=CACC-9508          /boot/efi               vfat
umask=0077,shortname=winnt 0 2
/var/swap/fedora.swap none swap
defaults,x-systemd.requires-mounts-for=/var/swap 0 2

Other diagnostic information:

$ uname -a
Linux localhost.HPNotebook 5.8.15-301.fc33.x86_64 #1 SMP Thu Oct 15
16:58:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ btrfs --version
btrfs-progs v5.7

$ btrfs fi show
Label: 'fedora'  uuid: 7d9dbe1b-dea6-4141-807b-026325123ad8
Total devices 1 FS bytes used 100.81GiB
devid    1 size 930.00GiB used 120.02GiB path
/dev/mapper/luks-1136a62b-955b-4391-b9a4-b48ab11a862d

$ btrfs fi df /
Data, single: total=116.01GiB, used=100.38GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=2.00GiB, used=443.69MiB
GlobalReserve, single: total=112.12MiB, used=0.00B

$dmesg > dmesg.log
https://pastebin.com/raw/3Dw1JkDP


Please let me know if any further information is required.

Where am I going wrong ?
--
Regards,
Sreyan Chakravarty

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-14 10:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 11:28 btrfs swapfile - Not enough swap space for hibernation Sreyan Chakravarty
2020-12-10 19:02 ` Chris Murphy
2020-12-11 14:02   ` Sreyan Chakravarty
2020-12-12 21:52     ` Chris Murphy
2020-12-14  9:27       ` Sreyan Chakravarty
2020-12-14 10:27         ` Sreyan Chakravarty
2020-12-11 14:56   ` Sreyan Chakravarty
2020-12-11 15:15     ` Sreyan Chakravarty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.