6

My Linux box will be automatically shut down by the attached UPS if it is running and the AC power fails.

If I have the Linux box suspended and the AC power fails, I assume the UPS can not shut it down. What are the consequences of AC power failure on a suspended Linux system?

  • I'm not sure what your asking, there is nothing unique about Linux to this situation. Of course, it can't shutdown cleanly, it is suspended... but most Linux filesystems recovery nicely from a dirty shutdown, of course everything actively open that hasn't been committed to storage will be lost. Is that what your asking? And why suspend a desktop machine, just leave it on or shut it down is usually the better option. – acejavelin Jul 16 '16 at 13:56
  • I'm not asking if it's a good idea or for suggestions about how to operate my system. I'm asking if my system is suspended and the AC power fails, what happens to my system. – Organic Marble Jul 16 '16 at 14:32
  • I don't know about Linux, yet Windows usually enables hybrid sleep on desktops: it combines regular sleep and hibernation. If AC power failure occurred, the saved data will be read from disk – nothing is lost. From my experience at least, Windows is able to hibernate your computer if its battery runs flat while it's in sleep mode. – Alexey Ivanov Jul 17 '16 at 8:48
6

The same as a running system: fileystems are mounted, programs are running, files are open, data lingers in caches, etc. So you will have some data loss (whatever isn't saved), you may get a filesystem check upon start and possibly filesystem corruption.

  • 1
    This happened to me more than once now (battery exhaustion/disconnection while in sleep) with my x200s running Linux 4.x. Sometimes fsck manages to fix the error from the emergency mode, sometimes the filesystem just gets trashed irrecoverably. – Nemo Jun 1 '17 at 15:41
-2

It is possible for some files to get corrupted, but they will be restored if you check the hdd for errors using checkdisk. In rare cases you can get bad sectors. You should do whatever you can to avoid power failures.

  • 1
    Checkdisk is a Windows thing, right? – Organic Marble Jul 16 '16 at 15:24
  • @OrganicMarble yes. The similar Linux tool is called fsck. – user1318868 Jul 16 '16 at 15:27

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.