38 lines
870 B
Markdown
38 lines
870 B
Markdown
# Enable hibernation
|
|
|
|
Run this command to get required **swap size** in **KiB** and then create the swap partition.
|
|
```sh
|
|
echo $(($(cat /proc/meminfo | awk '/MemTotal/ {print $2}')+5000))
|
|
```
|
|
|
|
If you dont need it, disable Fedora's ZRAM.
|
|
```sh
|
|
sudo dnf remove zram-generator-defaults
|
|
```
|
|
|
|
# Swap
|
|
|
|
Disable all used swaps.
|
|
```sh
|
|
sudo swapoff -a
|
|
```
|
|
|
|
Get swap partition UUID, add it to the fstab and enable swap.
|
|
```sh
|
|
sudo blkid /dev/sda3
|
|
```
|
|
```sh
|
|
echo 'UUID=56a260a8-5a66-40db-bcb6-701f72a890bb none swap sw 0 0' | sudo tee -a /etc/fstab
|
|
sudo swapon -a
|
|
```
|
|
|
|
# Grub
|
|
|
|
Get swap partition UUID and physical offset and edit GRUB's config in `/etc/default/grub`.
|
|
|
|
Add `resume=UUID=56a260a8-5a66-40db-bcb6-701f72a890bb` to `GRUB_CMDLINE_LINUX_DEFAULT`.
|
|
|
|
Regenerate grub config and hibernation should be possible.
|
|
```sh
|
|
sudo grub2-mkconfig -o "$(readlink -e /etc/grub2.conf)"
|
|
``` |