Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Hibernating computer breaks it until reboot (Read 1181 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Hibernating computer breaks it until reboot

For some reason, if i hibernate my computer... I can't use it until i force power off, and as you may think force powering of is not a good idea...
This could be related that sometimes the keyboard breaks, and then how could i check
Code: [Select]
dmesg
, if someone has any ideas tell me, i am using
Code: [Select]
Linux art 5.12.6-artix1-1 #1 SMP PREEMPT Mon, 24 May 2021 19:02:12 +0000 x86_64 GNU/Linux

Re: Hibernating computer breaks it until reboot

Reply #1
Hibernation is working fine here. Can you explain how you set up your swap file/partitions?

Re: Hibernating computer breaks it until reboot

Reply #2
Code: [Select]
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
nvme0n1
├─nvme0n1p1 vfat   FAT32       A10E-8CAD                             965,1M     6% /boot
├─nvme0n1p2 ext4   1.0         91db28a8-34cb-4e7d-8397-ec32152947de    6,8G    72% /
└─nvme0n1p3 ext4   1.0         dbff7a71-b801-4122-9d25-b1392d4c4138    1,4T    13% /home
Also using bedrock linux
No swap configured
Code: [Select]
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p2
UUID=91db28a8-34cb-4e7d-8397-ec32152947de / ext4 rw,relatime 0 0

# /dev/nvme0n1p1
UUID=A10E-8CAD /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

# /dev/nvme0n1p3
UUID=dbff7a71-b801-4122-9d25-b1392d4c4138 /home ext4 rw,relatime 0 0

#none /proc proc realtime,nosuid,nodev,noexec,hidepid=1 0 0
#none /tmp tmpfs mode=1777,nodev,nosuid,size=6G,realtime 0 0
#none /run/shm tmpfs rw,nodev,nosuid,size=6G,realtime 0 0
#none /dev/shm tmpfs rw,nodev,nosuid,size=6G,realtime 0 0

UUID=D81CC3441CC31BFE /mnt/ssd ntfs rw,uid=1000,gid=113,user,nofail

Re: Hibernating computer breaks it until reboot

Reply #3
You (may) be out of luck:
"Hibernate" needs a swap partition to work.
"Suspend", however, should work even with no swap space configured.

Suspend freezes and conserves the RAM content and shuts down  CPU and disks.
Hibernate dumps the complete memory content to the swap partition and switches the computer off - including the RAM.

Re: Hibernating computer breaks it until reboot

Reply #4
You (may) be out of luck:
"Hibernate" needs a swap partition to work.
"Suspend", however, should work even with no swap space configured.

Suspend freezes and conserves the RAM content and shuts down  CPU and disks.
Hibernate dumps the complete memory content to the swap partition and switches the computer off - including the RAM.
I have a swapfile only that i didnt set it up on fstab because when i setted it up i where lazy

Added it to fstab.
Code: [Select]
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p2
UUID=91db28a8-34cb-4e7d-8397-ec32152947de / ext4 rw,relatime 0 0

# /dev/nvme0n1p1
UUID=A10E-8CAD /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

# /dev/nvme0n1p3
UUID=dbff7a71-b801-4122-9d25-b1392d4c4138 /home ext4 rw,relatime 0 0

#none /proc proc realtime,nosuid,nodev,noexec,hidepid=1 0 0
#none /tmp tmpfs mode=1777,nodev,nosuid,size=6G,realtime 0 0
#none /run/shm tmpfs rw,nodev,nosuid,size=6G,realtime 0 0
#none /dev/shm tmpfs rw,nodev,nosuid,size=6G,realtime 0 0

UUID=D81CC3441CC31BFE /mnt/ssd ntfs rw,uid=1000,gid=113,user,nofail
/home/swapfile swap swap defaults 0 0
If default /etc/elogind/logind.conf is setup to suspend why is it not working?

Re: Hibernating computer breaks it until reboot

Reply #5
In order to use hibernation, you need to create a swap partition or file. You will need to point the kernel to your swap using the resume= kernel parameter, which is configured via the boot loader. You will also need to configure the initramfs. This tells the kernel to attempt resuming from the specified swap in early userspace. These three steps are described in detail below.

see how to: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation

Re: Hibernating computer breaks it until reboot

Reply #6
In order to use hibernation, you need to create a swap partition or file. You will need to point the kernel to your swap using the resume= kernel parameter, which is configured via the boot loader. You will also need to configure the initramfs. This tells the kernel to attempt resuming from the specified swap in early userspace. These three steps are described in detail below.

see how to: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation
Quote from: wiki.archlinux.org
If the swap file is in /home/, systemd-logind will not be able to determine its size and thus will prevent hibernation. See systemd issue 15354 for a workaround.
Is this needed on runit?
--
I only plan to use the swap for hibernating what swapinness should i set?
I have 32564940 kB of memory, how large should i make the swapfile?

Re: Hibernating computer breaks it until reboot

Reply #7
Quote
Is this needed on runit?
no, i don't think so

If you use hibernation, then you must add swap because the content of the RAM will be written to the swap partition. This also means that the swap size should be at least the size of RAM.
-> https://itsfoss.com/swap-size/

Re: Hibernating computer breaks it until reboot

Reply #8
Cloud
Code: [Select]
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
In /etc/mkinitpcio.conf have anything related?
-- This comment was previous to alium's comment, i just got the message now.

Re: Hibernating computer breaks it until reboot

Reply #9
I have maken a 38GB swap file; ran dd, mkswap, swapon; is safe now to try to hibernate?

Re: Hibernating computer breaks it until reboot

Reply #10
I have maken a 38GB swap file; ran dd, mkswap, swapon; is safe now to try to hibernate?
More than enough, I use a 4GB partition with 32GB RAM, but I always close heavy programs and drop caches before hibernation ('echo 3 >| /proc/sys/vm/drop_caches'). I'm low on disk space though and I'm also trying to minimize SSD wear.

Re: Hibernating computer breaks it until reboot

Reply #11
More than enough, I use a 4GB partition with 32GB RAM, but I always close heavy programs and drop caches before hibernation ('echo 3 >| /proc/sys/vm/drop_caches'). I'm low on disk space though and I'm also trying to minimize SSD wear.
F because i also have a ssd

 

Re: Hibernating computer breaks it until reboot

Reply #12
I dont think is that needed for me so [CLOSED]