hello i want this hibernate option like in opensuse/steam os when i try googling it i cannot find anything

  • Skull giver
    link
    fedilink
    21
    edit-2
    1 month ago

    Depends on your distro. You need to set up all the requirements for hibernation (like “enough swap space to store current memory contents + whatever is left in swap” and zswap doesn’t count).

    IIRC Fedora defaults to ZRAM instead of swap, so you probably need to set up a swap partition first. I don’t know if you need to disable ZRAM, but you probably need enough swap space on disk to store the contents uncompressed.

    You’ll also need to modify the kernel parameters/initramfs configuration to add the resume parameters in the right spots, or the system will hibernate but not try to resume your session on boot.

    Then there may be some selinux issues depending on if Fedora fixed them or not. I don’t think hibernation is supported by default on Fedora so you may need to tweak things like polkit files to get the permissions right.

    I believe running the command sudo systemctl hibernate should manually induce hibernation. You can use it to test if your computer even has the ability to hibernate before figuring out what permission tweaks you need for KDE. Make sure you’ve saved your work before trying that, though, as not all systems will wake from hibernation without further troubleshooting.

    You may also need to disable security settings like secure boot and/or kernel lockdown mode it hibernation might be refused.

  • @[email protected]
    link
    fedilink
    -31 month ago

    I’ve tried to get hibernation working on like 3 different distros. Followed tutorials exactly step by step. Never works.

    Linux doesn’t do hibernation. Anybody who says otherwise is not living in the same universe as me.

    • @[email protected]
      link
      fedilink
      51 month ago

      I’ve made it work on arch, debian and fedora, on a T420s, T480s, T14 AMD, MBPr 2012, each on luks2 + btrfs with systemd-boot, and it works flawlessly on all of them. the setup is super-involved and cumbersome though but it’s easily accomplished once you get the hang of it.

      the links posted here along with the arch wiki is what I used. it helps if it’s not your primary and only device, so you have time to retry until you get it right.

      • ChojinDSL
        link
        fedilink
        21 month ago

        Did you encrypt your swap as well? I used to use hibernation back in the day but without LUKS encryption. Ever since I’ve started using LUKS encryption, I never bothered with hibernation again, allthough I would like to.

        • @[email protected]
          link
          fedilink
          1
          edit-2
          1 month ago

          a combination; some have swap as a btrfs subvolume, some as a swapfile in root and those are encrypted, when the system boots it requests the encryption passphrase, regardless if it coldboots or restores. restores from swap are way faster than coldboot plus all your stuff is how you left it.

          on some systems I have a separate swap partition outside of luks2/btrfs and that one’s unencrypted. when it restores from there, it doesn’t request the passphrase and the boot is even faster. that’s obviously less secure but my threat model is a lost/stolen laptop, I seriously doubt someone’s gonna forensic the shit out of my swap, it’s more likeky it’s gonna get wiped and sold.

          to fully utilise this tech, it’s essential to set up suspend-then-hibernate, another awesome feature that’s way too cumbersome to set up. the laptop suspends for like 60 minutes and if it’s not woken up, it hibernates to disk.

      • @[email protected]
        link
        fedilink
        11 month ago

        Last time I had openSUSE hibernation didn’t work. I am just convinced that the entire linux community is gaslighting me about hibernation lol

      • @[email protected]
        link
        fedilink
        11 month ago

        how come opensuse has that button

        Having that button doesn’t automatically result in that feature actually working. The development stakeholders don’t seem to be interested in it actually working other than chance and given that even Windows and macOS moved to “always connected” suspend instead of full sleep with hibernation, I don’t see a push for feature parity on the horizon (that’s why Windows laptops and more recently also MacBooks often cannot wake up because the battery is depleted). It’s really bad and IMO one of the few big problems to solve (at least on my Windows notebook because of its broken regular suspend, I can force it into hibernation).

        I had somewhat decent success making a swap file (not a partition):

        sudo fallocate --length 16600MiB /swapfile;sudo chmod 600 /swapfile;sudo mkswap /swapfile;sudo swapon /swapfile;sudo nano /etc/fstab

        Then add /swapfile swap swap defaults 0 0 the fstab file now open in Nano.