A common "gotcha" with computers can happen when power gets cut to the computer without warning. Because the system loses power suddenly, it doesn't have a chance to flush cached filesystem data to disk, which means that some recently-"written" user-data might not be present on the disk the next time the system is powered back on.

Journalling filesystems help mitigate this (i.e. they usually prevent the filesystem itself from being corrupted) but they don't guarantee that the user's files will all be completely retained.

I noticed that some desktop power supplies have a significant amount of "inertia"-- i.e. you can pull the computer's power-plug out of the wall, and the computer will remain running for a noticeable period (e.g. several seconds) before it finally powers off -- because it's operating on the power remaining inside the power supply's internal capacitors.

My question is, is there any protocol or standard (that is supported by Linux) by which the power supply hardware could notify the Linux OS that it has lost its input-AC-power, and therefore it is quite likely that it will fail in the next few seconds? Linux could then respond to that by doing a quick "emergency" flush of all dirty-filesystem-data to SSD, and hopefully get all that data onto the SSD before the system fails. (If any data doesn't make it to disk in time, OTOH, the situation is no worse than it would be without this feature)

Does such a feature exist? If so, what keywords should I feed into Google to learn about it?

1 Answer 1


No and this is impossible. PSU will not have enough power stored to power the system long enough. The "intertia" you saw is probably the fortunate event (or unfortunate: somebody wasted money to a wa-a-ay more powerful PSU than it is required for the machine, and it doesn't load it reasonably).

UPS is designed specifically for this. And there are both standard protocol which does this (USB HID UPS) and non-standard (for example, apcupsd for APC UPS) which do orderly shutdown when UPS batteries exhaust and the remaining runtime is too low.

  • Actually I wouldn't be surprised if there's enough power for some useful action. Holdup time has to be at least 1/2*Frequency seconds, or 10ms for 50Hz at 100% load. And that's at the lowest voltage supported, probably 110VAC. Specs says min. 17ms at max load. 17ms is ages in a computer, and if properly designed, properly enough to flush quite a lot to disk. However, the PSU has no interface to notify the rest of the computer about failure, so obviously no action is taken - but it would be possible if desired...
    – vidarlo
    Jan 13 at 19:50
  • 3
    Well, let's presume the computer with 16 GiB of RAM full with write cache suddenly needs to write all of it to the disk. If it has 17 ms of time to do that, the required write bandwidth would be 16*10⁹/(17/10³) b/s ≈ 1 TB/s. Even if you have only 0.16 GiB of dirty buffers (not uncommon) it's still 10 GB/s, which is several times more than consumer SSDs could provide. And that's even not taking into account that SSDs don't like very much when you cut power to them immediately after large writes. // In any case, reasonable business practice is to rely on UPS for this, not to side effects of PSU Jan 14 at 8:46
  • I want to say 17 ms is age for the CPU, but not so for the storage. For example, 10 ms of latency is quite acceptable for the storage on the low-latency interactive workstation. Jan 14 at 8:49
  • I agree with what you write. In addition, the holdup time is there to let the UPS switch over, in case of off-line UPSes. Actually using the holdup time for writing data would require modifications to the architecture and increase of the holdup time.
    – vidarlo
    Jan 14 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.