Spyke
asklemmy·Ask LemmybyLena

Do you use poweroff or suspend on your Linux systems? Why?

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

View original on gregtech.eu

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.

122

I've had to start counseling sessions with my MongoDB. It thinks I'm conducting stress tests, but really I'm just maintaining discipline.

11
swg-empire.de

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.

47
Pikareply
sh.itjust.works

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

7

My laptop, I'd just suspend to RAM, unless I was going somewhere without it for a couple of days or more.

The desktop is always on. The monitors suspend, but everything else is sucking power. I expect with frequency scaling, it's not as bad as it used to be, but then, in ye oelden days I didn't do nightly backups to the cloud and disc, or sync data between servers and run other odd, automated jobs.

5
Zettareply
mander.xyz

I am trying to be more energy conscious so I've been turning mine off more as of late, but ya in the past I typically left my machine up for 7 - 14 days and only power off/reboot after updating.

4
stringerereply
sh.itjust.works

I remember older gaming forums where people would have their uptime in their post signatures.

Edit to add: upon reflection it was all the more impressive because almost all gaming PCs were Windows.

3
talreply
lemmy.today

https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs

Microsoft Windows 95 and Windows 98 had a problem with rollovers in a virtual device driver, VTDAPI.VXD, which used unsigned 32-bit integers to measure system runtime in milliseconds; this value would overflow after 49.7 days, causing systems to freeze.[93]

The horrifying thing here isn't just the bug, but that this made it into two major releases of Windows because the system was sufficiently-unstable that it wasn't tracked down for years.

One area where desktop computers have come a very long way in the past 30 years is in OS stability.

1

That was my reaction, to the question, too.

I'm not sure what power down options my current (Linux) OS has. I just let the battery die sometimes like a normal person.

Edit: The battery management defaults are so good, I have to forget about it on a shelf for several days before it - well I don't know what it does, because I'm ingoring it. Maybe it powers down, maybe it suspends, maybe it does some kind of emergency shut down...

3
feddit.nl

I always power off any computers that I won't be using anymore for the day. Be it desktops or laptops. My parents always taught me that leaving devices on (or even connected to power) when not using them was a fire hazard. Although I think it's a bit overblown, powering off anything I don't need has stuck as a habit and I see no reason to change it. With SSDs the startup time had become fast enough to make me stop caring. The wear and tear on the SSD is also not that big of an issue. My laptop and its SSD are from 2014 and have been subjected to the worst of my programming abilities, yet they still function fine.

31
feddit.org

Even without considering any firehazard I simply enjoy starting from a clean slate every time I start a pc.

19

Yeah that as well. Same with my browser. I tend to configure my browser such that it clears all open tabs when closed.

3
lemm.ee

I'm in the habit of powering off so that if my laptop is lost or stolen I will have the peace of mind of my data being in an encrypted state.

23

I hibernate for exactly that reason. Just have to ensure your swap partition is inside your crypto container.

4

Power-off.

The read-weakening has almost no effect, and I like a clean boot.

Also it cleans up memory, modern kernels are good, I'm used to old OS's that leaked memory like a sieve.

15

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.

13
Sneezycatreply
sopuli.xyz

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.

5

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.

2

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.

2
feddit.uk

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 or require complicated set up.

🤷

9
naeapreply
sopuli.xyz

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 nephew. 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...

1
Pandareply
lemmy.today

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?

2
naeapreply
sopuli.xyz

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 installed

2

Haha, to be honest it took me a bit to figure out you might have meant nephew. XD I must admit I even looked it up to see if there was a different meaning to the word that I didn't know about. :'-)

