Enable hibernation swapfile in LinuxMint 22 3
-------------------------------------------------------------------------
Please support my work here: paypal.me/mrstanlez305 ($5 or 5€) Thank you.
Hibernation & swapfile enabled
// Stop swap
sudo swapoff /swapfile
// Create file (Example for 16GB RAM = 20G)
sudo fallocate -l 20G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
// Start swap
sudo swapon /swapfile
// Find Swapfile UUID
findmnt -no UUID -T /swapfile
// Find offset
sudo filefrag -v /swapfile | awk '{if($1=="0:"){print $4}}' | sed 's/\.\.//g'
// Update Grub
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="resume
=UUID=65a99dd4-99ab-4ad4-a214-74b2e29d6381 resume_offset=13234176"
sudo update-grub
// Setup swappiness
sudo nano /etc/sysctl.d/local.conf
wm.swappiness=1
// Setup partition (Editor nano Ctrl + X \(\rightarrow \) Y \(\rightarrow \) Enter
sudo nano /etc/fstab
/swapfile swap swap defaults 0 0
// Reboot PC
sudo update-initramfs -k all -u
sudo reboot
// Testing swapfile
sudo systemctl hibernate