https://wiki.archlinux.org/index.php/Uswsusp

Step A:

install https://aur.archlinux.org/packages/us/uswsusp-git/uswsusp-git.tar.gz

tar zxf uswsusp-git.tar.gz

makepkg

pacman -U uswsusp-git-xxxx-1-x86_64.pkg.tar.xz

em /etc/suspend.conf

like this:

snapshot device = /dev/snapshot
resume device = /dev/sda5
resume offset = 123456                                          <----# swap-offset <swap_file_path>
shutdown method = platform
compress = y



Step B:

1) Create the swap file and make it active, eg.

# dd if=/dev/zero of=<swap_file_path> bs=1024 count=<swap_file_size_in_k>

# mkswap <swap_file_path>

# swapon <swap_file_path>

 2) Use an application that will bmap the swap file with the help of the

 FIBMAP ioctl and determine the location of the file's swap header, as the

 offset, in <PAGE_SIZE> units, from the beginning of the partition which

 holds the swap file.

# swap-offset <swap_file_path>

next line maybe useless

 3) Add the following parameters to the kernel command line:

 resume=<swap_file_partition> resume_offset=<swap_file_offset>


Step C:

s2disk


Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