Thanks for the tips. I do vaguely remember seeing a setting somewhere but I think I'll need to look into it more when I'm more awake (it's past midnight here).

1
smortreply
lemmy.world

IIRC 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

2

Power off because I don't know when I'll be back. If I know I'm back in a few minutes or an hour? That shit stays on.

9

Power off because usually when I turn my laptop off, I'm going to be keeping it off for a long enough period of time that suspend would just not be worth the battery drain.

8
lemmy.world

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.

7
talreply
lemmy.today

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 normally use mosh in conjunction with tmux, since with mosh alone, there's no way for another host to reconnect to a mosh session...but another host can connect and take over a tmux session being run by a mosh session.

3

I do use tmux daily and have a session that connects to most my other sessions.

3

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

2
sh.itjust.works

With how fast boot times are nowadays? I shutdown nightly and save me the hassle of having to worry about some weird oddity occurring, usually it doesn't but every once and a blue moon plasma hangs on the lockscreen and I get greeted with either a broken desktop or a pitch black screen, both usually are easiest to resolve via rebooting anyway.

6
Pikareply
sh.itjust.works

I have timeshift running hourly regardless if using the system. Once the initial backup is complete, any actual performance drops are very negligible since it uses incremental backups, I don't even notice the program is running most the time. As for automated maintenance, I don't really have anything like that, I run an update manually every few days, but I could probably configure unattended-updates to do it for me, I just don't like the idea of automating that.

2

Snapshots, or actual backups? You're doing full system backups hourly?

My backups go pretty fast, but they still impact CPU, and interfere with both network, SSD, and USB bandwidth. I could do that hourly, but jesus that'd impact my B2 bill significantly. And I hate having things randomly slow down.

Snapshots are cheap and fast, but they aren't backups.

2

Timeshift uses incremental backups under the hood (using rsync) calling them snapshots. As long as you are using the rsync one and not the BTRF style one, it works the same. I can load my current setup from a live disk and restore just the same.

Basically the first backup ever done is a "full backup" then every backup past that is an incremental one.

Being said, my off site backup isn't using a cloud provider, my risk case doesn't need that, I store backups locally and then clone to an offsite every once and awhile

3

Just chiming in to point out that powering off and then starting back up won't cause any additional SSD wear, reading from flash memory doesn't use up write cycles* (because there is no writing going on!). In fact, regularly restarting could be slightly more friendly for your SSD, because the /tmp directory, old log files, etc. get deleted on startup, freeing up the storage blocks used by the deleted files so that the SSD can use them for its internal wear balancing.

*technically, flash memory reads do very slightly degrade the data being read, but this effect is absolutely negligible compared to other forms of passive bit rot in flash memory and is basically irrelevant unless you're intentionally trying to corrupt data using reads (which won't happen because the flash controller will fix it before it becomes corrupt to the point of being illegible)

5

I suspend it, until I get around to set up hybernation. I don't care about startup time. I care about all the windows being there exactly as I left them, without exception.

5

I poweroff. I have enough time to let it turn on and can save some energy. (Electricity is getting even more expensive)

5
lemmy.world

y'all been powering down your systems?

had my servers up for like a decade or more...

5

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, and HibernateDelaySec=300 in /etc/systemd/sleep.conf.

Any other system just gets shut down.

EDIT: Note that I don't believe that this is necessary to avoid data loss. I think that the default on Debian is to suspend, but there's another default to hibernate when the battery becomes extremely low, so either way, a laptop sitting on a shelf for a week --- or however long it takes to drain whatever battery is left while suspended --- should wind up hibernated. But with the defaults, it's going to have a laptop with critical battery next time you open it up, and with my settings, it'll have about as much charge as when you closed the thing.

Also, lithium batteries left in very low charge states will permanently lose capacity, and while there's a buffer built in there (i.e. 0% on your battery gauge doesn't mean that the thing is discharged to 0 volts), they'll also inexorably self-discharge a bit, and I'd just as soon keep them well away from that state. I've had devices, including laptops, that have a few minutes of battery life or won't work at all after having been left in a drawer for years.

5

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.

5

For my full desktop, I turn it off when I'm not using it. It basically exists to do heavy compute tasks. I basically do that a few times a week. There's no reason to leave it on if I'm not in the middle of a job. That would be true regardless of the O.S. I'm using on it.

My main computer, I suspend. Usually, I try to make sure that happens on purpose because Ubuntu has this impossible to troubleshoot behavior^1^ that seems to happen more often if it falls asleep on its own.

