Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How snapshot-hibernate from grub??

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

How snapshot-hibernate from grub??

#1 Post by bester69 »

I know i can hibernate the system and then when i poweron back the computer recover the whole system state.

I was wondering if its possible to keep some hibernate state, so i can recover it when I wish. This is what i'd like to do:
- I open some apps, with much tasks running in ram, and I save the state for restoing eventually.
- I restart session to clean state and use that session for others things,
- Some days later i decide to take back my saved state work by restoring that hibernate state.

Is there any way/tools to achieve this thing?
Last edited by bester69 on 2017-09-27 18:58, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Is it possible to save/restore a system State?

#2 Post by Bulkley »

I can't give you the answer you want but I can give you a good place to look. Prefbar has lots of buttons that do all sorts of stuff I didn't know could be done.

User avatar
alan stone
Posts: 269
Joined: 2011-10-22 14:08
Location: In my body.

Re: Is it possible to save/restore a system State?

#3 Post by alan stone »

How about a session manager? See here and here. EDIT: And here.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Is it possible to save/restore a system State?

#4 Post by bester69 »

alan stone wrote:How about a session manager? See here and here. EDIT: And here.
No its not that, what im lookin for,

I found this: Hibernate and resume from a swap file
https://askubuntu.com/questions/6769/hi ... -swap-file

I'd like an easy way to get this, a way to load a snapshot-hibernate from grub manager..
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Is it possible to save/restore a system State?

#5 Post by pylkko »

Perhaps consider having two physical machines for each session. Or two virtual machines. Run seperate installs on a hypervisor? Use a live image in between a hibernation from the real session? Dual boot a major session and a smaller session from EFI or bootloader and have separate swaps for them?

Normally hibernation writes an image to the swap partition or a swap file if you configure that. Then it leaves a hook for the kernel to reboot from the location which in Debian, I think, is give in grub's config. You can also hibernate, reboot and pass noresume to the kernel as a boot parameter in which case it will skip resume from disk. Because it is possible to hibernate without swap partition (https://wiki.debian.org/Hibernation/Hib ... _Partition) and because you can make an image of a swap partition, you might be able to do the following some how: write system state to file, clone that file, hibernate, pass no resume, run small session, quit, move large session file back, reboot with resume.

EDIT: I see that while I was typing you posted a link that describe almost exactly what I suggested.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Is it possible to save/restore a system State?

#6 Post by bester69 »

pylkko wrote:.....and because you can make an image of a swap partition, you might be able to do the following some how:

write system state to file, clone that file, hibernate, pass no resume, run small session, quit, move large session file back, reboot with resume.
.....describe almost exactly what I suggested.
Yes!!, this pylkko!!

I dont know if this is easy to do, I can play with btrfs snapshots what will make it easier, i also dont know if this works properly or can give you troubles. :o
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Is it possible to save/restore a system State?

#7 Post by pylkko »

Well, I don't know what would happen if the system on disk changes during another session. For example, let's say you open a file for editing in session 1, leaving it open in the hibernation image, and then delete that same file in session 2 from the disk and then go back to session 1. There would be an open file reference in memory to a non-existant file.Now, what if the operating system does these kinds of operations in the background? what if you don't just delete one file, but upgrade your operating system chaging many files? I have no idea. I don't know if anyone has ever even tried this, a quick internet search did not reveal any attempts.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Is it possible to save/restore a system State?

#8 Post by bester69 »

pylkko wrote:Well, I don't know what would happen if the system on disk changes during another session. For example, let's say you open a file for editing in session 1, leaving it open in the hibernation image, and then delete that same file in session 2 from the disk and then go back to session 1. There would be an open file reference in memory to a non-existant file.Now, what if the operating system does these kinds of operations in the background? what if you don't just delete one file, but upgrade your operating system chaging many files? I have no idea. I don't know if anyone has ever even tried this, a quick internet search did not reveal any attempts.
What we're doing here, its to make a snapshot of the hibernated system . I think this must be very possible cos it has much sense,

Look, with BTRFS, we can make the filesytem snapshot with a livecd session, once the system was hibernated. In the same live session we would backup the swap-file used with "uswsusp" (We would have keep and clone that swap-file in another partition to be able to play with it).

Once we want to restore hibernated session, we would remount BTRS snapshot and we would replace the dirty swap-file with the previously cloned. I'd like you to try it if you feel like it. Then we reboot, and everithing should restore from the hibernate state. I will do it when i have a time, Im just curious if my way can works, furthermore it can be very usefull to know how to keep a session in disc. :o
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: How snapshot-hibernate from grub??

#9 Post by pylkko »

Regrettably I have to inform you that I don't personally need what you desire and I have too little spare time

User avatar
alan stone
Posts: 269
Joined: 2011-10-22 14:08
Location: In my body.

Re: Is it possible to save/restore a system State?

#10 Post by alan stone »

bester69 wrote: I'd like you to try it if you feel like it. ... I will do it when i have a time, Im just curious if my way can works,
So what you were looking for and curious about is not exactly what you were looking for and curious about?

Post Reply