Swapfile created. System not Hibernating

I have created a hibernate swapfile under /home/ with exactly 64gb and then 68gb.
Root does not have space for 64gb swapfile.

64gb swapfile freezes system for a while and then gets back to normal.
68gb does nothing on clicking.
Now hibernate option doesn’t appear.

The steps apply to ext4 right? /home/ is etx4.

I went through some old manjaro threads and other google stuff but no clear solution.

Does what this peer says make sense to you?

Should i follow the steps in this arch article? Power management/Suspend and hibernate - ArchWiki

Following that wiki will likely solve your problems.

The arch wiki?

Manjaro’s wiki should maybe be updated.

Most of the time the Arch wiki will work when you need info.

Rule of thumb should be to follow manjaro wiki 1st and then if it does not work, arch?

Or always arch?

The manjaro wiki is easier to understand a lot of the time, and sometimes has commands that are manjaro specific. But in the end they mostly have the same info, up to you.

Well in this case i will follow manjaro 1st. And then if needed arch :slight_smile:
Thanks for chiming in! :pray:

yes!

… but you decided to put your swap file not under / but somewhere under /home instead.

/etc/fstab needs to reflect this
and if /home is a different partition - this might necessitate further adjustments to the grub parameters in /etc/default/grub

Show (not tell) what you have got.
provide the info that only you have
… file contents, machine info, partition info …
inxi -Fazy for instance
and … current file contents …

/etc/mkinitcpio.conf - especially the HOOKS line in it
/etc/default/grub
/etc/fstab
lsblk -f

My root partition is 64gb size only. No space for the swap file!
If the best approach is to grow the root partition i’ll do that!
Otherwise I prefer to do extra tweaks to make the swapfile work under /home.

inxi -Fazy                                                                            ✔ 
System:
  Kernel: 5.19.1-3-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.19-x86_64
    root=UUID=ece9fde4-aa4e-441d-8ef7-db685b9c348e rw
    resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1 quiet
    resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1 udev.log_priority=3
    nowatchdog
  Desktop: KDE Plasma v: 5.24.6 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Dell product: Precision 5540 v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Dell model: 03DYVY v: A00 serial: <superuser required> UEFI: Dell
    v: 1.17.0 date: 04/19/2022
Battery:
  ID-1: BAT0 charge: 81.6 Wh (100.0%) condition: 81.6/97.0 Wh (84.1%)
    volts: 12.6 min: 11.4 model: SMP DELL GPM0365 type: Li-ion serial: <filter>
    status: full
