Added new post.

This commit is contained in:
frnmst/Franco Masotti 2017-10-23 19:31:51 +02:00
parent 1993487e49
commit 13e00269fb
1 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,70 @@
title: How to enable hibernation in three simple steps
tags: [hibernation, parabola, systemd, mkinitcpio, syslinux]
updated: 2017-10-22 18:30
description: How to enable hibernation on systemd and mkinitcpio-based systems
Greetings to all,
It has been some time since I needed to enable hibernation on my machine so
that I could find all my stuff exacly as I left it the previous time. This
is especially useful to me since I usually leave multiple terminals opened. So,
untill recently, I suspended instead of hibernate, but that is not
always practical.
What follows is a summary of instuctions I gathered from
and it reflects my use case and configuration.
## Prerequisites
- A swap partition with size >= RAM size.
- Systemd
- mkinitcpio
- A bootloader that supports kernel parameters.
## Step 1
Get the UUID of your swap partition.
# UUID="$(blkid | grep swap | awk '{print $2}' | tr -d "\"")"
## Step 2
Edit the `/etc/mkinitcpio.conf` file to include `resume` after `udev` in the
`HOOKS` section. This is how mine looks:
HOOKS="base udev mdadm_udev lvm2 resume autodetect modconf block filesystems keyboard fsck"
Then we must regenerate the ramdisk environment (please get the
correct kernel names first). For example:
# mkinitcpio -p linux-libre
# mkinitcpio -p linux-libre-lts
## Step 3
Copy the variable you gathered earlier.
$ echo $UUID
Append the `resume` kernel parameter to your bootloader configuration. For
example, this would be a modified Syslinux entry to accomodate the new
LABEL <some label>
MENU LABEL <some value>
LINUX <some other value>
APPEND <yet again other values> resume=<paste the $UUID variable here>
INITRD <and again>
## Testing
$ systemctl hibernate
That's it.