You are not logged in.

#1 2020-01-09 20:34:48

jones
Member
Registered: 2013-03-14
Posts: 276

[S]Why does hibernation power off my laptop? (sd-encrypt, LVM on LUKS)

When I close the laptop's lid and it should go into hibernation per XFCE's energy settings, it shuts off completely as it is short-circuited.

$ cat /etc/fstab

# /dev/mapper/MyVolGroup-root
/dev/mapper/MyVolGroup-root	/	ext4	rw,noatime,discard	0 1

# /dev/mapper/MyVolGroup-home 
/dev/mapper/MyVolGroup-home	/home	ext4	rw,noatime,discard	0 2

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

# /dev/mapper/MyVolGroup-swap    
/dev/mapper/MyVolGroup-swap	none	swap	defaults  	0 0

$ cat /etc/crypttab

# home
home	/dev/MyVolGroup/home
# swap
swap	/dev/MyVolGroup/swap	/dev/urandom	swap,cipher=aes-xts-plain64,size=256

$ free -h

              gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
Speicher:        15Gi       988Mi        13Gi       258Mi       790Mi        13Gi
Swap:          15Gi          0B        15Gi

$ cat /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 systemd autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 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_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Why doesn't it work? sad

(On another matter, I just realized I have the discard option in the fstab. I edited it out between generating the output and posting this here.)

Last edited by jones (2020-01-09 21:28:56)

Offline

#2 2020-01-09 20:41:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [S]Why does hibernation power off my laptop? (sd-encrypt, LVM on LUKS)

Did you read the note on the wiki?

Note: To check how systemd-logind handles events whenever it has precedence over Xfce, check logind.conf(5)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-01-09 21:06:00

jones
Member
Registered: 2013-03-14
Posts: 276

Re: [S]Why does hibernation power off my laptop? (sd-encrypt, LVM on LUKS)

I have now. Everything is commented out. Do I have to set "HandleLidSwitch=hibernate"?

edit
Oh. I just noticed, that I should have had named the resume device in the loader config. I will do that now.

Last edited by jones (2020-01-09 21:09:31)

Offline

#4 2020-01-09 21:09:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [S]Why does hibernation power off my laptop? (sd-encrypt, LVM on LUKS)

Only if XFCE respects that setting. It may be worth a shot, but I don't know how XFCE works...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2020-01-09 21:28:37

jones
Member
Registered: 2013-03-14
Posts: 276

Re: [S]Why does hibernation power off my laptop? (sd-encrypt, LVM on LUKS)

Solved it, it works now. Kind of an odd impression when it looks like it boots up again but the empty geany window from before was still there.

Steps I took:

  1. As stated in the edit of my last post, I edited the config file for the bootloader (systemd-boot). In the options line, I added "resume=UUID=123123" with 123123 being the swap's UUID which I got by running the command "blkid".

  2. I commented out the dash/hashtag before "HandleLidSwitch" and replaced the 'suspend' with 'hibernate' in /etc/systemd/logind.conf.

  3. I set the dropdown menu in XFCE's energy options to hibernate on closing the lid as well (as opposed to suspend, screenlock or turning off the display).

Last edited by jones (2020-05-19 09:59:36)

Offline

Board footer

Powered by FluxBB