You are not logged in.
hibernate works flawlessly on my system!
is it possible to save
1. various configurations of my gnome desktop on disk through hibernate and then recall a specific one?
2. save a hibernate configuration and recall it after a reboot?
Last edited by pradtf (2021-03-08 07:08:05)
in friendship,
prad
Offline
Hibernation dumps your memory into a file/partition and reloads it from there when resuming the hibernated system (it's not a reboot)
In theory, you could select different hibernation images at the boot loader BUT:
The hibernated image might/will match a certain hardware/firmware/filesystem state that is lost/not found when mixing hibernated images - this is actually a common issue w/ a hibernated windows (cause that's what windows meanwhile defaults to on "shutdown"…)
If you try, at least ensure to sync all filesystems before hibernating (to prevent data loss), but hibernation really means to walk into a cave, sleep over the winter and when you wake up, you don't want to be confused because humans fell the forest and built a shopping mall around your cave. It's not a snapshot of a virtual machine, where the machine state is saved along the active memory.
Offline
It's not a snapshot of a virtual machine, where the machine state is saved along the active memory.
hello again seth!
thx for your reply and the very fine cave analogy!
so is there some way to save the machine state and active memory for the purpose of recalling it again?
i vaguely recall i3 allowed something like that as far as your window space config, though i don't think it did anything like save machine state.
apparently you can save the state of a virtual machine.
then i came across cryopid:
CryoPID allows you to capture the state of a running process in Linux and save
it to a file. This file can then be used to resume the process later on, either
after a reboot or even on another machine.
https://github.com/maaziz/cryopid
which looks as though it could do the job.
also, i use xfs so i can do snapshots, but i think that's only for the filesystem, so that wouldn't save the state, i guess.
in friendship,
prad
Offline
You cannot save hardware (at least not generically nor generally)
What you refer to for i3 and what's also provided by at least KDE and probably gnome is session management.
This has nothing to do with hibernation.
You log out, reboot or hibernate or not, then re-login and at this point you can re-start (at least some of) the processes that were running when you logged out, the window manager remembers previous windows positions and the restarted programs to at least some degree will be able to recreate there former condition (opened files, positions, etc.)
=> This doesn't actually restore a session, but rather aims to recreate it.
The last commit of the github repo is 9 years old and says "Partial Working copy on 2.6.9 kernel".
Dumping the stack of a running process and reloading it into a future instance of that process sounds nice, but is spoiled by security measurements like stack address randomization and also most processes on your desktop won't act in isolation, but interact with other processes via ipc (dbus)
They're essentially phoning each other all the time and now your "resumed" process tries to continue a conversation that didn't take place as far as the other end is concerned. Worse: your process still believes it hooked off the phone (registered to the dbus) but the phone doesn't know any of this.
It's essentially a fragmented hibernation that moves the problem "your kernel doesn't match your hardware state" to "your processes don't match the kernel or other process states".
Filesystem snapshots allow you to go back in time on your disk, undelete files and directories etcetc. but they don't manage active memory at all.
Offline
wow! i never even saw the details of cryopid! thx for pointing it out!
i'll stick to just using my script to load things up after reboot (which i do no more than once a week anyway, since i hibernate).
though i may explore your idea in your initial post at a later point in time.
thx again for your detailed replies!
i'll mark this solved for now.
in friendship,
prad
Offline