四步实现swapfile休眠
一、获取swapfile所在分区的UUID
blkid
然后找到swapfile所在分区的UUID(不能是swapfile的UUID)
二、获取offset
filefrag /mnt/swapfile
第一行 ,physical offset 左边一列的数字就是需要的offset
三、编辑/etc/initramfs-tools/conf.d/resume
resume=UUID=cdXX--X18 resume_offset=66050"
编辑/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=cdXX--X18 resume_offset=66050"
第四步
update-grub
update-initramfs -u
然后就是测试了