hibernate on Porteus 5.0

Post here if you are a new Porteus member and you're looking for some help.
benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#1 by benjibasson » 24 Oct 2022, 19:57

I would like to hibernate my PC to a swapfile. but after creation and setting of swapfile, edit the grub2, the menu hibernate and hybrid has gone. moreover pm-hibernate and systemctrl doen't exist

Code: Select all

root@porteus:/home/guest# pm-hibernate
bash: pm-hibernate: command not found
root@porteus:/home/guest# pm-suspend
bash: pm-suspend: command not found

Code: Select all

guest@porteus:~$ getmod -m pm-utils
Reading Package Lists...Done
No such package: pm-utils
I have created the 6000Mo fswapfile or 4000 Mo of ram by

Code: Select all

mkfileswap /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap 6000
then swapon on rc.local

then report offset uuid on grub from

Code: Select all

root@porteus:/home/guest# filefrag -v /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap
Filesystem type is: ef53
File size of /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap is 6291456000 (1536000 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..  294911:   13336576..  13631487: 294912:           
look for uuid

Code: Select all

root@porteus:/home/guest# findmnt -no UUID -T /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap 
86e04ac1-6ec3-4d07-b542-9742ef263395
here is my grub2

Code: Select all

menuentry "porteus  on sda6 xfce"{
set root=(hd0,6)
linux /porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda6/porteus64bit_v50 changes=EXIT:/porteus64bit_v50/change resume=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 resume_offset=13336576 login=guest
initrd /porteus64bit_v50/boot/syslinux/initrd.xz
}

but when I add

Code: Select all

resume=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 resume_offset=13336576
on boot options, I cannot hibernate
when I remove resume=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 resume_offset=13336576 from boot option, hibernate and hybrid suspend buttons come back ( but are useless )

How to hibernate the porteus 5.0 please

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

hibernate on Porteus 5.0

Post#2 by ncmprhnsbl » 25 Oct 2022, 04:25

benjibasson wrote:
24 Oct 2022, 19:57
pm-hibernate and systemctrl doen't exist
systemctrl is a systemd thing? we don't have that.
and pm-utils isn't used any more..
what we do have is elogind and it's commands:

Code: Select all

loginctl suspend
loginctl hibernate
loginctl hybrid-sleep
beyond that, i don't know... which DE are you using?
might be able to glean something from here: https://wiki.gentoo.org/wiki/Suspend_and_hibernate
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

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

hibernate on Porteus 5.0

Post#3 by Ed_P » 25 Oct 2022, 05:36


benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#4 by benjibasson » 25 Oct 2022, 15:50

Hi,

I have tried the command loginctl hibernate, but id doesn't work properly:

The computer is doing the same think than on other distrib: once blink screen, light hard drive, freeze display. but instead of hibernate it stay awake and come back.

I can see that it had free ram and fill swap.
Image

unfortunaly I had to reboot to give feedback beause it has disable the network ( impossible to enable it )

Beyond that, I'm using XFCE desktop. the swap file is on an ext4 partition ( on this porteus's folder).
cannot use partition because too many partitions and swap partition is reserved for Ubuntu

I cannot advance anymore with links:
I have got this uuid

Code: Select all

root@porteus:/home/guest# blkid /dev/sda6
/dev/sda6: UUID="[b]86e04ac1-6ec3-4d07-b542-9742ef263395[/b]" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="0832de2d-06
"
offset

Code: Select all

