You are not logged in.

#1 2015-02-01 05:31:02

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

hibernate > file

Hibernate to file

Excuse the coded title, intended to distinguish the meaning of "hibernate to file".

I understand the wiki on how to hibernate to a file; I want to generate hibernation files on demand.

I want to hibernate to file--as in tell hibernate to generate a file and output the file to the given file name.

hibernate -o /path/to/hibernate-file

Then use scripts to shutdown and append the output of hibernate to the kernel config:

resume=/some/partition resume_offset=[offset of hibernate-file]

bonus:
hibernation dumps could serve as emulator-style "savestates". With a file system that preserved all changes, and the proper kernel parameters, hibernation dumps could be loaded with the file system in the state it was at the time just after the hibernation dump was written to disk. It would be possible to keep as many savestates of the system as available storage capacity allows.

Last edited by quequotion (2015-02-01 05:40:45)

Offline

#2 2015-02-01 16:21:05

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: hibernate > file

Your title may be changed anytime.
To hibernate you should use a swapfile and prepare the mkinitcpio.conf with that regard.
See here for details, perhaps follow the related links for further details.


do it good first, it will be faster than do it twice the saint wink

Offline

#3 2015-02-02 14:09:31

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: hibernate > file

TheSaint wrote:

Your title may be changed anytime.

I understand, but it iis important to point out the ambiguity of "hibernate to file" as obviously:

To hibernate you should use a swapfile and prepare the mkinitcpio.conf with that regard.
See here for details, perhaps follow the related links for further details.

It is easily misunderstood.

I understand how to set up an installation to hibernate to disk and hibernate to file, the standard way as specified in the wiki.

That is not what I want to do; I want to be able to make the hibernation swap file on demand, probably with /sys/power/image_size=0 for the minimum size output, to another file of a given file name (not a predefined swap file).

It seems like this should be possible with tools available now, although with perhaps some patching.

This is how the wiki defines "hibernate to file":
1. Boot, kernel has resume and resume_offset set, so attempt to load a hibernation payload if available in that swapfile; falling back to a standard boot procedure.
2. kernel loads with standard boot procedure or hibernation payload
3. If boot was successful, the computer should be ready to use
4. At end of use, choose: Shudown/Hibernate/Logout/etc...
5. If hibernate, dump the hibernate payload into the swapfile

This is how I want to "hibernate to file":
1. Boot, kernel may or may not have resume and resume_offset set.
2. If it does, attempt to load a hibernation payload if available in that swapfile; falling back to a standard boot procedure.
3. kernel loads with standard boot procedure or hibernation payload
4. If boot was successful, the computer should be ready to use
5. At end of use, choose: Shudown/Hibernate/Logout/etc...
6. If hibernate, dump the hibernate payload into a time-stamp filename hibernate-[date-time]; append resume and resume_offset to kernel config.

Maybe I can work out a demonstration with some bash...
Either way, still need resume hook in mkinitcpio.conf.

(aspirations of savestates are only theoretical)

Offline

#4 2015-02-02 15:42:39

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: hibernate > file

So in English... you want:

1. not the hibernation file to occupy the few GB of space
2. have an hibernation "version control"?

For 2. you might look at using BTRFS instead...

Last edited by Alad (2015-02-02 15:45:01)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

Board footer

Powered by FluxBB