Created
November 10, 2022 08:13
-
-
Save greenrobot/869b0a29a68681abc85e6e1f5bf903d1 to your computer and use it in GitHub Desktop.
Hibernate Linux (Ubuntu 22.04) with freeing caches before
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
free -h | |
echo "Pruning caches..." | |
sync | |
echo 3 | sudo tee /proc/sys/vm/drop_caches | |
free -h | |
echo "Hibernating..." | |
sudo systemctl hibernate | |
# Seeting up hibernate via swapfile: | |
# Increase swapfile size (https://askubuntu.com/a/1264577/75764) | |
# swapon --show | |
# sudo swapoff /swapfile | |
# sudo dd if=/dev/zero of=/swapfile bs=1M count=73728 # 72 GB | |
# mkswap /mnt/swapfile | |
# sudo swapon /swapfile | |
# | |
# https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/ | |
# findmnt -no UUID -T /swapfile | |
# # cfbd6c20-6bbc-478a-8e17-93da3f961c83 | |
# sudo filefrag -v /swapfile |grep " 0:"| awk '{print $4}' | |
# # 15751852.. | |
# sudo gedit /etc/default/grub # add uuid and offset | |
# sudo update-grub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment