I've created a Swap file, can't hibernate

swapfile

#1

Hello everyone. I’ve followed this guide to get a swap file (I don’t have a swap partition) to get a dedicated swap file, but when I click on “hibernate” in the KDE start menu it just log out.
The “suspend on RAM” works without any problem.

System:    Host: greenbarbers-desktop Kernel: 4.15.18-3-MANJARO x86_64 bits: 64 compiler: gcc v: 8.1.1 
           Desktop: KDE Plasma 5.12.5 tk: Qt 5.11.0 dm: sddm Distro: Manjaro Linux 17.1.10 Hakoila 
Machine:   Type: Desktop Mobo: ASRock model: Z77 Extreme4 serial: <filter> UEFI: American Megatrends v: P2.90 
           date: 07/11/2013 
CPU:       Topology: Quad Core model: Intel Core i5-3570K bits: 64 type: MCP arch: Ivy Bridge rev: 9 
           L2 cache: 6144 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 27200 
           Speed: 1601 MHz min/max: 1600/3800 MHz Core speeds (MHz): 1: 1600 2: 1600 3: 1600 4: 1600 
Graphics:  Card-1: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:0162 
           Card-2: Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] 
           driver: radeon v: kernel bus ID: 01:00.0 chip ID: 1002:6798 
           Display: x11 server: X.Org 1.19.6 driver: ati,intel,radeon unloaded: fbdev,modesetting,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: AMD TAHITI (DRM 2.50.0 4.15.18-3-MANJARO LLVM 6.0.0) v: 4.5 Mesa 18.1.1 
           compat-v: 3.1 direct render: Yes 
Audio:     Card-1: Intel 7 Series/C216 Family High Definition Audio driver: snd_hda_intel v: kernel 
           bus ID: 00:1b.0 chip ID: 8086:1e20 
           Card-2: Advanced Micro Devices [AMD/ATI] Tahiti HDMI Audio [Radeon HD 7870 XT / 7950/7970] 
           driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 1002:aaa0 
           Card-3: Samson GoMic compact condenser mic type: USB driver: snd-usb-audio bus ID: 6:4 
           chip ID: 17a0:0305 
           Sound Server: ALSA v: k4.15.18-3-MANJARO 
Network:   Card-1: Broadcom Limited NetLink BCM57781 Gigabit Ethernet PCIe driver: tg3 v: 3.137 port: N/A 
           bus ID: 04:00.0 chip ID: 14e4:16b1 
           IF: enp4s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:    HDD Total Size: 3.87 TiB used: 593.01 GiB (15.0%) 
           ID-1: /dev/sda vendor: Crucial model: CT256MX100SSD1 size: 238.47 GiB speed: 6.0 Gb/s 
           serial: <filter> rev: MU01 scheme: GPT 
           ID-2: /dev/sdb vendor: Seagate model: ST1000LM048-2E7172 size: 931.51 GiB speed: 6.0 Gb/s 
           serial: <filter> rev: SDM1 scheme: GPT 
           ID-3: /dev/sdc type: USB vendor: Seagate model: ST3000DM003-1F216N size: 2.73 TiB serial: <filter> 
           rev: 0202 scheme: MBR 
Partition: ID-1: / size: 116.57 GiB used: 20.93 GiB (18.0%) fs: ext4 dev: /dev/sda5 
Sensors:   System Temperatures: cpu: 61.0 C mobo: N/A gpu: radeon temp: 55 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 171 Uptime: 50m Memory: 7.68 GiB used: 1.61 GiB (20.9%) Init: systemd v: 238 Compilers: 
           gcc: 8.1.1 Shell: bash v: 4.4.19 running in: konsole inxi: 3.0.10 

This is my fstab file

# /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=F873-DA23                            /boot/efi      vfat    defaults,noatime 0 2
UUID=765119d4-f0b1-4a65-a9f2-bbed7b40a850 /              ext4    defaults,noatime,discard 0 1
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
/swapfile   none    swap    defaults    0   0


#2

Try with another kenrel, either 4.14 that is LTS, or newer like 4.16 or 4.17
The 4.15 kernel you are using is EOL (end of life) … Also i don’t know how hibernate works on dual GPU Intel + AMD … and how you setup your bios, if is S1(POS) or S3(STR) …


#3

More actions are required for Hibernation. The swap file is… a swap file!
Add resume to /etc/mkinitcpio.conf

HOOKS=(base udev resume autodetect

More to /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=YourUUID resume_offset=34816"

Read here for how you find the offset value.

Of course, after all these

sudo mkinitcpio -P
sudo update-grub

#4

or use hibernator package that will do all those for you …


#5

I’ve tried to use hibernator but it didn’t worked. Now at startup I have:

    ERROR: resume: no device specified for hibernation

#6

I can’t say why is doing that, then better yet follow the tutorial by @petsam
Get the UUID from fstab (eventually)


#7

You man… You’re a GENIUS!!!
Thank you so much!!! It’s working flawlessly now.

Before I’ve tried hibernator, but it failed.


closed #8

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.