[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reasonably simple setup for 1TB HDD and 250GB M.2 NVMe SSD




On 10/12/2021 12:21, Dan Ritter wrote:
Andrei POPESCU wrote:
On Jo, 09 dec 21, 09:46:26, Dan Ritter wrote:
In a more perfect world, the space for suspension would not
otherwise be treated as swap space.
It still has to be reserved from somewhere, and swap appears to be the
logical choice for that.
No, it was a convenient choice. A better choice would have been
a way to mark a swap partition or file as for use only by the
hibernation system, or, as actually once existed, a system that
would mount a specific swap partition during the hibernation
shutdown procedure, and unmount it after recovery.

According to systemd-suspend.service(8):

"Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other mentioned units, respectively) will run all executables in /lib/systemd/system-sleep/"

There is also /etc/pm/sleep.d, which is a more system-specific location (i.e. /etc rather than /lib)

Therefore, it *should* be theoretically possible to reserve a partition explicitly for the purpose of hibernation. The script can bring the device online (with swapon) and then tell the kernel to hibernate to that device (echo $MAJOR:$MINOR > /sys/power/resume). Upon resume, the device can be taken offline (with swapoff) so that it isn't used for regular swap.

For extra credit, devise a standard marking for this partition (e.g. a label or a GPT UUID) so that this system can be made universal :)



-dsr-

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: