This guide is based on the hibernate article from the Arch wiki.
- edit
/etc/default/gruband addresumeas well asresume_offsetkernel parametersresume=UUID=abcd-efghcontains the UUID of the partition on which the swapfile resides. In most cases theswapfileresides inroot, to identify therootparition's UUID runblkidorlsblk -O.resume_offset=1234is the offset of the swapfile from the partition start. The offset is the first entry in thephysical_offsetcolumn of the output offilefrag -v /swapfile.- update grub:
grub-mkconfig -o /boot/grub/grub.cfg - example:
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=75972c96-f909-4419-aba4-80c1b74bd605 resume_offset=1492992"
- add the
resumemodule hook to/etc/mkinitcpio.conf:HOOKS="base udev resume autodetect ...
- rebuild the initramfs
mkinitcpio -p linux