| 1 | #!/bin/bash |
| 2 | ### FROM BOOT DISK |
| 3 | # remove cryptswap entry |
| 4 | vi /etc/crypttab |
| 5 | |
| 6 | # remove swap from fstab |
| 7 | vi /etc/fstab |
| 8 | |
| 9 | # reboot into firmware, select one time boot and choose USB live installer |
| 10 | systemctl reboot --firmware |
| 11 | |
| 12 | ### BOOT FROM USB LIVE INSTALLER POP!_OS |
| 13 | # using gParted or GNOME Disks, remove your previous swap partition |
| 14 | |
| 15 | # using gParted or GNOME Disks, create a new swap partition at the end of your disk that is your total RAM + 2GB |
| 16 | # I have 32GB of RAM, I created a 35GB swap partition |
| 17 | |
| 18 | # reboot back to boot disk |
| 19 | systemctl reboot |
| 20 | |
| 21 | ### FROM BOOT DISK |
| 22 | # add swap partition to fstab >> '/dev/nvme0n1p4 swap swap defaults 0 0' |
| 23 | vi /etc/fstab |
| 24 | |
| 25 | # enable swap |
| 26 | swapon --all --verbose |
| 27 | |
| 28 | # add boot option for kernel to know where hibernation needs to be resumed from. |
| 29 | blkid | grep swap |
| 30 | kernelstub -a 'resume=UUID=f44f6cb9-8bab-4ab8-99fb-c409ad6e9668' |
| 31 | |
| 32 | # enable a suspend then hibernate, defaults to two hours of suspend2ram followed by a hibernation |
| 33 | ln -s /usr/lib/systemd/system/systemd-suspend-then-hibernate.service /etc/systemd/system/systemd-suspend.service |
curiouser / suspend-then-hibernate.sh
Last active 3 days ago
Pop!_OS 20.10 galp5 Suspend then hibernate
Revision 3131f8ff81410f577df7271886961ef963bfc0e6