• greenhorn@lemm.ee
    link
    fedilink
    English
    arrow-up
    7
    ·
    4 days ago

    I started down the Linux route over the weekend and put my computer in hibernation and couldn’t figure out how to wake it up from its torpor without restarting. So I’m going with suspension for the time being

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      When you say hibernation, do you mean essentially powered off?

      My understanding is that hibernation has always meant that the system is 100% off, but that when it next boots it can read from disk into RAM and then let you resume where you were before you shut down. I ask because “waking” a system in hibernate means turning it on, and it goes through the normal boot process. If it’s still on in some way, that doesn’t sound like hibernation to me. It sounds like “sleep” or “suspend” (ugh, but there are now annoying s<number> states that add confusion to all that.)

    • muhyb@programming.devOP
      link
      fedilink
      arrow-up
      8
      ·
      4 days ago

      Firstly, welcome :)

      Secondly, hibernation on Linux requires swap partition 2x size of the RAM. If you didn’t set it big enough or did not set at all, hibernation wouldn’t work. However if you set it correctly, there should be another reason to consider.

      If you are not sure, you can use this command on terminal to compare your RAM and swap sizes. free -m

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        According to the FAQ I found, you mostly don’t need double your RAM. Especially for systems with lots of memory, they suggest instead the swap should be the square root of the RAM if you don’t hibernate. If you do it should be RAM + SQRT(RAM).

        I’m not sure where the square root part comes from, but I think the general idea is that if you’re using more swap than that, you should just add RAM.

        I’m still trying to get hibernate working on Bazzite. I followed the instructions I found and got it to the point that “Hibernate” is showing up in the menu, and when I use that menu item it seems to be saving state, but on boot I can’t get it to restore my previous session. I suspect it has to do with the Bazzite / Universal Blue bootc weirdness, but I haven’t spent much time digging into it yet.

        • muhyb@programming.devOP
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          That’s interesting. I guess I understand now why my 2 GB swap can get filled rather quickly. After I read that FAQ, I delved a little more and found this. Apparently it’s not feasible to use hibernation if you have more than 64 GB RAM, well at least until we got much more faster SSDs it seems.

          Not the same but if you’re using KDE on Bazzite, KDE has a restore previous windows option (or something like that). You can use it until find a solution.

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            2
            ·
            1 day ago

            It looks like they say “not recommended” rather than “not feasible”.

            It’s annoying when there’s a doc like that without a date on it. That could be 10 years old now, and might not be taking into account NVMe drives.

            And yeah, I’ve been using “restore previous session”, but it’s annoying because it’s not restoring windows in their previous positions on their previous desktops. There is probably a way to enable it to remember previous window positions, but I’ve been trying to get hibernate working rather than poke at that. Besides, what I really want it to remember is my tmux windows and what they were running. That’s really not possible without hibernation / sleep / suspend.

            • muhyb@programming.devOP
              link
              fedilink
              arrow-up
              1
              ·
              1 day ago

              I guess not feasible was a strong word. I saw on a couple forums and it seems it takes around 2 minutes to hibernate if you have that much RAM, even with an NVMe. Probably that’s why it’s not recommended, which is understandable. Also it says Redhat 8, so it shouldn’t be older than 5 years.

              I checked and it seems Bazzite doesn’t support hibernation out of the box and you need to disable zram if you want to use it. Kinda weird to me but I never used an immutable distro before so maybe it’s related to that.

              • merc@sh.itjust.works
                link
                fedilink
                arrow-up
                2
                ·
                18 hours ago

                Yeah, I already disabled zram. I was following that web page.

                I think the issue is that I need to add resume support to the initramfs. Because it’s an immutable distro, I have to do that a bit differently. As for the zram and immutable distro weirdness, I think it’s also Bazzite which is designed to work on the SteamDeck and other portable devices. I remember reading something about their sometimes having low amounts of RAM so they do some weird things to make up for it.

                Anyhow, I’m going to try it tonight, wish me luck. :)

                • muhyb@programming.devOP
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  16 hours ago

                  I remember reading something about their sometimes having low amounts of RAM so they do some weird things to make up for it.

                  That makes sense. I was doing a similar but opposite thing when I was still using Windows. It comes with hibernate but I never used it so I was removing the swap equivalent of it every time I install it.

                  Well, at least have fun with it. Good luck! :)