Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3567

General Questions • [Software] Create the swapfile at the moment of hibernation then delete it after resuming

$
0
0
The issue is the offset :

I tried

Code:

fallocate -l $(($(free -b|grep Mem|awk '{print $3}')+100000000)) /swap;mkswap /swap;swapon /swap;filefrag -v /swap|awk 'NR==4{gsub(/\./,"");print $4;}'
which gives the offset 2553641 so then

Code:

cd /media/a/820C-0936/EFI/boot;ukify build --linux=/boot/vmlinuz-6.11.4-amd64 --initrd=/boot/initrd.img-6.11.4-amd64 --cmdline="root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 rw nvidia-drm.modeset=1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume_offset=2553641" -o bootx64.efi;swapoff /swap;rm /swap
then reboot to the new bootx64.efi .

Then we would create a .sh file :

Code:

#!/bin/bashfallocate -l $(($(free -b|grep Mem|awk '{print $3}')+100000000)) /swap;mkswap /swap;swapon /swap;systemctl hibernate
but it doesn't work :

Code:

filefrag -v /swap|awk 'NR==4{gsub(/\./,"");print $4;}'
gives a new offset ! Why ? I don't touch the OS partition ...

So doing

Code:

ukify ... resume_offset="the new offset";systemctl hibernate
doesn't work : maybe because the old loaded bootx64.efi has the old offset , so we should disable this check , how ?

With

Code:

fallocate -o
it's possible to set the offset , but better using a swap partition so ...

Statistics: Posted by jebez — 2024-10-24 22:12 — Replies 6 — Views 257



Viewing all articles
Browse latest Browse all 3567

Trending Articles