Powering Off

Assuming your computer is at idle and not doing anything important, is there any deficit or ill effect to just hitting the power switch on your supply versus the OS shut down?

Yes

My PSU does a "shorting" sound with some weird smell when I power it on, so fuck powering off

That is dust burning.

Yes, if we turn off a human standing up he's going to fall, to safely turn him off he needs to lie down first to prevent that. Same concept for computers.

Just use the OS shut down its there for a fucking reason

Though gravity doesn't affect a computer in that way, I'm asking what possible harmful effects could it have if it's in idle (in bed).

spinning disks could go fuck all

they don't never do dat doe

mainly it just pisses off windows.

If you have your HDD write cache flush disabled for performance, very yes.

I hold it down to power off every year for the past two years on any computer

There are a few things that could fail if you cut power to a PC:

(1) Mechanical disks need to park their heads before they lose power. They have a capacitor to keep them on for just long enough to park the head. But I don't know how reliable this emergency, last resort measure is.

(2) Filesystems are the big one. Some operations on filesystems must be atomic, i.e. indivisible. Once started, the filesystem as reflected on disk is temporarily corrupt until the operation is complete. You don't want to lose power in the middle of such an operation.

On some filesystems, like FAT32, pretty much every filesystem operation is unsafe. On others, like ZFS, nearly every filesystem operation is safe, and those that aren't can only corrupt a single file, not the entire disk.

There is a performance tradeoff with this safety the most popular filesystems, like XFS, ext4, HFS+, and NFS, are faster but less safe than ZFS.

Even if you are not doing anything on the PC, it seems idle, some background process could be writing to disk. And even if the filesystem is not in the middle of anything when you turn it off, it will check itself at startup, which isn't that bad, but is annoying enough to count as a "deficit" per your question.

(3) Software defers writes, expecting to get a chance to clean up when you quit it or shut down the PC. If you cut power it doesn't get a chance to delete temp files or save changes to disk. Same reason why "kill -9" is considered harmful.

Great reply man, I appreciate your sharing of this.

To add to this, if you are using something like UFS it won't get marked as cleanly unmounted and you will have to drop to an emergency shell and run fsck before you can even boot again.

you will orphan your processes if you cut power, though hitting the power button on most modern os will send a shutdown signal instead of just cutting power like it used to do back in the 90s

my arch install does fsck automatically every time I boot
or maybe not, it says something about fsck but it doesn't take more than 2-3 seconds, and if I hard reset it takes about 10 seconds
is something wrong?

i've held down the power key to force shutdown my macbook pro for 5 years now every day
no problems whatsoever

don't know about wangblows though

> you risk losing data because of dirty write cache.

thanks for the detailed reply

i used to hard power-off Win 3.1 / 95 all the time back in the day without a problem... why are modern OS's so delicate to it?

HDDs will even use the enertia of the platter and use the spindle motor as generator to park the head when powered down unexectedly.

Its probably fine. I don't know what FS you are using but I'm pretty sure BTRFS does that by default. Its super quick just becasue of how btrfs works.

that just sends a shutdown signal like was mentioned above. If you want an equivalent to OP it would be yanking out the battery while the laptop is still on and unplugged.

ext4

Linux will first mount root read-only, do a few quick checks and carry on read/write when every thing is ok. If not it will do fsck.

Sounds normal, user.

Youll kill your HDD a lot faster by doing so. Even your SDD is a risk though Im not as certain about that one. Windows at least is constantly writing to the disk so you should probably let it finish whatever its doing before you kill the power.

ya its probably fine.
The reason UFS doesn't let you boot after is possibly because its a journalling FS or because it uses softupdates. I'm not entirely familiar with either so I'm not sure.

That tactile *SNAP* from the power supply switch and everything immediately going black is satisfying...

>have crappy delta electronics bong fung power supply
>get my pc knocked out by surge
>still works but i feel really bad for not turning it off during an electrical storm

I find the sudden blackness when hitting enter after sudo poweroff just as satisfying.

OS shutdown still leaves your peripherals "charging". There's no reason not to switch off your PSU once you've shut it down properly.