Ubuntu – What can be harmed by incorrect power off, and what can be checked

hard drivepower-managementshutdown

What, if anything, should I be worried about after several improper shutdowns and power issues? (Ubuntu Server 17.04)

The short version of my story is the shutdown process would trigger my motherboard's circuit protection against unstable power supplies, at which point the computer would immediately power off and power back on to the post screen with a warning message. The same thing would happen if I tried to put the hard drives in standby with hdparm -y.

Replacing the power supply solved this problem, though I'm embarrassed to admit how long it took me to figure that out.

Is there anything I should check, or corrective actions I can take? Reinstalling the operating system (again) wouldn't be the worst thing in the world, but I'm wondering if I should bother. System disk is an SSD, and two WD Red drives in mirrored Btrfs for media storage.

Best Answer

The easiest way to check the ext4 file system is to add

fsck.mode=force

as a boot parameter.

It can be done in /etc/default/grub, or manually on boot.

For older systems that use upstart run

sudo touch /forcefsck

and reboot.

The command will create an empty /forcefsck file that will tell the system to check drives on boot.

On boot, before the file system is mounted fsck will run and show if there are errors.

Otherwise you will need to boot from some external device.

Related Question