Shutting Down Linux Properly & Recovering After an Improper Shutdown – Linux System Admin Training


If a Linux system is not working properly and it “hangs” or if it loses power (due to a power failure or some other reason) – then the system has not been shut down “cleanly” (or “properly”).

If a Linux system was not shut down cleanly, watch its screen as it starts again. Important information appears on the screen when a system starts. This can help you to diagnose and fix a problem.

Be Sure To Shut Down A Linux System Properly (Cleanly)

When you are finished working at a Linux system and need to turn the power off, you should do the steps to shut the system down cleanly (with a Linux command or menu) prior to turning the power off.

To shut down a Linux system from a Linux GUI desktop, you can do steps similar to: Menu ; Log Out ; Shut Down ; OK

If you are working on a Linux server system at the Linux command line prompt in “text mode” then run the Linux shutdown command to shut your Linux system down.

Linux shutdown Command Example

The following Linux shutdown command example shuts down the Linux OS and turns the power off.

$ shutdown -h now

The above steps shut the OS down “cleanly” via software and on most current Linux systems, this will also turn off the power.

Booting A Linux System After It Has Shut Down “Uncleanly”

If the power to a Linux system (that is using any one of several filesystems, including ext2 and ext3, on any of its partitions) has gone off before the system was properly shut down via software, then watch the screen as it boots.

You will likely see a message that states that the system was not shut down “cleanly” and requests that you press “Y” (for Yes) to force a filesystem integrity check (i.e. run the fsck utility to test the filesystem on the hard disk(s) in the system).

The system may only give you a few seconds to respond to the message before automatically continuing to boot.

If you press “Y”, then the system will run a filesystem check. Unless you are certain that a filesystem check is not required, always press “Y” when asked if you want to run a filesystem check.

A filesystem check that is run on a partition that is using ext3 is much faster than one that is run on a partition that is using ext2.

Tags:

Related posts