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

You are viewing a single thread.
View all comments
-3 points

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.

permalink
report
reply
1 point
*

How were you setting it up? Maybe you just always made the same mistakes.
From memory, this is how I did it last time:

  • create swap partition of RAM size
  • put that in fstab, reffered to by PARTUUID
  • activate swap with swapon -a, or just reboot
  • edit bootloader config to have resume=PARTUUID=yourpartuuidxxxxxxxxxxx in the kernel parameters list. Be sure to edit the right file, not one that will be overwritten. For GRUB2, this is /etc/default/grub I think.
  • if the bootloader’s config system works like this, regenerate the complete config. On openSUSE, the file mentioned above has a comment at the top with the command you need to use. It’s something like grub2-mkconfig -o /boot/grub.cfg but do not copy this command because it’s probably inaccurate
  • save your work while you’re unsure if it will work
  • test hibernation

I have done this on 2 PCs already.
If you have garbage hardware, like a chromebook that only allows expandable storage through a micro SD card reader, which can randomly lose its mind so that Linux resets it on resume, then it may not work ever or only unreliably. But with SATA connected storage you shouldn’t have this problem.

permalink
report
parent
reply
3 points

how come opensuse has that button

permalink
report
parent
reply
0 points

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

permalink
report
parent
reply
2 points

oh

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply
1 point
*

I used Hibernation in the past (years ago), but nowadays I don’t. It also depends on the BIOS configuration and probably the motherboard. There was a period (on a different distribution and probably something different hardware, can’t remember details) when the Hibernation did not work. I mean Hibernation to suspend to disk and shutdown PC entirely. I’m actually curios if it works for me right now and will test it. :-)

Edit: Ah okay, it can’t work for me, because I set a very small swap. Never mind.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
1 point
*

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.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 7.9K

    Monthly active users

  • 3.7K

    Posts

  • 48K

    Comments