Kernel version: 4.14.3-1-ARCH Sheath: XFCE Boot loader: refind I’m looking required minimum paging file size:
sudo nano /sys/power/image_size
I have it: 13418831872 = 13.45 GB. I take a little with margin. I create swap file of size 15gb:
sudo dd if = /dev/zero of = /home/sergey/swapfile bs = 1M count = 15000
Security:
sudo chmod 600 /home/sergey/swapfile
Format and include swap file:
sudo mkswap /home/sergey/swapfile sudo swapon /home/sergey/swapfile
I add a new swap file in /etc/fstab:
/home/sergey/swapfile none swap defaults 0 0
I add value resume in /etc/mkinitcpio.conf in HOOKS:
HOOKS = (base udev resume autodetect modconf block filesystems keyboard fsck)
I execute:
mkinitcpio -p linux
I edit boot parameters. I go to: /boot/refind_linux.conf I leave there one line and add resume and resume_offset Add to disk partition containing my paging file (resume), resume_offset – I get from the command:
sudo filefrag -v /home/sergey/swapfile
physical_offset – 1st value this is my value. in refind_linux.conf I have:
"Boot with standard options" "ro root = UUID = 09853bcf-94cc-400a-a04d-af5bf5e6bf13 resume = /dev/sda5 resume_offset = 38348747"
The system does not always go into sleep mode correctly, sometimes the monitor goes out and the computer hangs. I increased size of the swap file on 40GB
sudo dd if = /dev/zero of = /home/sergey/swapfile bs = 1M count = 40000
but it did not solve my problem. What can be done for solve this problem?