1

I want to ask that what happens when laptop just shuts down unexpectedly due to power failure or like (of course other than shutting off properly)?

I mean what happens to hardware? What happens to OS and programs running? Do they get corrupted or something similar?

Moab
  • 58,769

1 Answers1

0

Many times the most common thing that happen is nothing about which to be too much worried.

BTW

  • If the HDD were writing, at the new start of the disk, the heads of the drive will jump to the starting position. They can become more sensible than usual to damage due to vibration and displacement of the whole computer.

    Frequent power outages can reduce a hard drive’s physical lifespan. The read-and-write head, which hovers over the spinning platters during operation, snaps back into its original position upon power loss. This sudden movement can cause tiny imperfections that accumulate over time, increasing the likelihood of a “head crash”: a malfunction that occurs when the head touches and scrapes the platter surfaces, effectively destroying the hard drive.

  • The problem is not only related with the power down but even with the power up.

    ... although power outages will not cause direct harm to computer hardware other than data drives, it’s possible for power outages to be accompanied by power surges, which can cause severe damage to hardware.

  • On the other side you should have data corruption that the computer is writing, or using to send signals.

    One of the first things that will happen, is that the memory DIMMs will no longer be refreshed properly (DRAM needs to be refreshed constantly otherwise it will lose its data) and very rapidly, the memory will contain only garbage. The hard drives and DMA controller however, will run a bit longer; so if data is being written to disk, the DMA controller will keep reading data from memory, but it has no idea that this data is corrupted.

  • So you can lose data not synced with the HDD, you can have some mess with partition table especially if you were moving files or if the filesystem was delaying the writing operations, for sure you will empty the temporary directory...

    sync writes any data buffered in memory out to disk. This can include (but is not limited to) modified superblocks, modified inodes, and delayed reads and writes. This must be implemented by the kernel ...
    The kernel keeps data in memory to avoid doing (relatively slow) disk reads and writes. This improves performance, but if the computer crashes, data may be lost or the file system corrupted as a result.

  • You will lose all the program unsaved, the list of the undo actions in some smart program, the history of the shells... of course all the connections (sockets), the authentications, the links to the file created for you on internet...and I do not want to think if you have an encrypted disk...

References

Hastur
  • 19,483
  • 9
  • 55
  • 99