Skip to content
Syed Sayem edited this page May 25, 2019 · 2 revisions

In order to use hibernation, you need to configure bootloader and initramfs,

 

Run the following command to display swap partition:

$ swapon --show
NAME      TYPE      SIZE USED PRIO
/dev/sdc3 partition  38G   0B   -2

 

Confgiure your boot loader

$ sudo nano /etc/default/grub

Find the line containing GRUB_CMDLINE_LINUX_DEFAULT="quite" and insert resume=/dev/sdc3 inside the double-quote

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=/dev/sdc3"

Now save and exit file by pressing Ctrl-x + Enter

 

Regenerate grub config

Run sudo grub-mkconfig -o /boot/grub/grub.cfg to generate grub config.

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

 

Configure the initramfs

COnfigure the initramfs config with the following command:

 sudo nano /etc/mkinitcpio.conf

Find the line that looks like this: HOOKS="base udev autodetect modconf block filesystems keyboard fsck". It is located in the section named HOOKS.

After filesystems insert hook resume

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

Now save and exit file by pressing Ctrl-x + Enter

 

Regenerate the initramfs

Run mkinitcpio -p linux to generate initramfs.

sudo mkinitcpio -p linux

Now you can use systemctl hibernate to hibernate!

Clone this wiki locally