Comment by rowanG077

4 years ago

Depends what exactly is a hard reboot. I don't reboot my laptop by issueing USB-PD command. But I do by holding the power button.

I just tested that. Holding down the power button invokes a (somewhat special) btn_rst kernel panic before it has a chance to invoke a true hardware reset, and kernel panics involve an NVMe driver hook which I'm pretty sure issues a flush. Should be safe.

At least re: this issue; it's still a bad idea because it's only safe if all software is written following data integrity and flush rules to the letter, and most software isn't. You're eventually going to run into issues on any OS by doing that, because most software doesn't get this right unless it's a database. And you're still going to lose data that's in buffer cache, I'm pretty sure that won't get flushed.

See, that's a forced shutdown, a last resort measure; it's using a sledgehammer to tap in a nail. You shouldn't do that as a habit, even if this particular optimization issue wasn't a thing.

I mean I grew up diligently turning off my PC by parking the disk and using the various operating system level shutdown procedures. Nowadays I smack the off button, but that still just triggers the OS shutdown procedure. I don't turn my Mac off as a rule, its sleep mode actually works. ish.

Care to explain why?

  • If they're like me: outside of a software update I only reboot when the machine is not responding, at which point hard reboot is faster and more robust. I recognize it's not ideal, but I also don't think it's reasonable for the system to ever get to a point where I should be wanting to restart to "fix" it - and I would think it is a serious bug if doing so ever corrupted the system or lost any "saved" data.

  • Systemd takes 2 minutes to shutdown and I never got any way to resolve that.

    • Linux Magic SysRq + R S E I V B key chord will immediately shut down while still properly flushing disk cache and such. A bit annoying to enter, but a handy tool to have in your toolbox.

      2 replies →