I would be more inclined to shut it down but I'm particular about my windows and it takes what feels like an hour to get everything just so after reboot. I can't deal with that every day. (Nor am I thrilled about how often Ubuntu LTS wants me to reboot for updates. My desktop needs Ubuntu Studio LTS but my main computer doesn't. When I get time and energy, I'm switching it to Mint so I can deal with someone else's obnoxious choices for a change without learning an entirely new distro.)

^1^ The behavior is not recovering video on wake. It does seem to be working but following the commands I have memorized to shut it down from inside a virtual terminal don't work. The only way to get it down is to hold the power button for "4 seconds" or pull the power plug.

4

I'm like you regarding my windows and what goes where, and KDE Plasma is a godsend. You can define window behavior like which window goes on which virtual desktop, what monitor and whatever size; which should stay on top and which below or can remove title bars and set transparency. after defining the window rules just put everything you need into autostart. reboot and see the magic happen ;-)

3

Always power off everything and anything i can eg , routers, TV,, switches, desktop PC etc

4

Power Off to secure that things get updated and resetting float integers in case they would go haywire

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

for this, I would say SSD is more valuable personally, so if that was my only reason, I'd suspend to RAM every time

My computer's generally doing stuff I have it set to do, so I don't suspend to RAM

Laptop gets turned off when going outside, also encrypted

3

Power off. I never used hibernation nor suspend (even on Windows) and as I don't use some of my computers for weeks, it just doesn't make sense to keep them suspended 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.

3
Zakreply
lemmy.world

Hibernation is, in fact fully powered off.

4

I use poweoff generally. On my laptop, the cellular card prevents sleep, and my desktop often refuses to wake from sleep.

Honestly not much fussed about it as both systems boot so quickly that it's not much of an issue.

As for SSD longevity, again not much fussed about it. In the last 20 years I've only had 1 SSD fail so far. A 40GB drive that bought in 2007ish finally failed last year.

3

I definitely shut down my systems from time to time just to make sure my network is configured correctly and shit doesn't go haywire because I'd rather have that happen than the power go out and everything comes crashing down

3
lemm.ee

Suspend. The amount of power required to keep RAM alive is negligent.

3
midwest.social

Suspend. The amount of power required to keep RAM alive is negligent.

I believe, based on context, that you mean to use the word “negligible.” The sentence means the opposite of what you intended it to mean if you use “negligent.” As in, “It would be negligent to waste that much power.”

4

I agree with negligent! Using suspend to ram for extended periods, eg nightly or over weekend will kill your battery life.

4

Depends on your setup :) My PC pulls somewhere around 80W just for RAM.

(tested by comparing the idle power draw with only one DIMM installed vs all of them)

1

Server: Not once I have used anything else than reboot.

Desktop: Whatever happens when I close the lid.

3

I use systemctl poweroff to power down my laptop at work since I'm not at the office thu–sun. My desktop PC at home never gets rest. 😔

3

If I'm putting it into a bag, I'll power it off. It (Debian Laptop) boots faster than my Android tablet anyway, and I worry about it overheating without airflow.

The rest of the time, I just lock it and leave it to make it's own power decisions. Whatever the defaults were, from install, they seem fine.

It boots so fast, I don't notice if it was suspended or a cold boot unless I happen to have an attentive moment to watch the boot sequence carefully.

3

I could care less about the 5 cycles from 10.000.000 total cycles (dunno the actual number) at least for my desktop.
As for my proxmox server: 5% wearout

2

I'm using suspend on my desktop running Manjaro KDE. To reduce power usage it goes to sleep after 15 minutes of inactivity and wakes up on mouse or keyboard input. Aside from some flaky kernel versions and after underclocking an unstable EXPO profile it's pretty stable, even games continue to run after wakeup.

2
lemmy.dbzer0.com

I use suspend on my desktop every night at bed time. Running Pop. Could never be one of those with a 24/7 on desktop, too much noise.

2
moonlightreply
fedia.io

I also just suspend, but it sounds like you need to adjust some fan curves. (or look into getting more/better fans)

1
Yingwureply
lemmy.dbzer0.com

No, I dislike the small rumblings too even if the fans aren't spinning that much, thanks though!

2

Honestly, I don't understand why there aren't better silent PC desktop cases.

Or enclosures to put desktop cases in.

Like, there are people who make generator enclosures that route output through a muffler. That's a much larger pain in the rear, because there you need to deal with hot exhaust and welding.