CPU:
  Info: model: Intel Xeon E-2276M bits: 64 type: MT MCP arch: Coffee Lake
    level: v3 built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158)
    stepping: 0xD (13) microcode: 0xF0
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 1801 high: 2800 min/max: 800/4700 scaling:
    driver: intel_pstate governor: powersave cores: 1: 822 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 2800 8: 2800 9: 2800 10: 2800 11: 2800 12: 2800
    bogomips: 67226
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: Split huge pages
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort mitigation: TSX disabled
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Dell
    driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
    ports: active: DP-4,DP-5 off: eDP-1 empty: DP-1, DP-2, DP-3, DP-6
    bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA TU117GLM [Quadro T2000 Mobile / Max-Q] vendor: Dell
    driver: nouveau v: kernel non-free: 515.xx+ status: current (as of 2022-08)
    arch: Turing code: TUxxx process: TSMC 12nm built: 2018-22 pcie: gen: 3
    speed: 8 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1fb8 class-ID: 0302
  Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo
    bus-ID: 1-12:8 chip-ID: 0c45:6723 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 compositor: kwin_x11 driver: X:
    loaded: modesetting alternate: fbdev,vesa gpu: i915 display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 3840x1200 s-dpi: 96 s-size: 1014x317mm (39.92x12.48")
    s-diag: 1062mm (41.83")
  Monitor-1: not-matched mapped: DP-1-1 pos: primary,left res: 1920x1200
    hz: 60 dpi: 94 size: 518x324mm (20.39x12.76") diag: 611mm (24.05")
    modes: N/A
  Monitor-2: not-matched mapped: DP-1-2 pos: primary,right res: 1920x1080
    hz: 60 dpi: 102 size: 477x268mm (18.78x10.55") diag: 547mm (21.54")
    modes: N/A
  Monitor-3: eDP-1 note: disabled model: Sharp 0x14ba built: 2019
    res: 1920x1080 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: 1920x1080
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 22.1.6
    direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel
    v: kernel bus-ID: 1-5.3.4:11 alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    chip-ID: 0bda:402e class-ID: 0102 bus-ID: 00:1f.3 chip-ID: 8086:a348
    serial: <filter> class-ID: 0403
  Device-2: Realtek USB Audio type: USB driver: snd-usb-audio
  Sound Server-1: ALSA v: k5.19.1-3-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: yes
  Sound Server-4: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Intel Wireless-AC 9260 driver: iwlwifi v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 3b:00.0 chip-ID: 8086:2526 class-ID: 0280
  IF: wlp59s0 state: down mac: <filter>
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152
    bus-ID: 4-1.4:4 chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
  IF: enp58s0u1u4 state: up speed: 100 Mbps duplex: full mac: <filter>
  IF-ID-1: vboxnet0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Wireless-AC 9260 Bluetooth Adapter type: USB driver: btusb
    v: 0.8 bus-ID: 1-4:4 chip-ID: 8087:0025 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 953.87 GiB used: 687.19 GiB (72.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: SK Hynix model: PC601A NVMe 1TB
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: 80001111 temp: 35.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 62.5 GiB size: 61.22 GiB (97.95%) used: 34.79 GiB (56.8%)
    fs: ext4 dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-2: /boot/efi raw-size: 512.8 MiB size: 511.7 MiB (99.80%) used: 316 KiB
    (0.1%) fs: vfat dev: /dev/nvme0n1p4 maj-min: 259:4
  ID-3: /home raw-size: 191 GiB size: 186.94 GiB (97.87%) used: 110.4 GiB
    (59.1%) fs: ext4 dev: /dev/nvme0n1p7 maj-min: 259:7
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 68.36 GiB used: 0 KiB (0.0%) priority: -2
    file: /home/swapfile
Sensors:
  System Temperatures: cpu: 42.0 C pch: 48.0 C mobo: 35.0 C gpu: nouveau
    temp: 27.0 C
  Fan Speeds (RPM): cpu: 2388 fan-2: 2384
Info:
  Processes: 315 Uptime: 1h 13m wakeups: 4 Memory: 62.44 GiB used: 10.06 GiB
  (16.1%) Init: systemd v: 251 default: graphical tool: systemctl Compilers:
  gcc: 12.1.1 clang: 14.0.6 Packages: 1673 pm: pacman pkgs: 1643 libs: 442
  tools: pamac,yay pm: flatpak pkgs: 16 pm: snap pkgs: 14 Shell: Zsh v: 5.9
  default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.21

/etc/mkinitcpio.conf

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=""

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS="base udev resume autodetect modconf block keyboard keymap consolefont resume filesystems fsck"

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
#COMPRESSION="zstd"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

# MODULES_DECOMPRESS
# Decompress kernel modules during initramfs creation.
# Enable to speedup boot process, disable to save RAM
# during early userspace. Switch (yes/no).
#MODULES_DECOMPRESS="yes"

/etc/default/grub

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1 udev.log_priority=3 nowatchdog"
GRUB_CMDLINE_LINUX="resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1"

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y

# 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 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 'videoinfo'
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 this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

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

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

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

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

/etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=AC41-CD02                            /boot/efi      vfat    umask=0077 0 2
# UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1 swap           swap    defaults,noatime 0 0
UUID=ece9fde4-aa4e-441d-8ef7-db685b9c348e /              ext4    defaults,noatime 0 1
UUID=32a01f29-852c-43f0-8b05-9b57ed038190 /home          ext4    defaults,noatime 0 2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

/home/swapfile none swap defaults 0 0

lsblk -f

lsblk -f                                                                          127 ✘ 
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                    0   100% /var/lib/snapd/snap/core18/2538
loop1
     squash 4.0                                                    0   100% /var/lib/snapd/snap/acrordrdc/62
loop2
     squash 4.0                                                    0   100% /var/lib/snapd/snap/core/13425
loop3
     squash 4.0                                                    0   100% /var/lib/snapd/snap/bare/5
loop4
     squash 4.0                                                    0   100% /var/lib/snapd/snap/core20/1611
loop5
     squash 4.0                                                    0   100% /var/lib/snapd/snap/gnome-3-28-1804/161
loop6
     squash 4.0                                                    0   100% /var/lib/snapd/snap/gnome-3-38-2004/115
loop7
     squash 4.0                                                    0   100% /var/lib/snapd/snap/gtk-common-themes/1535
loop8
     squash 4.0                                                    0   100% /var/lib/snapd/snap/notepad-plus-plus/369
loop9
     squash 4.0                                                    0   100% /var/lib/snapd/snap/notepad-plus-plus/372
loop10
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-6-stable/19
loop11
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-7-devel-core20/17
loop12
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-runtime/315
loop13
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-runtime/316
loop14
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-runtime-core20/35
loop15
     squash 4.0                                                    0   100% /var/lib/snapd/snap/wine-platform-runtime-core20/34
loop16
                                                                   0   100% /var/lib/snapd/snap/core18/2560
nvme0n1
                                                                            
├─nvme0n1p1
│    vfat   FAT32       1C88-56D1                                           
├─nvme0n1p2
│    ntfs               28E289C4E28996AA                      155.3G    78% /run/media/user/28E289C4E28996AA
├─nvme0n1p3
│    ntfs               5E1806201805F7B3                                    
├─nvme0n1p4
│    vfat   FAT32 NO_LABEL
│                       AC41-CD02                             511.4M     0% /boot/efi
├─nvme0n1p5
│    swap   1           41b019f3-091c-4ab7-88df-be4b1cf9cee1                
├─nvme0n1p6
│    ext4   1.0         ece9fde4-aa4e-441d-8ef7-db685b9c348e   23.3G    57% /
└─nvme0n1p7
     ext4   1.0         32a01f29-852c-43f0-8b05-9b57ed038190     67G    59% /home

resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1

in:

/etc/default/grub
in:

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=41b019f3-091c-4ab7-88df-be4b1cf9cee1 udev.log_priority=3 nowatchdog"

What UUID is this? What disk does it refer to?

None of your disks (in /etc/fstab) match this one.

This obviously can’t work.
And, for a swap file, you also need to give “resume_offset= ...” in the same line.

What that UUID actually refers to is a swap partition that you have (with no size info I can glean from
lsblk -f ) is:

─nvme0n1p5
│    swap   1           41b019f3-091c-4ab7-88df-be4b1cf9cee1

your current configuration appears to be pretty messy - it’s all over the place

Get rid of that swap partition - you are still using it (to resume from) in GRUB config instead of your swap file.

This is the original swap partition of 2GB. I followed a manjaro tutorial and did not realize i needed 64gb partition for the hibernate.
I commented it in fstab so the swapfile takes over.

In fstab?

Done!

Should be like this?

---fstab file---
resume_offset= /home/swapfile none swap defaults 0 0

---grub file---
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=/home/swapfile udev.log_priority=3 nowatchdog"
GRUB_CMDLINE_LINUX="resume=/home/swapfile"

No!

I’m too tired to give sound advice.

The best thing - and what you should do - is:
start over
reading the wiki, taking a methodical, structured approach.

All I could do here is rehashing what is described, in detail, in the wiki.

Perhaps I will even do that - but certainly not today.

resume=

belongs in /etc/default/grub
and it refers to the partition the swap file is on

resume_offset= ...
is the physical location of the swap file in that partition - it also belongs in /etc/default/grub

What you do not need or want anymore, anywhere, is:
any reference to your old swap partition

… and then a picture of the deleted swap partition

This is not what I meant - you still had it referenced in /etc/default/grub
as the partition to resume from
instead of the swap file
that you actually wanted to use.

Got it! I’ll read the arch wiki carefully.

This /etc/fstab was o.k.:

This is how /etc/default/grub should look like:

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=32a01f29-852c-43f0-8b05-9b57ed038190 resume_offset=xxx quiet udev.log_priority=3 nowatchdog"
GRUB_CMDLINE_LINUX=""

...

explanation:

resume=UUID=32a01f29-852c-43f0-8b05-9b57ed038190

is the UUID of your /home partition, were you decided to put your swap file
this tells the system to resume from that partition - where the swap file is

You then only need to fill in the:
resume_offset=xxx
the physical location of that swap file on that partition

You know how to find that - filefrag ...

You need the swap file to be about as large as the amount of RAM you have - because the RAM contents are written to the swap file when hibernating
and it of course needs to fit in.

HTH

I don’t know whether that will or can work
because /home is (and needs to be) mounted to /
/ is mounted first - then /home to it
I would not be surprised if trying to resume from /home while / wasn’t already mounted
would not work.