Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Pascal Hambourg

Le 14/12/2019 à 16:35, Ottavio Caruso a écrit :

On Sat, 14 Dec 2019 at 13:47, Pascal Hambourg  wrote:


Le 14/12/2019 à 14:20, Ottavio Caruso a écrit :



I've also added:
GRUB_CMDLINE_LINUX_DEFAULT="resume d823f1ee-2e16-4327-b0c1-639f377002bb"


Wrong syntax. It should be "resume=UUID=d823...".
This will override the RESUME value embedded into the initramfs by
update-initramfs.


Thanks. So, if it is already embedded in initramfs, does it make sense
to have that line in /etc/default/grub?


Only if you need to override the resume value embedded in the initramfs.


Shall I just use the default boot option?


Either is fine.



Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Ottavio Caruso
On Sat, 14 Dec 2019 at 13:47, Pascal Hambourg  wrote:
>
> Le 14/12/2019 à 14:20, Ottavio Caruso a écrit :

> (...)
> > I've also added:
> > GRUB_CMDLINE_LINUX_DEFAULT="resume d823f1ee-2e16-4327-b0c1-639f377002bb"
>
> Wrong syntax. It should be "resume=UUID=d823...".
> This will override the RESUME value embedded into the initramfs by
> update-initramfs.

Thanks. So, if it is already embedded in initramfs, does it make sense
to have that line in /etc/default/grub? Shall I just use the default
boot option?

-- 
Ottavio Caruso



Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Pascal Hambourg

Le 14/12/2019 à 14:20, Ottavio Caruso a écrit :


$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.9.0-11-amd64
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=d823f1ee-2e16-4327-b0c1-639f377002bb)
I: Set the RESUME variable to override this.

(...)

I've also added:
GRUB_CMDLINE_LINUX_DEFAULT="resume d823f1ee-2e16-4327-b0c1-639f377002bb"


Wrong syntax. It should be "resume=UUID=d823...".
This will override the RESUME value embedded into the initramfs by 
update-initramfs.



to /etc/default/grub

and "sudo update-grub"

but I don't have "/etc/initramfs-tools/conf.d/resume"

Is this file necessary?


No. This file used to define the RESUME variable, but it is not created 
by the installer any more and RESUME can be defined in any other 
configuration file in /etc/initramfs-tools/conf.d or in 
/etc/initramfs-tools/initramfs.conf. If RESUME is not defined, 
update-initramfs will use the active swap.




Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Pascal Hambourg

Le 14/12/2019 à 12:26, Ottavio Caruso a écrit :


$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.9.0-11-amd64
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=d823f1ee-2e16-4327-b0c1-639f377002bb)
I: Set the RESUME variable to override this.

I'll reboot and test it and we'll take it from there. (Not sure if
reboot is needed)


Reboot is needed to run the new initramfs.



Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Pascal Hambourg

Le 14/12/2019 à 10:43, Alexander V. Makartsev a écrit :

Simple swap partition creation is not enough for hibernation to work, it
also has to be configured in initrd. [2]


Despite the file name it is no longer an initrd but an initramfs.


https://wiki.debian.org/Hibernation#Changing_or_moving_the_swap_partition


The advice of reinstalling initramfs-tools given in this wiki page is 
just crazy. You only need to rebuild the initramfs with


update-initramfs -u -k all

However I fail to understand the relationsip between the swap and 
suspend-to-RAM.




Re: Help! Borked suspend/hibernate after adding swap partition

2019-12-14 Thread Alexander V. Makartsev
On 13.12.2019 23:44, Ottavio Caruso wrote:
> Hi,
>
> I'm running LMDE3 (based on Debian oldstable) on  Thinkpad Edge E130.
> I'm not getting much support lately from the Mint forums and that's
> why I'm posting here.
>
> This laptop had been running happily with a mere 4GB RAM and no swap
> until a few weeks ago, when I had to compile a big programme (Liferea)
> and the compiler complained that it was running out of virtual memory.
>
> So I made a 8GB partition and formatted it as swap. This is where all
> problems started. Since then, suspend to ram has stopped working as it
> was (the laptop resumes spontaneously overnight without any
> interactions; the battery drains and the laptop shuts down, creating
> filesystem corruption).
>
> Hibernate doesn't work either. When I open the lid, instead of
> resuming from disk, the laptop just reboots, and, from dmesg I can see
> that it wasn't shut down properly.
>
> This is giving me headaches, as you can imagine. If I manually disable
> swap (sudo swapoff -a), all goes back to normal and suspend works
> beautifully.
>
> At the moment, the only workaround is to disable swap before suspending.
>
> I have the latest kernel. Where do I start troubleshooting? Any ideas?
>
Best way is to start here. [1]
Dealing with powerstates\hibernation could be complicated, because it
depends on many factors.
Simple swap partition creation is not enough for hibernation to work, it
also has to be configured in initrd. [2]


[1] https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html
[2]
https://wiki.debian.org/Hibernation#Changing_or_moving_the_swap_partition

-- 
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