Like, I'd think that I should be able to go get a box to put a PC case in in that looks something like:

  • Sound-absorbent foam on the inside

  • Some kind of heavy frame making up the walls that blocks sound, MDF or something. Sound-absorbent drywall probably isn't sturdy enough for a commercial project, though some people use it for DIY projects. Ship it as flat-pack, maybe.

  • An array of slow fans with air going to them passing through a 90 degree baffle. Maybe, since now you've got no real constraints on your form, put a standard HVAC filter on the intake, keep all the air going to the desktop dust-free and eat up a bit more noise.

  • Some kind of rubber flap affair to route cables in and out of.

It used to be that one needed physical access to a desktop for putting optical disk media and floppies in, but today, I virtually never touch my desktop, and USB makes it really easy to stick stuff elsewhere.

I went looking a while back, and AFAICT, there are basically two camps:

  • Large, high-markup rack enclosures aimed at people doing pro audio work, who have a whole cabinet of gear.

  • DIY things.

1

I use a laptop, so I iust put it to sleep. I only restart it when I do updates or when the system crashes. I also turn it off (when I remember to do so...) if I leave it unattended in untrustworthy environment due to encryption.

I also have a mini PC, but I only turn it on when needed, which isn't often since I haven't really figured out what to use it for. It's running Linux Mint headless, because Mint fits my laziness. I can use it via Tailscale, but I don't really know what to do with it. So far it's been mostly useful with OpenWebRX, SDR++ server which also offers compression unlike RTL_TCP as well as being able to use any SDR++ supported SDR, and I also intended to use Navidrome on it as well. My intention was to just download full albums on there, rather than picking out individual songs, but I still have the urge to put all of it on my phone.

2

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.

2
lemmy.world

Haven’t needed it to, I guess even after kernel updates you can log off and log back on to set the changes.

2

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 )

7
mormundreply
feddit.org

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.

6
dan69reply
lemmy.world

Correct me if I’m wrong: sudo user and kernel updates can take effect¿

1

Not sure what you're trying to ask, are you asking if using sudo to sign in as a different user will make kernel updates take effect? If so, the answer is no.

Linux is an operating system kernel, which basically means it's a program which runs other programs inside of it. For any "normal" program running inside Linux, you can update it by installing the new version and then exiting and relaunching the program so that the installed updates take effect. Similarly, after installing the Linux kernel itself, you have to exit and restart the kernel in order for the update to take effect. Because the kernel runs programs inside of it, exiting the kernel means all of those programs will be exited as well, and because the kernel is the only program running directly on the hardware, exiting the kernel means that your computer will power off. In simpler terms: getting kernel updates to take effect necessarily means you need to exit the old kernel and launch the new one, and there is no way to do that without reboot.

1

After shutting down anything in use, I use suspend set for a 35-minute delay. Most evenings I listen to bed-time audio. Ubuntu hasn't been terribly reliable, works about 2/3 of the time.

2

Suspend, most of the time. I have a two handed Vulcan nerve pinch keybind that does that for the end of the day. A desktop PC doesn't have a lid, but that keybind is about as cathartic as closing a laptop.

This is actually different from how I have the desktop environment set to do it, which is the hybrid suspend/hibernate option. This gives me at least a couple of options without too much messing around. Quick shutdown: Use keyboard; Hybrid: Use GUI (which can be done by keyboard navigation too if absolutely necessary.)

The reason? There's a surprising amount of state, such as open windows, browsers, etc. that need to be set back up if coming back cold from a full power off and that bothers me more than maybe it should.

By rights, I should use the hybrid option all the time as it's technically safer, but it takes longer to power off and it actually suspends then unsuspends for a few seconds as it sets up the hibernation profile, which gives me the willies.

Also, the power grid is pretty stable here. If I was elsewhere I might be using the hybrid a lot more.

1

Arch testing here. Suspend/Hibernate can and will break at any time, especially with newer s2idle-only systems, so I tend to keep suspending to a minimum, and also end sway before suspending.

Eg. right now I have to keep systemd-suspend etc. from freezing user.slice, as that fails and goes into an endless loop, ending in needing a hard reboot anyway.

1

Pop!_OS, suspend. Rebooting causes Steam to forget about my second drive and I need to reselect it. I don't need to do that if I use suspend.

1

sudo halt && shutdown

If I'm shutting down it's only because there is a problem causing a lockup

1

I just turn off the screens, and I have a usb switch to switch off my keyboard and mouse (a cheap usb flip switch + a small usb hub).

Reboots when needed.

1

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.

1