I use Ubuntu btw. Poweroff could use more write cycles on the SSD because it has to read everything at startup, but suspend has to keep supplying power to the RAM
My work machine (Ubuntu) gets suspended at the end of the day during the week and shut down on Friday. It’s a good balance between keeping my many programs running and ready and cleaning up regularly.
I always shut down my desktop pc (Arch, btw) as it takes just a few seconds to boot up.
My laptop (Arch) I shut down because suspend never worked.
Nearly always suspend. It just works for me and I’ve never had issues (Arch and Pop). I rarely, rarely have power outages so the end result is the same.
I poweroff. I have enough time to let it turn on and can save some energy. (Electricity is getting even more expensive)
I use the hybrid: suspend to ram, then after 2 hours, automatically suspend to disk - in the final state it uses zero power. And, if you have encrypted your drive (you DO encrypt your drives, right?!) then you need to enter passphrase on resume from hibernate, so safer if device was nicked.
whatever happens when I click shut off or the power button on my pc
Haven’t needed it to, I guess even after kernel updates you can log off and log back on to set the changes.
Sorry, but to clarify no. When your kernel updates if you just log out and log back in you will still keep the same kernel version because linux keeps running a program on same version until you completely turn the program off.
That’s why with the kernel and kernel modules you need to completely restart your system for the kernel to shutdown and use the updated version, it’s just the way that linux works.
Hell you can even use a program after uninstalling it until you close it for a year if you wanted to ( once untistalled my termninal emulator, but still had it’s window opened so just reinstalled it an hour later after realising I can’t spawn a new terminal window )
There is live (kernel) patching which circumvents the need for a restart. But that is meant for servers were you cannot afford the downtime and will only work for a while. Sooner or later you will have to restart to get the latest patches.
Correct me if I’m wrong: sudo user and kernel updates can take effect¿
To be honest the experience over multiple laptops and multiple Linux distributions with regards to suspend or hibernate has been absolutely terrible for me. I now set my browser to remember all my tabs and simply shut down my machine when I’m not issuing it. It starts up in 30 seconds or less which is maybe 15 seconds more than waking from suspend or hibernate and it’s not likely to break our require complicated set up.
🤷
Yeah, because of the same experience for the last 2 decades, I always shut my stuff down as well.
Then I gave an old laptop with Linux to my neoprene. And without further discussion or thinking, he just pressed the power button, when he wanted it to be off - which triggered some kind of sleep mode
I was so fucking nervous during that, as I had never tested for that, and for the young generation growing up with smartphones that was the obvious move.
But surprisingly it works like a charm and goes into some kind of standby.
At least I didn’t got any complains…Isn’t neoprene a synthetic material?
My husband also uses the power button to power off his PC. I didn’t even know it was a thing until he asked me to do it for him at some point and I was very confused. He’s on Windows. I didn’t know this worked on Linux as well (though I know it’s a thing on laptops). Is there a way to configure what it does (on PC) like it does on laptops?
Ah, fucking auto correct
Should have read: my nephew ;-)
Edit: and regarding your question:
Yeah, there some power management tools/deamons to configure in Linux, how to handle what.
Depends a bit on your distribution/environment, which tools are available - or make sense to be installedIIRC in the UEFI (aka BIOS), there’s usually a setting to dictate what a tap of the power button does—usually sleep, hibernate, or power off.
Try tapping F10, F12, or Del during early startup to get into the UEFI setup
Thanks for the tips! I’ll have a look!
I was trained to turn off PCs completely from a young age so still do this, necessary or not
Power off. I never used hibernation (even on Windows) and as I don’t use some of my computers for weeks, it just doesn’t make sense to keep them hibernating for so long. And now that I’m on Fedora Atomic Desktop with auto-updates, I would have to reboot regularly anyway in order to apply updates.
Only exception is the Steam Deck for which I kept suspend so I can pick up my games where I left off.
Hibernation is, in fact fully powered off.
Oh right, I confuse the two
I power it off to save electricity
Depends.
My desktop gets powered off because I don’t use it often and it sucks a lot of energy and is loud.
My Steam Deck gets suspended when I’m not using it because that’s usually in the middle of a game and I don’t want to hear the game sounds all the time or accidentally do something.
My laptop is running 24/7. At night I use it to listen to science videos to help me sleep. And in the day I watch stupid YouTube videos to help me cope with life.
Not to mention the steam deck has a weird bug on it that if you leave it powered off for too long, for some reason it decides to just not turn on anymore unless you hook it to power. Super annoying because it will turn on and say something like 80 or 90% power, but the button won’t actually boot the system unless it has a power hookup. I’ve on a few occasions had to use reverse power charge from my phone to the deck to trick it into booting on the go. Once you hear the beep saying its turning on you can unplug it. Weirdest thing
I think that has something to do with battery storage mode flipping on iirc.
suspend has to keep supplying power to the RAM
When I close my laptop’s lid, I have it set up to suspend for five minutes, then hibernate.
That lets me close the lid and move the laptop to somewhere nearby without using much battery power, but if it gets left closed for long, the thing will hibernate, so it won’t drain the battery.
That’s
HandleLidSwitch=suspend-then-hibernate
in /etc/systemd/logind.conf, andHibernateDelaySec=300
in /etc/systemd/sleep.conf.Any other system just gets shut down.
I just keep my laptop on for weeks on end, until the kernel updates or something else that needs a restart, last 6 months I prob only turned it off 7 times.
And no, I don’t really feel any effects cause it’s linux which doesm’t get clogged up like windows and power usage just idling is the same as just suspending.
Also personally don’t use stuff like suspend or hibernate ever. Even have them completely disabled on my systems.
Note: I’m on nixos not ubuntu tho.
Maybe there’s not a huge difference, but the power usage of suspending is definitely lower, since only the RAM is getting power. CPU and disks have some idle power consumption, and you can have some background processes that wouldn’t be executed while suspended.
This assumes you have a machine which supports proper S3 sleep, which newer devices increasingly do not :(
A lot of modern laptops only support S0 “modern standby”, which basically means the kernel puts all processes including itself on pause, but the CPU and all other components are still powered despite being idle.
Depends on what you run on your system, but when my system idles my cpu is at literal 0%, ram at 600mb and disk usage is 0% (nvme), which ends up my total power usage to about 3W on idle or something like.
It’s a laptop so doesn’t use a lot.
I rip the plug out of the wall without warning. Gotta keep your machines on their toes or they’ll get too comfortable and start plotting against you.
I’ve had to start counseling sessions with my MongoDB. It thinks I’m conducting stress tests, but really I’m just maintaining discipline.
Else it gets the cord again
Yeah! Show them who’s boss.
I know a real professional when I see one!
I use suspend-then-hibernate on my laptop (arch). It has a Nvidia graphics card, so it gives problems sometimes, but it mostly works fine.
I set it up like that in case I disconnect the laptop, so it will hibernate before running out of battery; it will also hibernate after 16h of being suspended (to save power), but I usually turn it back on before that.
I like suspending because my laptop has an HDD, and it is way faster to turn it back on this way.
Maybe cause I’m old but boot times are so quick if I need to move i just shutdown throw it in my backpack and go. I don’t want it on in any fashion while in my bag and hibernating to disk means all my shell sessions and anything else disconnected anyhow.
hibernating to disk means all my shell sessions and anything else disconnected anyhow.
If you can run
tmux
on the remote system, can manually reattach when you reconnect.If you use the UDP-based mosh instead of the TCP-based
ssh
— it uses ssh to bootstrap auth, then hands off to its own protocol — (a) the system can use local prediction in some cases, leaving it feeling snappier, but also (b) the thing will automatically reconnect and resume sessions. I mostly find it useful on flaky/slow links, but it is also kind of neat to just close a lid, and then pop it open again days or a week later and then just resume working without any user-visible disruption.I do use tmux daily and have a session that connects to most my other sessions.
Finally got around to playing with mosh today and with it using ssh for auth it was so simple to setup. It actually works really well!
Thanks for the recomendation