root@porteus:/home/guest# filefrag -v /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap
Filesystem type is: ef53
File size of /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap is 6291456000 (1536000 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..  294911:   [b]13336576[/b]..  13631487: 294912:     


and so use this boot option

Code: Select all

root@porteus:/home/guest# cat /proc/cmdline
quiet BOOT_IMAGE=/porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda6/porteus64bit_v50 changes=EXIT:/porteus64bit_v50/change resume=UUID=[b]86e04ac1-6ec3-4d07-b542-9742ef263395[/b] resume_offset=[b]13336576[/b] login=guest copy2ram
cheers

beny
Full of knowledge
Full of knowledge
Posts: 2276
Joined: 02 Jan 2011, 11:33
Location: italy

hibernate on Porteus 5.0

Post#5 by beny » 25 Oct 2022, 16:07

well maybe you know this wiki but if not: https://docs.slackware.com/howtos:slack ... ibernation btw do not work on my system but the xfce4 suspend on the log windows work and don't know that is the same as hibernate.but i don't have swap.

benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#6 by benjibasson » 25 Oct 2022, 18:23

Hi

I understand why Porteus didn't suspend to disk:
in fact Porteus have swapon booth partition and swapfile

Code: Select all

root@porteus:/home/guest# swapon 
NAME                                             TYPE      SIZE USED PRIO
/dev/sda7                                        partition 4.9G   0B   -3
/mnt/sda6/porteus64bit_v50/porteus/swapfile.swap file      5.9G   0B   -2
so if I swapoff /dev/sda7 and do

Code: Select all

loginctl hibernate
it suspend to disk on /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap witch uuid is 86e04ac1-6ec3-4d07-b542-9742ef263395 and physical offset 13336576 ( cannot confirm with swap-offset: command not found
neither install

Code: Select all

guest@porteus:~$ getmod -m uswsusp
Reading Package Lists...Done
No such package: uswsusp

unfortunally when I would like to resume, it start porteus instead of resume from hibernation.
my boot option was the same:

Code: Select all

quiet BOOT_IMAGE=/porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda6/porteus64bit_v50 changes=EXIT:/porteus64bit_v50/change resume=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 resume_offset=13336576 login=guest
1) is changes=EXIT: incompatible with hibernation?
2) should I blacklist /dev/sda7? if yes how to process?
3) should I add cheatcode

Code: Select all

root=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 ro
4) should I do

Code: Select all

update-initramfs -u -k $(uname -r)
after edit /etc/initramfs-tools/conf.d/resume?


cheers

User avatar
Rava
Contributor
Contributor
Posts: 5424
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

hibernate on Porteus 5.0

Post#7 by Rava » 26 Oct 2022, 02:45

benjibasson wrote:
25 Oct 2022, 18:23
1) is changes=EXIT: incompatible with hibernation?
What I would try be I in your shoes:
disable any changes , be it =EXIT or any other variant.
Create one setup that results in this info text at bootup

Code: Select all

^ changes cheatcode not found, using memory only
That way you eliminated one possible interference with hibernate, and if hibernate works (with not using changes), then go from there.

Added in 9 minutes 56 seconds:
Also, for now until the issue is fixed, leave the "quiet" cheat code out of your setup. You want possible info by the kernel even when it's not that serious, such info might give helpful headsup.

https://www.linuxtopia.org/online_books ... /re04.html

Code: Select all

Synopsis
   quiet

Description
   Set the default kernel log level to KERN_WARNING (4), which suppresses all messages during
   boot except extremely serious ones. (Log levels are defined under the loglevel parameter.)
Cheers!
Yours Rava

benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#8 by benjibasson » 26 Oct 2022, 13:36

