Forum › Forums › New users › New Users and General Questions › How to hibernate / real suspend for laptops? No battery use
Tagged: battery saving, hibernate, lappies, laptops, low power mode, suspend
- This topic has 5 replies, 2 voices, and was last updated Feb 16-4:44 am by spaz.
-
AuthorPosts
-
February 13, 2023 at 7:28 am #99486Member
spaz
How to hibernate / real suspend for laptops?
Hi All.
I am wondering if there is some straightforward / easy / built-in way to send antix on a laptop into real suspend ie. HIBERNATE. (Perhaps hibernate is really the proper word).ie. an extremely low power mode – where battery drains extremely slowly, almost as if the laptop were actually turned off.
I am currently using an old thinkpad circa 2009 L410, but the battery is OK, and I would typically get more than a couple of hours out of it.
However, when I put it into “suspend” – the battery quickly drains within a few hours as if the laptop were still quite active (despite the “sleep” LED flashing and the screen and fans etc being off – and all indicators that the laptop is asleep).
At present, if I want to pack my laptop in my backpack for more than a couple of hours, I actually have to turn it off entirely so the battery doesn’t drain!
Which is quite annoying of course, especially when I have to go through the full boot and disk decryption every time.In other linux systems,
I run the command “sudo systemctl suspend -i”
but for some reason this does not want to work in antix
terminal returns :
bash: systemctl: command not found
which is very strange to me, as it has always worked for me elsewhere.
(This may not be hibernate though, and to be fair, I use this command on desktops).I’m happy to make nano / cat alterations to any config files if there is some way to enable an actual hibernation.
My swap file is about 2GB on a 4GB system, but I am not a resource intensive user,
so I would think a hibernate would be practical with my current setup.Thanks very much for any input / assistance!
February 13, 2023 at 9:51 am #99490MemberRobin
::My swap file is about 2GB on a 4GB system
1.) Make sure to have a swap partiton of double size of your amount of RAM to allow proper hibernating. So resize it to 8 GB on your system. (Might work with 6 GB already, check out yourself the lowest limit working reliably.) When hibernating it must take the complete RAM content plus what was outsourced to Swap before already.
2.) Make sure this swap partition is ONLY used by this very instance of antiX, not by any other OS or antiX USB stick you might have in use.
3.) Enter the command
pm-is-supported --hibernate; echo $?If it’s output is 0 (Zero) your system supports hibernation. If it returns a 1 (one) this means, hibernation is not supported.
For me on antiX 21, 22 and 23 the command returns hibernation is supported out of the box.To actually hibernate enter
sudo pm-hibernateCaution! Some systems refuse to come back to life after hibernation, then you’ll need some further testing. Common reasons are incompatible or broken graphics drivers. (On antiX 17 I had to learn I could only successfully resume from suspend or hibernate when using proprietary nvidia drivers. Have not checked with most recent nouveau driver by now. You might experience similar issues with other graphics device manufactuerers) If resume fails, it is a good idea to check with different kernel versions. Some might fail resuming, others might work.
Windows is like a submarine. Open a window and serious problems will start.
February 13, 2023 at 9:55 am #99491MemberRobin
::In other linux systems,
I run the command “sudo systemctl suspend -i”
but for some reason this does not want to work in antix
terminal returns :
bash: systemctl: command not foundantiX doesn’t make use of this specific way of management. Try instead service command to control system services, e.g.
sudo service --status-all
See man service for details. For most services there are available sub commands like service xy status/start/restart/stop which are documented at the respective service script or program.Windows is like a submarine. Open a window and serious problems will start.
February 14, 2023 at 7:40 am #99544Memberspaz
::Hey Robin!
Thanks very much again.
I meant to thank you for your awesome help/explanation with Samba too.
I wrote up a PM to send you….
but it doesn’t seem like PMs are an option on these forums, and my thread was closed.
anyway….
Thank you for taking the time for that – I learned a lot about how to think these things through,
and it was my first experience with “dependecy hell”.Back to this thread…
My system supports hibernate.
I have experienced systems not waking from hibernate on a desktop – similar to you with an NVIDIA card.
On my desktop: I swapped the NVIDIA out with an ATI Radeon and works fine (:
No more NVIDIA and their closed source bullshit when I have other options.For my laptop in this thread:
I have confirmed it supports hibernate, per your instructions.
pm-is-supported –hibernate; echo $?
this returns 0.However, when after I put it into hibernate – by running
sudo pm-hibernate…when I awaken the laptop :
it is as if it was starting freshly from a poweroff.
I have to decrypt the encrypted drive,
no applications are open etc.…So:: I suspect I do not have a large enough swap.
I will try and expand it – and see how it works.When you say (in your second post) ::
“antiX doesn’t make use of this specific way of management.”Which “specific way of management” does it make use of?
Is this in reference to init system related things?
Is it related to differences between system-d and whatever antix22 is using (runit or openrc I guess?)I ran :
sudo service –status-all
and it returned some interesting results about what was enabled and disabled (:Thanks again!
February 14, 2023 at 9:22 am #99558MemberRobin
::I have to decrypt the encrypted drive,
Try this with an unencrypted system first, e.g. from a Live USB stick.
The encryption easily might cause wakeup fail, probably you need some additional strategic steps to make it work. Search for instructions about luksSuspend and luksResume commands which probably need to get executed before suspending or hibernating and during wakeup process of an encrypted system. Sorry, I don’t know anything about this, since I don’t run encryption.
Which “specific way of management” does it make use of?
Is this in reference to init system related things?antiX uses by default sysVinit in all versions up to 22 (in case you didn’t install from the separately provided runit-ISOs). On antiX 23 runit is the default, which needs different methods of service management I don’t know myself by now.
Since you get sensible results from the sudo sercice -status-all command you are running sysVinit obviously, (on antiX 23 the service command will come up with lots of warnings instead: „warning: … unable to open … file does not exist”).
Some examples how to make use of service command on antiX running with sysVinit:
sudo service cups status sudo service cups stop sudo service cups start sudo service bluetooth status (start, stop, restart, status, etc. ...)The commands accepted may vary among different services. The minimum provided is start and stop, which are always present, as you can learn from man service.
Same procedure with e.g. acpid, saned, smartmontools, smbd, timidity, etc. …
There is an entry in antiX control center, section „System”, named „Chose Startup Services” (wording might not match precisely, I always have to retranslate back to English) where you can simply check boxes to enable/disable and start/stop services in. It reads in its headline when opened: „SysV Runlevel Config”.
Windows is like a submarine. Open a window and serious problems will start.
February 16, 2023 at 4:44 am #99676Memberspaz
::Hi Robin.
Ah, encryption might be boggling it up.I will certainly read up on those LUKS topics.
——-
I have not even heard of sysVinit.
I will be looking up all the various uses of the service command.It looks like a very handy basic tool to have in the toolbox.
I will try and familiarise myself more and start using it.
Thank you!
The basics for starting and stopping are very useful as a first starting point.There a quite a few things for me to learn just in your post —
as seems always the case in your posts! (:“Startup services” has equivalents are across operating systems,
I always use that, but the command line toggle of various services is great as a troubleshooting tool.
I will use it!Realistically, booting the laptop from an off-state doesn’t take too long –
between 1 and 2 minutes – so it’s not too bad for the added security of an encrypted disk.I’ll see what I can do with those LUKS topics though for sure!
Thank you again!
-
AuthorPosts
- You must be logged in to reply to this topic.