6 ms·
This might be alarming to some, but I have been hard-crashing all of my personal Linux boxes (and some of the Linux boxes under my professional care) for quite
by Diederich 11y ago
This might be alarming to some, but I have been hard-crashing all of my personal Linux boxes (and some of the Linux boxes under my professional care) for quite a few years.
That is, if a physical power button (often a toggle switch on the power supply) is close, I'll toggle it off.
Most of the time, I'll hold the reset/power/whatever button down until the device clicks off.
Linux and its filesystems have made this a (generally) safe thing to do for many years. I started doing it after I read a lwn.net article, ages ago, about how ext3's crash recovery path was discovered to be a bit faster than its normal, clean mount path. If I recall, that happened because so much more of the focus was put into that 'bad' path that it ended up more efficient than the 'good' path.
Full disclosure: if I wish to do the crash thing immediately after a bunch of relevant file writes, I will type 'sync' on one of my many terminals first. (:
- SteveNuts 11y agoThe latest versions of Linux with systemd boot so quickly that I don't think the risk vs reward of doing this would be worth it for me.
- Diederich 11y agoIndeed! That's kind of the funny thing. I started doing the 'crazy thing', determined to do it until something problematic happened. I was in kind of an ornery mood. Now, after many hundreds...perhaps thousands...of forced crashes, nothing bad has yet happened. Amazing, really.
- digi_owl 11y agoDon't need systemd to boot fast. Just be fugal with what you start. Linux distros are heading into Windows-ville in that sense, firing up all manner of daemons just in case.
- SteveNuts 11y agoI completely agree, I've just been using CentOS and RHEL 7.2 and the latest Ubuntu and I'm blown away at how quickly I can boot up.
- johannes1234321 11y agoThis can work, but properly shutting down not only is for syncing the filesystem but it properly terminates applications. I.e. editors might remind you to save changed files or the desktop environment could store its state. Away from desktops some server applications can be graceful (I.e. instead of terminating a HTTP request while processing active requests could be finished, but new requests by the load balancer be rejected, databases can clean their state etc.)
- ambrop7 11y agoYou're placing a lot of trust in you presumably consumer-level disks. Even if the filesystem is perfectly crash-tolerant under some specific model of disk behavior, the disk could always behave outside of that model, especially upon sudden loss of power. Story: some time ago, I tried to hook up an SATA hard disk into a desktop PC which had an SSD connected, while the machine was running. When I did so, I got errors in dmesg about the SSD failing and being reset automatically. I rebooted and grub took ~30s to load the kernel then the boot hanged in the middle. Luckily after some power cycling the issue was gone but I honestly taught I lost the SSD. Apparently disks don't like losing power. Possibly this was even worse because it was just a temporary voltage drop (the disks were connected to the same supply cable).
- javajosh 11y agoIs SATA designed to allow hot plugin of a hard drive? That would surprise me.
- ambrop7 11y agoAs far as I know, it is an optional feature that both the controller and the drive have to support, to use reliably.
- dogma1138 11y agoAnd it then needs to be explicitly requested which usually means bypassing the cache to avoid any delayed writes. But even then hotswap was never meant to ensure data consistency it just allows the controller to reinitialize new disks without a full reset.
- digi_owl 11y agoDo wonder if you would have seen that issue if it was another SSD. Thing about spinning platters is that it takes a fair bit of initial juice to get them spinning. Thats why some USB HDDs come with y cables to get those few extra miliamps from the second port.
- B1FF_PSUVM 11y agoI'm too lazy to go look up the LWN crash-only-software piece, but there was one a few years ago.
- mortenlarsen 11y agohttps://lwn.net/Articles/191059/ https://lwn.net/Articles/191059/
- deleted 11y ago[deleted]
- projct 11y agoConsumer disks and SSDs make this much riskier than you think, even if you have done a 'sync'. This has been happening for 11+ years[1] and is getting worse lately. [1] http://brad.livejournal.com/2116715.html http://brad.livejournal.com/2116715.html