Can't hibernate

12 risposte [Ultimo contenuto]
Avron

I am a translator!

Offline
Iscritto: 08/18/2020

I have swap active on my X200 and on my T400 running aramo. On both, hibernate is not proposed. The swap is not encrypted.

On Parabola, I can't remember how I did set it up but it works. I have the "resume=" option in the GRUB_LINUX_CMDLINE variable in /etc/default/grub unlike on Trisquel (but I also have the crypt_device and root options, while I also have encrypted root on Trisquel so it seems this is configured in a different way).

Whether I boot Trisquel from GRUB in flash (osboot, as installed by Minifree from whom I got the T400) or from GRUB on disk (using Seabios), it makes no difference. I always boot Parabola with Seabios as it is on a different disk and I have no option to choose the disk from GRUB in flash.

What would normally be the user-friendly way to get hibernate to work on aramo?

Of course, I am fine to fix that by command line and editing configuration on my own computers but I would expect hibernate to also be available in a user-friendly way for Trisquel users.

Ark74

I am a member!

I am a translator!

Offline
Iscritto: 07/15/2009

IIRC hibernate is enabled if the swap is big enough to save what's on memory, you might like to check what size of swap you might need.

Also if the option is presented when no memory is in use, or if it disappears on heavy use.

Cheers!

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

What would normally be the user-friendly way to get hibernate to work on aramo?

I use the GNOME desktop and "Hibernate" is not proposed either, although my swap partition is larger than my RAM. https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/ apparently presents well the non-friendly ways to get the feature. If you try that, can you report what worked for you or even make a manual in Trisquel's documentation?

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

To get the UUID of swap, I had to run blkid (the swap entry in /etc/fstab in my computer does not have the UUID value).

I added resume=UUID=the-UUID-of-the-swap-partition to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, ran update-grub and rebooted, then systemctl hibernate does hibernate and the resume works, but the option remains absent from the MATE menu.

Can anyone who has installed aramo recently from an iso say whether hibernate is proposed by the menus? (I can't remember when I installed aramo on this computer and from which iso).

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

You need a Polkit rule. I got it working on GNOME Shell. I wrote https://trisquel.info/en/wiki/hibernation-aka-suspend-disk (to be completed with instructions for other desktop environments).

EDIT: prospero beat me by a few minutes (that is the problem with deciding to write a whole manual after clicking the "Reply" button).

prospero
Offline
Iscritto: 05/20/2022

The hibernate buttons are not showing by default in their respective menus in Trisquel 11 Aramo (MATE). In order to add them, I had to create a com.ubuntu.enable-hibernate.pkla file in /var/lib/polkit-1/localauthority/50-local.d/ with this content:

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

EDIT: I also had to add the UUID of the swap partition in the GRUB configuration file for resume from hibernation to work.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Just to be sure before completing the manual I have just written: adding the Polkit rule is enough to have the Hibernate button magically appear in MATE? If not, what are the additional steps.

Also, the authors of the extension that adds such a button to GNOME Shell wrote a more complicate rule than yours: https://raw.githubusercontent.com/arelange/gnome-shell-extension-hibernate-status/master/README.md

I tend to believe I should use theirs (because they have probably more deeply studied the topic), but you can convince me otherwise.

prospero
Offline
Iscritto: 05/20/2022

I find your lack of faith disturbing.

MATE is pure magic. Some call it simplicity.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Thank you for the edition of the manual. It would be interesting to know if LXDE and KDE (other popular desktop environments for Trisquel) are pure magic as well. Anybody?

prospero
Offline
Iscritto: 05/20/2022

No wonder MATE is the default DE for Trisquel. LXDE, the default DE for Trisquel Mini, is also pure magic. I applied the same two steps mentioned above on Trisquel Mini 11 Aramo, and got exactly the same result: the hibernate button magically appeared in the logout menu, and the system resumes from hibernation as expected.

I believe it is your turn now, with KDE Plasma, the default DE to Triskel. That will put your faith to the test, and your past missteps may be pardoned.

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

Many thanks to prospero and Magic Banana, I just tried on my Acer Aspire one with the version from prospero (to confirm with MATE desktop), I have the hibernate button and resume works, in spite of some additional scary messages probably related to the video card of this laptop.

For this laptop, thanks to a message I posted to this forum, I know that it was installed with the iso from January 24th, so I can confirm that, from the install with that iso, hibernate was not setup at all (neither in grub nor polkit), although I have the swap partition larger than memory.

Was there any update to the installer since that time to make the hibernate function and button available? I don't think I have any spare computer to make a fresh aramo install to check whether it works from the latest version.

prospero
Offline
Iscritto: 05/20/2022

I used the live ISO from the download page to install the Trisquel Mini system on which I successfully enabled hibernation, so this is probably a feature. I believe many distros disable hibernate by default because it may cause data loss if anything goes wrong at resume time. Having a button in the menu is not enough to make it work properly, but it is enough to send any unsaved data to oblivion, which is sad.

When in doubt about the installation date, I do: ls -l --time-style=long-iso /var/log/installer

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

I believe many distros disable hibernate by default because it may cause data loss if anything goes wrong at resume time.

If one is saving any file that is being edited before hibernate (as a computer user, I have been educated to compulsively press the keyboard shortcuts to save in every program that edits a document), what kind of "data loss" could there be?

Usually, I have at least 10 windows opened, often many more, and they are arranged in a way that they don't overlap, using multiple workspaces (fvwm pages actually, much better than workspaces). All of this takes time to start and arrange, hibernate saves that time for next start.

It happened to me more than once that I had to interrupt a session and it closed everything brutally, but I never noticed anything lost, so I am curious to know what could go wrong there.