All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sreyan Chakravarty <sreyan32@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: btrfs swapfile - Not enough swap space for hibernation.
Date: Thu, 10 Dec 2020 16:58:52 +0530	[thread overview]
Message-ID: <CAMaziXsqG-z029cCTd1BBn6HTm2EDLxsSocSOVs1s5RoK_Q0aQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2020-12-10 11:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 11:28 Sreyan Chakravarty [this message]
2020-12-10 19:02 ` btrfs swapfile - Not enough swap space for hibernation 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMaziXsqG-z029cCTd1BBn6HTm2EDLxsSocSOVs1s5RoK_Q0aQ@mail.gmail.com \
    --to=sreyan32@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.