How to hibernate when ISO booting.

Technical issues/questions of an intermediate or advanced nature.
User avatar
Blaze
DEV Team
DEV Team
Posts: 3882
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

How to hibernate when ISO booting.

Post#1 by Blaze » 29 Nov 2020, 10:58

Cinnamon 4.8.0 was released with suspend-then-hibernate mode, but CSB is still on the 4.6.7 version http://slackware.uk/csb/current/x86_64/
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to hibernate when ISO booting.

Post#2 by Ed_P » 28 Nov 2020, 17:41

ncmprhnsbl wrote:
Ed_P wrote: "hibernate" in Windows writes all RAM to a file on disk. I assumed the same concept applied to Linux and have my Porteus power set to do that when the lid is closed. But in the morning my system's battery is dead if not plugged in when I close the lid before bed. It dawned on me the other day that I boot ISOs so Porteus has no disk, everything is in RAM so .... Writing RAM to RAM is illogical and maybe eating the battery.
read this: https://wiki.archlinux.org/index.php/Po ... ibernation
and this might be best discussed in it's own topic ;)
I agree and a good link. And a bit over my head.

Added in 1 day 4 hours 49 minutes 56 seconds:
The link says:
to use hibernation, you need to create a swap partition or file.
Ok.
need to point the kernel to your swap using the resume= kernel parameter
Does Porteus support a resume= cheatcode?
also need to configure the initramfs.
The what?
Using a swap file requires also setting the resume=swap_device and additionally a resume_offset=swap_file_offset kernel parameters. See the kernel documentation.

swap_device is the the volume where the swap file resides and it follows the same format as for the root parameter. The value of swap_file_offset can be obtained by running filefrag -v swap_file, the output is in a table format and the required value is located in the first row of the physical_offset column.
:%) :%) :unknown:
Other than my EFI partition all my partitions are NTFS. So how will hibernation work for me?

And I know how to create a swap file: Porteus 4 Porteus.swap file problem [Solved]
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3932
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

How to hibernate when ISO booting.

Post#3 by ncmprhnsbl » 29 Nov 2020, 23:38

yeah, arch wiki is good... buut does contain a lot of info not relevant to us ie. initramfs, systemd stuff..
apparently, it is possible to create a swap file on a NTFS partition : https://askubuntu.com/questions/1188041 ... on#1188050
(be careful) ;)
Ed_P wrote:
29 Nov 2020, 22:31
Does Porteus support a resume= cheatcode
good question, no idea..
Ed_P wrote:
29 Nov 2020, 22:31
The what?
pretty much the equivalent of our initrd.xz.. not sure if there's anything in it to deal with resuming from disk..
the trick here, is (i guess) that when you boot(after hibernation, since hibernation is a full power down), instead of using your iso, the 'hibernated system' stored in the swap file is used...
aand i'm way out my depth here :D
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

ncmprhnsbl november-2020 base build

Post#4 by Ed_P » 30 Nov 2020, 04:53

CSB ??

Added in 45 minutes 48 seconds:
How to hibernate when ISO booting.
My Cinnamon shows a date not a version number. And regardless, without a file there can be no save.

And csb = cinnamon slack builds ;)
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3932
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

How to hibernate when ISO booting.

Post#5 by ncmprhnsbl » 01 Dec 2020, 05:15

Ed_P wrote:
30 Nov 2020, 05:39
My Cinnamon shows a date not a version number.
/var/lib/pkgtools/packages/cinnamon* ;)
Ed_P wrote:
30 Nov 2020, 05:39
And regardless, without a file there can be no save.
correct
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to hibernate when ISO booting.

Post#6 by Ed_P » 01 Dec 2020, 05:21

Code: Select all

guest@porteus:~$ su
Password: 
root@porteus:/home/guest# ls /var/lib/pkgtools/packages/cinnamon
/bin/ls: cannot access '/var/lib/pkgtools/packages/cinnamon': No such file or directory
root@porteus:/home/guest# 
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3932
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

How to hibernate when ISO booting.

Post#7 by ncmprhnsbl » 01 Dec 2020, 06:10

cmon, Ed you know better* than that :D (but that's ok, we don't need to know)
anyways, was going to add: "suspend to ram" would be better described as "retain in RAM" with the machine put into a low power state, just enough to keep RAM intact.
not what this topic is about but not irrelevent to your purposes..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8359
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to hibernate when ISO booting.

Post#8 by Ed_P » 01 Dec 2020, 06:55

That approach works for overnight scenarios with reasonable batteries. But hibernation is better for longer terms.
Ed

Post Reply