Hibernation on Manjaro/ArchLinux

If you ever wanted to enable disk hibernation on Manjaro/ArchLinux and forgot the required steps to accomplish it:

  1. Enable swap (either a disk partition or a swapfile) - https://wiki.manjaro.org/index.php?title=Swap
  2. Edit /etc/mkinitcpio.conf and add "resume" hook
  • HOOKS="base udev autodetect modconf block resume keyboard keymap consolefont filesystems fsck"
  1. Edit /etc/default/grub and add kernel parameter(s) on line containing "GRUB_CMDLINE_LINUX_DEFAULT"
  • GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=<UUID for swap partition> resume_offset=<offset if is a swapfile> <...>"
  • (if using a swapfile, the UUID for partition containing the swapfile can be resolved with command findmnt -no UUID -T /swapfile
  • (the resume offset is required if using a swapfile. It can be resolved using command filefrag -v /swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
  1. Rerun mkinitcpio
  • sudo mkinitcpio -p linux # or mkinitcpio -p linux515 on manjaro
  1. Regenerate grub.cfg
  • sudo grub-mkconfig -o /boot/grub/grub.cfg
  1. Reboot and then test hibernation
  • sudo systemctl hibernate