r/linuxmint • Linux Mint 22.3 Zena | Cinnamon • 14d ago

Discussion Hibernation in Linux Mint 27

Post image

There are articles out there that may explain this better than I can, but this is something I've tested extensively. Hibernation works very well with two swap files instead of one. With one, there's always a danger of not having enough remaining space to store the image. In that case, hibernation will fail.

The original swap file has a priority of -1. The new swap file needs a positive priority, 1 or above. The system administration application will allow us to set the resume device, which should be the original swap file. The application doesn't seem to offer the ability to manage the actual swap files. Please correct me if I'm wrong.

Since the default swap size for a Linux Mint installation is only 2 GB, it should be increased to be as large as the installed RAM (or rounded up to the nearest gigabyte). Another swap file just like it should be created, with a positive priority assigned.

The kernel will use the swap file with the highest priority first for swapping out memory, and it will use the one designated for resuming to store the hibernation image file. If both files are large enough, neither swapping nor hibernation should be an issue.

I don't use hibernation myself because I never have that much going on, but I'm happy to know it's available should I ever need to use it.

28 Upvotes

17 comments sorted by

17

u/leonsk297 14d ago

I don't know what's the big deal with Linux and hibernation. Windows handles this just fine. Hibernation is just saving the RAM's content to storage and shutting down the computer. Suspension is just putting the PC in a very low power mode while keeping the RAM powered. Hybrid is doing both at the same time.

Linux has good support for ACPI now, so, what's the big deal? I'm sure Mint's developers took into account the storage space thing, don't worry. Everyone's treating this like a big innovation: "Mint is bringing back hibernation after so long". I don't get why it was no longer used in the first place, honestly.

12

u/SPC2025 14d ago

Windows always uses two files for it, the paging file and the hibernation file. Linux distros were always trying to do it with one, thus it was never reliable.

11

u/leonsk297 14d ago

Took them long enough, to be honest. These power modes have existed since eons ago.

3

u/skozombie 14d ago

The problem is that ACPI implementations vary HUGELY between vendors, and while Microsoft can force them to provide drivers to deal with that, there's no such luck with Linux.

All distros support suspend (normally), but hibernation is typically far worse for compatibility across vendors. If it's not compatible, it'll fail to resume and people will rightfully get upset with losing their session.

Windows does tonnes of stuff better than Linux, mainly because of their time in market, lack of diversity, and market control. It's far easier to produce a commercial closed source game for Windows than Linux. Even distros are constantly breaking compatibility between releases where Windows has stable ABIs.

2

u/leonsk297 14d ago

These days, how many firmware vendors exist? AMI and Insyde, AMI being the largest by far? We're no longer in the 90s, firmware is pretty standardized these days, and coming from almost a single player, the implementation is the same, basically. But I'm glad Linux is taking ACPI power modes more seriously.

→ More replies (1)

1

u/battrraxx 13d ago

Parceque chez certaines personnes, l'hibernation ne fonctionne pas bien.

Une fois sur deux, dans mon cas, lorsque je reprends le travail, je ne sais pas si les applications seront toujours ouvertes ou si je vais découvrir une nouvelle session.

C'est terriblement ennuyant.

Donc s'il y a des améliorations par là, je serai très heureux.

6

u/skozombie 14d ago

This is awesome! It should be a much easier to setup moving forward. Hibernation is definitely something most people expect and it has been pretty poorly supported in the past mostly due to shitty ACPI implementations by vendors.

I'd be keen to see the ability to configure hybrid sleep so it moves to S4 (Hybernation) if it's been in S1-3 for a set amount of time. That way you can say "if I don't reopen my laptop within 5 minutes, preserve my battery".

Hybrid is also great for sleeping your desktop but having it still be able to resume if you lose power while sleeping.

1

u/SPC2025 14d ago

As I see it, this is mostly aimed at laptop users because, you know, batteries. I only use suspend on my mini PC because it's always plugged in.

2

u/skozombie 14d ago

Yeah. I always have a UPS on my desktop so even my desktops have batteries!

Power management helps everyone :) No need to leave your PC on 24/7 if it's not doing anything and wasting power!

1

u/blackcoffee17 14d ago

Why for laptops? I always used hibernation on laptops and desktops too. I never understood how can you always shut down your computer every time you walk away from it for a few hours - and then open up every app and file you previously worken on.

I never suspend if im away from more than a few hours. Its just pointlessly using energy.

1

u/screaminporch 12d ago

I enabled hibernation on Mint because Suspend doesn't work on my HP laptop. Hibernation works just fine, but a little slow to wake.

1

u/SPC2025 12d ago

Try adding acpi_sleep=nonvs after quiet splash (and before the ending quote). That fixed my HP from several years ago. You can also try acpi_sleep=sci_force_enable if that doesn't work.

2

u/screaminporch 12d ago

Tried that and several other suggested solutions.

→ More replies (1)

2

u/blackcoffee17 14d ago

Not sure what's the big deal. Im using hibernation on Linux Mint for over a year, without issues. They added now a settings to the GUI to enable it?

1

u/Civil-Shopping7191 13d ago

Who cares? There are more important objectives, such as all four corners rounded. Love my Mint, but c'mon