Okay, killed by Ubuntu is an exaggeration, as Ubuntu is not the only Linux distro doing this.

Still, the big news is that Linux Mint is bringing hibernation back.

In a recent blog post, the Mint team previewed a new Sleep Modes page in the System Administration tool. It’s meant to make enabling hibernation and setting it up correctly easy, without you editing config files by hand. The feature is planned for the upcoming Mint 27 release coming in December.

Mint hasn’t magically fixed the problems that made Ubuntu drop hibernation. What it does is give you the choice, along with two hybrid modes that sit between suspend and hibernation.

Hibernation vs suspend: What’s the difference?

Both features are about saving your session, which simply means everything you have open like your apps, windows and documents.

When you suspend (also called sleep), your computer keeps your session in RAM and powers down almost everything else. Waking up takes a couple of seconds. The catch is that RAM needs power to hold that data, so a suspended laptop keeps draining its battery.

If the battery dies while suspended, your session is lost, along with any unsaved work.

Hibernation copies your session from RAM to your disk and then powers off the machine completely. It uses no power at all. When you turn the computer back on, the session loads back from disk and your apps and windows are exactly where you left them.

In short, suspend is fast but needs power. Hibernation is slow but survives a dead battery.

Why Ubuntu and other distros dropped hibernation

Ubuntu disabled hibernation by default back in Ubuntu 12.04, I think. The reason was that it was unreliable slow, and that having two suspend modes confused people.

Every Ubuntu-based distro, including Linux Mint, inherited that decision. Actually, it’s not just Ubuntu. Many other Linux distros also do not offer hibernation option anymore.

Speed is indeed a problem. Writing gigabytes of RAM to disk and reading it back can take longer than a full reboot, especially on older hard drives.

Hibernation also needs a lot of swap. Your swap space has to be at least as large as the RAM in use so the whole session fits. Ubuntu ships a small swap file by default, and Fedora uses zram, which lives in RAM and is useless for hibernation.

Then there’s Secure Boot. With Secure Boot enabled, the Linux kernel runs in lockdown mode, and lockdown blocks hibernation because the saved image on disk isn’t signed and could be tampered with.

Since most new computers ship with Secure Boot on, hibernation simply doesn’t work for a large chunk of users. This is one of the main reasons Fedora Workstation doesn’t offer hibernation out of the box either.

The three sleep modes in Linux Mint

The new Sleep Modes page gives you three options. You pick the one that suits how you use your computer. You can enable all of them and choose which one to use from the power menu (at least that’s what it looks to me).

New sleep modes in Linux Mint 27

Hibernation

This is the classic mode. Your session is saved to disk and the computer shuts down completely, using no power. It’s slower than suspend and can take longer than a reboot to hibernate and resume.

Hybrid Sleep

Hybrid Sleep suspends your computer and saves the session to disk at the same time. Most of the time, you get the quick wake-up of suspend. If the battery runs out, you’ll need to plug in the charger, but your session is still there to resume from disk.

Suspend-then-Hibernate

This one suspends first and switches to hibernation only when the battery level gets critical. I think this is the most practical option for laptop users. You get fast resume in normal use and a safety net when the battery is about to die.

What Mint’s new sleep mode doesn’t fix

None of this removes the old limitations. You still need plenty of swap, and the tool flags a lack of swap as a problem. If Secure Boot is enabled, the tool lists it under Detected Problems. The good thing is that the tool writes its settings to its own systemd file, so you can turn these modes on and off without messing up your system.

