Unable to suspend to disk remove power, then recover

Forum Forums New users New Users and General Questions Unable to suspend to disk remove power, then recover

  • This topic has 8 replies, 4 voices, and was last updated Dec 27-5:50 pm by wb8tyw.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #47957
    Member
    wb8tyw

      I have a laptop with Anti-X Linux and two desktop systems.

      With the Laptop and one Desktop, I have a full Anti-X system installed and I can click on Suspend and it shuts down the system so that it can be quickly woke up.

      However if power is removed from desktop or the laptop battery runs down, on the resume attempt the system cold boots instead of resuming.

      There should be a way to put the system in a suspended state that survives a power outage.

      The laptop lid-close button is also not working to suspend the laptop.

      On the system with out the full install, the suspend function is not working at all.

      #47963
      Member
      sybok
        Helpful
        Up
        0
        ::

        There should be a way to put the system in a suspended state that survives a power outage.

        According to this link describing different power-saving modes
        A) sleep (suspend/standby): OS state saved to RAM which needs to be powered (!) otherwise the information gets lost
        B) hibernate: OS state saved to drive
        C) hybrid: A+B, restore system state from whatever available with RAM having higher priority

        In the case of A), it does not survive power outage though it might in the case of B) and C).

        It seems that there is/might be an option in BIOS to resume after power outage.
        Remember to be very careful when changing BIOS!

        • This reply was modified 2 years, 4 months ago by sybok. Reason: Clarifying/Detailed description of the options A) through C)
        #47967
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          Hibernation won’t work with all PC’s and it can be tricky to get it all configured correctly even on machines that it works on. If you aren’t a Linux guru, the best bet is to install a power manager. XFCE Power Manager would be my first choice. I hope you created a swap partition at least 1.5 times the size of memory. If not, you either need to reinstall or add one, or use a swap file. I have added one before, but its a lot of work. I have one machine I’ve never been able to get it to work on. I can get it to hibernate, but never can get it to come back up.

          Don’t try any systemd related methods on antiX. That will fail for sure.

          There is also a manual way to do it. Obviously you need to be careful testing this… Try this from a terminal, suspend first, and see if you can get it to come back up. Then try hibernate. I have never had much luck with the hybrid one.

          sudo /usr/bin/pm-suspend

          sudo /usr/bin/pm-hibernate

          PS: on this machine I was able to suspend and resume, but if the battery dies, it will be lost. I was not able to hibernate. It started trying to save the image but hung up while trying to save it. I’ve found some machines need a different kernel, or programs. It hit or miss, and there are places that explain how to diagnose it, but sometimes I just haven’t been able to get it to work. To survive a power down situation, you need to hibernate the system before the power is gone. The hybrid solution creates the hibernation data, but then suspends. If the power dies, then you resume from the hibernated drive, and if not, you wake up from the suspended system. Many times things like Wifi and graphics have problems.

          • This reply was modified 2 years, 4 months ago by BobC.
          #47972
          Anonymous
            Helpful
            Up
            0
            ::

            Do the affected systems have sufficient swap space available?

            uswsusp
            might be useful (offhand I’m unsure whether it is pre-installed) (ummmm, provided by “pm-utils” package)
            https://wiki.archlinux.org/index.php/Uswsusp#Standalone

            #48012
            Member
            wb8tyw
              Helpful
              Up
              0
              ::

              I installed the uswsusp package on the desktop system.

              I got save to swapfile working by following the instructions for setting up the swapfile at the https://wiki.archlinux.org/index.php/Uswsusp#Standalone

              I am using /swapfile instead of a swap partition.

              Running sudo dpkg-reconfigure uswsusp and answering the questions got the /etc/uswsusp.conf created.

              The sudo s2both saves to disk.

              But something is still missing. Pulling the power cord on the desktop in that suspended state still results in a cold boot when power is re-applied.

              I do not know how to check how the initramfs built was built.

              The filenames in the archlinux.org link do not work on anti-x linux.

              It appears that there needs to be something in the initramfs that can restore the image saved in the swapfile.

              #48025
              Moderator
              BobC
                Helpful
                Up
                0
                ::

                https://unix.stackexchange.com/questions/434177/why-cant-a-file-as-swap-be-used-for-hibernation-in-linux

                https://askubuntu.com/questions/6769/hibernate-and-resume-from-a-swap-file

                In the ubuntu one, look under the heading “Hibernate with Swap file using uswusp” and note that at the end they rebuild the initramfs, then test it by running s2disk

                sudo update-initramfs -u

                sudo s2disk

                #48047
                Member
                wb8tyw
                  Helpful
                  Up
                  0
                  ::

                  I tried the sudo update-initramfs -u; sudo s2disk command.

                  It saved ram. I pulled the power on the system and on power up it cold booted.

                  #48054
                  Moderator
                  BobC
                    Helpful
                    Up
                    0
                    ::

                    Sounds like you are half way there.

                    This should be close to what you need. See if you did all the steps and check the files. It needs to be from instructions from before systemd

                    https://ubuntuforums.org/archive/index.php/t-2212893.html

                    #48209
                    Member
                    wb8tyw
                      Helpful
                      Up
                      0
                      ::

                      Thanks, I found my missing step for the initramfs setup.

                      I do not know why, but I could not find the “cat /etc/initramfs-tools/conf.d” file to modify when tried it before.

                      cat /etc/initramfs-tools/conf.d/resume
                      RESUME=UUID=f12e9c91-d804-4bb6-87cc-4d182023cd8b resume_offset=17137664

                      Once that file was created, and the sudo dpkg-reconfigure uswsusp run, then I can do a s2both, pull power from the desktop and then after power up it boots to a resume.

                      So it looks like the uswsusp from the Debian buster/main respository does not have the instructions to update the initramfs-tools configuration. So for better support this, an anti-x packaging is needed.

                      Apparently still missing parts:

                      * It looks like whatever monitors the battery or UPS power may not know how to do the s2disk when the battery gets too low.
                      * The system will still not suspend on the laptop lid being closed. I think I saw an article on how to fix that.

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.