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?

3
  • 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, 2016 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. Jul 16, 2016 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. Jul 17, 2016 at 8:48

2 Answers 2

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
  • 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, 2017 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.

2
  • 1
    Checkdisk is a Windows thing, right? Jul 16, 2016 at 15:24
  • @OrganicMarble yes. The similar Linux tool is called fsck. Jul 16, 2016 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .