Categories

Archives

Why The Shutdown?

The shutdown procedure of a computer is an important operation that should never be forgotten. The rule is: “never turn off a computer, always shut it down”.

But… what does that mean?

Whatever is the operating system you are using (Windows, Linux, OsX, BSD, …) you should never simply turn off your computer when you don’t need to use it anymore. The reason for that is the slowness of the hard disks.

File:Hard disk drive.JPG
Attribution: https://commons.wikimedia.org/wiki/File:Hard_disk_drive.JPG

No matter they are the traditional electromechanical HDD or the newer solid state SSD, they are all definitively slower than the CPU. Because of that, when you store or update something on the disk, the operating system doesn’t want to wait for the disk to finish the operation because the CPU would be forced to slow down. To avoid waiting, the OS puts all the information you need to store on the disk in a memory buffer, which lives in RAM. When there is nothing else to do, the OS goes to that buffer from time to time and actually saves those information on the disk.

File:Elixir M2U51264DS8HC3G-5T 20060320.jpg

But this means that what you thought was stored in the disk might still be in the RAM, and can stay there for long periods of time, before the OS decides to move the buffer contents to disk. And, even so, it might decide it does not have time to store everything, and so it stores just a little piece of the buffer, leaving the rest for later.

So, if you just turn off your computer, you may get into a condition where some of the buffers used by the OS have not been entirely or even fully transferred to the disk.

In the latter case, you will just loose whatever information was in that buffer.

But in the former case, when the buffer was only partially transferred to disk, you might end up with a corrupted file or, worst, with a corrupted disk, if you turned off the computer while the OS was trying to write something on the disk.

In this last condition, when you turn back on the computer, you may even end up not being able to boot it anymore, if you are really unlucky. The final result of this is that you would have to reinstall the OS entirely, and loose all the data that was on the disk, unless you are a computer expert and know how to retrieve the lost information or fix the corruption (you can never do that entirely).

File:Windows NT boot error.jpg

And that’s when the shutdown procedure comes to help you. If, instead of simply turning off the computer, you shut it down, the OS initiates a whole procedure that will prevent the problems above from happening.

File:Windows9xshutdown.jpg
Attribution: https://commons.wikimedia.org/wiki/File:Windows9xshutdown.jpg

The shutdown will first tell to all the programs that are still running on the computer to terminate on their own, after saving any data that is still pending. It will also run a procedure to empty all the buffers that were not yet stored to disk. And only after all of that is done it would turn off the computer on its own, without the need for you to push the off button.

Yes, the shutdown procedure will take some extra time to complete. But isn’t it well worth time? You should never forget to do that.

Now, the shutdown of a computer can be usually done in two different ways.

Way number 1: you can go to the menu of the desktop GUI and find the place where the shutdown button is located, them click on it and way for the computer to execute the procedure and then turn itself off after the procedure is completed.

Way number 2: use a command line window and issue the command manually. This is very common for servers that do not use a desktop GUI.

Computers running Windows and OsX always have a GUI and you don’t need to use the command line to do the shutdown. Other computers running instead Linux, or BSD, or other varieties of operating systems, may or may not have a GUI, depending if they were configured as workstations or servers.

For workstations, you can just find the shutdown button in the system menu of the GUI.

For servers that do not use the GUI, you will just issue the command manually, in which case you can provide several options to the command to make it do the shutdown in ways that are not even thinkable with the command issued from the GUI. But this is a story for another time.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

This site uses Akismet to reduce spam. Learn how your comment data is processed.