You are not logged in.

#1 2022-07-21 23:17:32

infoslaw
Member
From: Poland, Warsaw
Registered: 2013-05-06
Posts: 128

Enable hibernation with encrypted partition.

Hi,

I need your help guys with this sensitive point to turn on hibernation. Here is my scenario.

I have 3 partitions:

/dev/nvme0n1p3        Boot             Primary       260MB                  83 Linux
/dev/nvme0n1p3	                       Primary       8GB                      82 Linux swap / Solaris
/dev/nvme0n1p2	                       Primary       (rest of space)      83 Linux

Partition /dev/nvme0n1p2 with system files and home folder is encrypted and call /dev/mapper/cryptroot: UUID="17efc79a-b6be-4b6d-9b7b-4504d2e49e33"
Swap partition /dev/nvme0n1p3 is NOT encrypted.

so my current Grub settings (/etc/default/grub) are:

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=6047eb7e-607e-4927-ad5b-3edcb652a086:cryptroot root=/dev/mapper/cryptroot"

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

So as you see encrypted partition is already in GRUB_CMDLINE_LINUX and I what I know from my previous different installation have to be added to Grub:

GRUB_CMDLINE_LINUX="resume=/dev/sdXY"

so in my case this:

GRUB_CMDLINE_LINUX="resume=/dev/nvme0n1p3"

However not sure how to add it to do not screw mty grub booting on encrypted disk
It should be something like that?

GRUB_CMDLINE_LINUX="resume=/dev/nvme0n1p3 cryptdevice=UUID=6047eb7e-607e-4927-ad5b-3edcb652a086:cryptroot root=/dev/mapper/cryptroot"

of course after that need few more steps:

- update grub
sudo grub-mkconfig -o /boot/grub/grub.cfg

- edit as root
/etc/mkinitcpio.conf

- add "resume"
# resume must be placed after ide scsi sata and/or lvm2, but before filesystem

my HOOKS are:

HOOKS=(base udev keyboard keymap autodetect modconf block encrypt filesystems fsck)

and here another questions resume before encrypt?

last step after that:

- rebuild the initial ramdisk
mkinitcpio -p linux

I appreciate your help smile

Last edited by infoslaw (2022-07-22 10:50:26)

Offline

Board footer

Powered by FluxBB