Hi
When I remove =EXIT I got many red error messages ( repeat repeat repeat) during the boot about duplicate conflict on network and in white color about files autorisation about every /home/* files stored in /home. In fact it try to change autorisation and fail ( hidden by dmesg, last show only in shell ctrl alt f1)

So I start with new change folder and deleted exit.
set wifi, firefox gmail...

restart to try hibernation but resume does not work.

I notice that hibernate is not working alright in the distro Porteus which is also nice and fast. Obviously, the live scripts in Porteus mount the devices and swapfile at an later point in time, making my swapfile (which is on this root partition) available after the "resume from hibernation" process tries to find the hibernation image.

Code: Select all

[    0.024439] PM: hibernation: Registered nosave memory: [mem 0xfed1c000-0xfed8ffff]
[    0.024440] PM: hibernation: Registered nosave memory: [mem 0xfed90000-0xfedfffff]
[    0.024442] PM: hibernation: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
[    0.024443] PM: hibernation: Registered nosave memory: [mem 0xfee01000-0xfeffffff]
[    0.024444] PM: hibernation: Registered nosave memory: [mem 0xff000000-0xffffffff]
[    0.024447] [mem 0xc0000000-0xdfffffff] available for PCI devices
[    0.024452] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.040825] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:4 nr_node_ids:1
[    0.041198] percpu: Embedded 44 pages/cpu s143016 r8192 d29016 u524288
[    0.041208] pcpu-alloc: s143016 r8192 d29016 u524288 alloc=1*2097152
[    0.041212] pcpu-alloc: [0] 0 1 2 3 
[    0.041234] Fallback order for Node 0: 0 
[    0.041238] Built 1 zonelists, mobility grouping on.  Total pages: 980767
[    0.041240] Policy zone: Normal
[    0.041242] Kernel command line: quiet BOOT_IMAGE=/porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda6/porteus64bit_v50 changes=/porteus64bit_v50/change resume=UUID=86e04ac1-6ec3-4d07-b542-9742ef263395 resume_offset=13336576 login=guest copy2ram ramsize=40% noswap
[    0.041416] Unknown kernel command line parameters "copy2ram noswap BOOT_IMAGE=/porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda6/porteus64bit_v50 changes=/porteus64bit_v50/change login=guest ramsize=40%", will be passed to user space.
...
and 21 second later, it mount swap file

Code: Select all

[   21.342338] Adding 6143996k swap on /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap.  Priority:-2 extents:50 across:61816832k 

User avatar
Rava
Contributor
Contributor
Posts: 5424
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

hibernate on Porteus 5.0

Post#9 by Rava » 26 Oct 2022, 16:55

benjibasson wrote:
26 Oct 2022, 13:36
When I remove =EXIT I got many red error messages
Not remove only =EXIT remove any kind of changes= cheatcode to try if that helps you in your case against hibernation.
This is not to keep you from using changes= but in figuring out if any kind of changes= interferes with hibernation on your machine.

But we can only go on determining where the issue is after you started your system in a way it reports during boot

Code: Select all

^ changes cheatcode not found, using memory only
like I already wrote above.

If there are changes you want to have saved in that session you need to manually create a settings-module. Like using this one-liner in your home-directory tells you the files when you adjust the date/time at the end and then copy these files accordingly.

Code: Select all

find . -mtime 0 2>/dev/null | xargs ls -oad --color=auto --time-style=long-iso 2>&1 |grep -vE "cache| .$| ..$"|grep "2022-10-26 18:4"

Code: Select all

grep "2022-10-26 18:4"
finds all entries changed at 2022-10-26 18:40 to 18:49;
when you want to have all files and folders listed that got changed at 18:40 to 18:59 use

Code: Select all

grep "2022-10-26 18:[45]"
etcetera pp.

HTH.
Cheers!
Yours Rava

benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#10 by benjibasson » 26 Oct 2022, 17:12

Not remove only =EXIT remove any kind of changes= cheatcode to try if that helps you in your case against hibernation.
This is not to keep you from using changes= but in figuring out if any kind of changes= interferes with hibernation on your machine.
Do you mean to try hibernation in always fresh mode?
also:
1) remove whole 'change=...'
2) manual swapon /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap
3) open firefox and other windows
4) try hibernate and resume.
Last edited by benjibasson on 26 Oct 2022, 17:33, edited 2 times in total.

User avatar
Rava
Contributor
Contributor
Posts: 5424
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

hibernate on Porteus 5.0

Post#11 by Rava » 26 Oct 2022, 17:28

benjibasson wrote:
26 Oct 2022, 17:12
Do you mean to try hibernation in always fresh mode?
yes.
1) remove whole 'change=...'
yes
2) manual swapon /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap
if it is not used by default and you want it used, then yes.
but first try it without that one swap file, and after that with that swap file.
3) open firefox and other windows
yes
4) try hibernate and resume?
yes.

In my case, I need to monitor how much RAM is used and when I have the system run for a while I need to end Palemoon (my browser) to have more free RAM (I only have 4 GB) while interlink (my email program) stays running.

Good that newest palemoon has options that help me with that.
The settings user_pref("browser.sessionstore.cache_behavior", 2); and user_pref("browser.startup.page", 3);)
And no, one of these settings is unique to palemoon. You will not have it with e.g. Firefox.

Or as my help.palemoon puts it:

Code: Select all

guest@porteus:/$ help.palemoon 
help.palemoon V0.2

[removed part about leo.org]

// When Palemoon starts 
// 3 = Show my tabs and windows from last time
user_pref("browser.startup.page", 3);

// Pale Moon: Allow the user to bypass cached versions of pages when restoring
// tabs from a previous session
// 0 = pull fully from cache
// 1 = perform a soft refresh when restoring a tab (check network)
// 2 = perform a hard refresh when restoring a tab (bypass cache completely)
user_pref("browser.sessionstore.cache_behavior", 2);

Check settings via:
cd "/home/guest/.moonchild productions/pale moon/*.default"
grep -E '"browser.sessionstore.cache_behavior", |"browser.startup.page", ' prefs.js
# should be:
user_pref("browser.sessionstore.cache_behavior", 2);
user_pref("browser.startup.page", 3);
Cheers!
Yours Rava

benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#12 by benjibasson » 26 Oct 2022, 17:42

I have done
1) remove whole 'change=...'
2) manual swapon /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap
3) open firefox and other windows
4) check that 2.5gb out of 4gb ram is busy. Swap is empty
5) try hibernate and resume.

=> Porteus fall asleep but start normally instead of resume from hibernation althought
-UUID and offset are booth accurates
-swapfile is really in suspend mode

Code: Select all

root@porteus:/home/guest# swapon /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap 
swapon: /mnt/sda6/porteus64bit_v50/porteus/swapfile.swap: software suspend data detected. Rewriting the swap signature.
here is the dmesg.
https://pastebin.com/fuGT3NLn

When I didn't success to resume from hibernation on other Distributions like Ubuntu and Arch, I notice that it was because I forgot to edit /etc/initramfs-tools/conf.d/resume to add same append than on grub2 and to launch

Code: Select all

sudo update-initramfs -u -k $(uname -r)
wich are missing from porteus

User avatar
Rava
Contributor
Contributor
Posts: 5424
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

hibernate on Porteus 5.0

Post#13 by Rava » 26 Oct 2022, 18:27

benjibasson wrote:
26 Oct 2022, 17:42
When I didn't success to resume from hibernation on other Distributions like Ubuntu and Arch, I notice that it was because I forgot to edit /etc/initramfs-tools/conf.d/resume to add same append than on grub2 and to launch

Code: Select all

sudo update-initramfs -u -k $(uname -r)
wich are missing from porteus
Have you tried installing update-initramfs?
E.g. by using getmod - see this thread for more details: [Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules
Cheers!
Yours Rava

benjibasson
Samurai
Samurai
Posts: 191
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

hibernate on Porteus 5.0

Post#14 by benjibasson » 26 Oct 2022, 18:45

althought I ran getmod -u I got

Code: Select all

guest@porteus:~$ getmod -m update-initramfs
Reading Package Lists...Done
No such package: update-initramfs

Code: Select all

guest@porteus:~$ getmod -s update-initramfs
guest@porteus:~$ 

User avatar
Rava
Contributor
Contributor
Posts: 5424
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

hibernate on Porteus 5.0

Post#15 by Rava » 26 Oct 2022, 20:48

not even pkgs.org finds anything
https://pkgs.org/search/?q=update-initramfs

Code: Select all

Search Results for update-initramfs
No packages found
You sure the package is called update-initramfs?
Could it be update-initramfs is just one program that is part of another package?

according to https://manpages.debian.org/buster/init ... .8.en.html update-initramfs is a script:
NAME
update-initramfs - generate an initramfs image

SYNOPSIS
update-initramfs {-c|-d|-u} [-k version] [-v] [-b directory]
update-initramfs -h

DESCRIPTION
The update-initramfs script manages your initramfs images on your local box. It keeps track of the existing initramfs archives in /boot. There are three modes of operation create, update or delete. You must at least specify one of those modes.

The initramfs is a gzipped cpio archive. At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it as initial root file system. All finding of the root device happens in this early userspace.
(highlighting by me)

When it's a script you should be able to copy it from your other Linux systems to Porteus, e.g copy it into /usr/local/bin
Make sure it's executable. It should be since it worked for your other Linux.
Cheers!
Yours Rava

Post Reply