I like how Mint takes a subtle approaches to “new features”. Not every new feature needs to have AI in it. This is not a shiny new change but it’s one of those changes that everyday Linux users are likely to use. Am I right?

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    There was a post recently asking about doing hibernate with secure boot + LUKS + TPM and it is actually possible and still pretty well supported, but it does mean you have to go through the lengthy setup yourself.

    The one real modification you need is to use a kernel patch that sets a flag that allows hibernation images to be loaded in lockdown mode since using LUKS effectively mitigates the issue of image tampering.

    Tbh I think its been long overdue as a returning feature because Linux has certainly grown a ton in the Laptop space where the battery save is a huge difference in sleep vs hibernate.

    • Feathercrown@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      12 hours ago

      Yeah, the writing style is really weird. Not the traditional “AI voice” though. My instinct is that it’s someone with a weird personal style, but I would also believe you if you told me it was AI with a prompt to try to emulate a particular style.

  • Elvith Ma'for@feddit.org
    link
    fedilink
    English
    arrow-up
    19
    ·
    2 days ago

    Then there’s Secure Boot. With Secure Boot enabled, the Linux kernel runs in lockdown mode, and lockdown blocks hibernation because the saved image on disk isn’t signed and could be tampered with.

    I wonder… how does Windows solve that problem?

    • 9tr6gyp3@lemmy.world
      link
      fedilink
      English
      arrow-up
      19
      arrow-down
      1
      ·
      2 days ago

      It doesnt need to be signed if the hibernation file is stored on an encrypted disk. They use a combination of TPM and Bitlocker to protect the disk that the hyberfil.sys file is stored on.

      Honestly, its probably possible to do the same in Linux, but I cant confirm that.

      • Elvith Ma'for@feddit.org
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 days ago

        I do use secure boot, I do dual boot (rarely, but Windows is not yet deleted). My windows partition is not encrypted. Still Windows does allow hibernation. And reports a clean secure boot state afterwards.

        • 9tr6gyp3@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          1 day ago

          Im sure it allows that, but if your disk isnt encrypted, any files you have can easily be tampered with just by running a live boot environment from a cd/usb, or by transferring the disks to another machine.

          Secure Boot verifies the kernel/system has not been tampered since the last system update occurred. During that process, the updated files are signed against your UEFI firmware. If an evil maid has access to your files, they can replace the kernel/system files with malicious versions, then re-sign against your firmware, and you would never know the difference.

          Thats why it’s important to encrypt the data stored on disk and have your UEFI BIOS secured with a password. Makes it so evil maids cant easily create/delete boot keys and tamper with your Secure Boot, or change the boot priority to a live cd/usb.

    • Quibblekrust@thelemmy.club
      link
      fedilink
      English
      arrow-up
      10
      ·
      2 days ago

      Windows uses a separate hibernation file. When it writes to the file, it adds checksums to verify integrity when it’s read later, but that’s it. No encryption. If you want your data to be safe, you need to use full-disk encryption.

      • Elvith Ma'for@feddit.org
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 days ago

        So as always - MS imposes the rules like Secure Boot and then gets to break them for convenience.

        They already require a TPM. They already use it to manage keys. Why not set up a key for bitlocker for that one specific file?! Or at least sign the file header containing the checksum with a key from the TPM?

  • WhiplashPost@programming.dev
    link
    fedilink
    arrow-up
    12
    ·
    2 days ago

    i can put my laptop into suspend and lose maybe 2% of battery per day at most. So hibernation seems a bit unnecessary. Maybe if your RAM is less efficient or something? Idk.

    • esc@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      You haven’t had an experience with modern suspend, at best you’ll get 10% by morning, probably it will just discharge completely in 5 to 8 hours.

      • WhiplashPost@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        15 hours ago

        Well idk what about my setup isn’t modern? I guess my laptop is a few years old but its not that old. 2020 model. and I run debian stable so not bleeding edge but not crazy. My laptop is just one that ships with an ubuntu option and so it has good linux compatibility in general. So that probably helps.

        • esc@piefed.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          12 hours ago

          Newer laptops have a different sleep mechanism called modern suspend (s0ix/s2idle) it doesn’t work at all, you can find your laptop hot as hell and almost discharged after a few hours of sleep. Or it will just never go into sleep.

          • WhiplashPost@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            9 hours ago

            that is what my laptop uses. Why mine works and yours does not is very complicated. I looked into it a bit. Firstly, my laptop is a Dell Latitude 7400 (non 2 in 1 model). This supports both modes, but mine is configured to use s2idle. One of the huge pluses of this laptop is that is had a stock Ubuntu option when it was sold. You could get it shipped to you with Ubuntu preinstalled. Now, I don’t use Ubuntu I use Debian but the Dell firmware is still configured to support Linux out of the box. So Linux isn’t being treated as a 2nd class citizen for this laptop. It’s getting the VIP treatment just like Windows.

            Another thing is my actual configuration. Thermals prior to sleep matter a lot. If you laptop is too hot it will fail to enter the sleep state it needs to. Meaning it stays hot and continues to run and dies fast. I have heavily modified my laptops thermals. I have the CPU capped at 2.5Ghz, I have tlp running, and I have high quality thermal pads added inside the chassis to spread heat around to the magnesium back plate. Because of these mods my laptop does not use its fan, and the CPU hovers around 50C passively while in use. This means I never have a problem with suspend due to thermals.

            I also have components, like my SSD, that are modern and support deep sleep states. My SSD is a WD Black SN770 1TB. Which is both pretty power efficient and supports deep sleep states.

            Another thing is that the tlp and powertop tweaks are preventing wakeup triggers that would pull it out of suspend. and of course the last big thing is just that I keep my firmware up to date. Dell released firmware specifically to fix modern standy issues and I have that update. Dell ships easy firmware updates to linux users and you can install them with a few clicks and a reboot. Another advantage of the Linux native support.

            Really can’t reccomend the laptop enough if you want a used business class machine its great and you can find them for 200ish$.

    • klangcola@reddthat.com
      link
      fedilink
      arrow-up
      18
      ·
      2 days ago

      There’s also situations where you want the computer to be truly off (without loosing your open documents etc), to the point where you can take out the battery and it’s no big deal.

      Also, for work my fancy new computer has fancy new “modern suspend”, which isn’t actually suspend at all. The fan is still spinning and it’s generating lots of heat. Not great in backpacks and certainly not great in industrial field work where there are areas where non rated powered electronics are not allowed due to potential explosive atmosphere.

      Meanwhile hibernate is still hibernate. The computer is actually fully powered down.

    • psud@aussie.zone
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 day ago

      I have a laptop I use sometimes every day, sometimes not for a week. Hibernate on critical battery would save the things that get lost when it batteries out on suspend

  • logana@lemmychan.org
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    “This classic feature”

    Jesus fucking christ. What is wrong with people and the clickbait bullshit? Just say what it is, morons.

    • psud@aussie.zone
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 day ago
      1. It’s slow
      2. People don’t understand the difference between suspend and hibernate, so fuck the people who do
      3. It’s incompatible with secure boot
  • absGeekNZ@lemmy.nz
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 days ago

    Suspend-then-hibernate sounds great; just need swap to be equal to RAM size…not a major problem; I already have that.

  • Anas@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Good timing, this should be helpful until I get a replacement for my laptop’s dead battery.

  • NotSteve_@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    2 days ago

    I was hoping for the global menu :(. I have it on KDE now but I’d love to see a full comeback

  • tuckerm@feddit.online
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    I hadn’t really thought about the fact that Ubuntu (and many others, apparently) don’t have hibernation. I switched to Debian about a year ago, and I wasn’t sure what the Hibernate button did when I saw it for the first time. But after I searched to find out, I started using it all the time.

    • Dultas@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Most don’t have hibernate enabled because you’d need a swap or swapfile large enough to hold the full memory state. And with the larger ram sizes and sleep being good enough, at least until everything became s2idle only, no one wanted to set up a huge chunk of unusable disk for it.