Btrfs hibernation script
mkdir -p ~/.gc && cd ~/.gc && git clone --quiet https://github.com/pietryszak/fedora-hibernation.git && cd fedora-hibernation && chmod +x hibernation.sh after-restart.sh
sudo sed -i 's/sudo fallocate --length 96GiB /swap/swapfile/sudo fallocate --length YOUR_SWAP_FILE_GiB /swap/swapfile/g' ~/.gc/fedora-hibernation/hibernation.sh && ./hibernation.sh
RAM | Swap size (With Hibernation) |
---|---|
⩽ 2 GB | 3 times the amount of RAM |
> 2 GB – 8 GB | 2 times the amount of RAM |
> 8 GB – 64 GB | 1.5 times the amount of RAM |
> 64 GB | Hibernation not recommended |
sh -c ~/.gc/fedora-hibernation/after-restart.sh
Based on @jorp solution and information on this gist provided by @eloylp and comment by @miXwui.