Tuesday, April 20, 2010

Linux Boot/Shutdown

Boot

The Linux system performs the boot process automatically when the system is turned on. There a series of messages that display during this process. If there are problems, error messages will display.

The scripts used to control how the system will work are stored in the /etc directory. Mainly /etc/inittab and /etc/rc.d. You can view these files but we strongly recommend that you not attempt to change them unless you are an experienced Linux administrator.



Shutdown

Linux, like any server operating system, does not like it if you just turn the power off. You risk the possibilities of damaging the operating system. Before turning the power off, you must execute the 'shutdown' command.

Options What it does
now shutdown immediately
+n n is the number of minutes to wait
-h actually halt system, ready for power off
-r shutdown and automatically perform a re-boot
-c cancel the shutdown
Examples What it does
shutdown now -h To shutdown the system immediately, ready for power off
shutdown +10 -h To shutdown the system in 10 minutes and ready for power off
shutdown now -r or reboot To shutdown and automatically reboot



INIT

If the system is already up and running, you can use the init command to start/stop the status of the system.

Options What it does
0 halt system
1 single user mode (for maintenance purposes, won't allow others to login)
3 multi-user mode (normal mode)
5 multi-user mode with GUI started (normal level for workstations using Xwindows)
6 reboot
Examples What it does
init 1 To set single user mode
init 6 reboot

Cleaning the File System

fsck is automatically run every time the system boots. Occasionally you may have to run fsck manually to fix a damaged file system. Because the results and options can vary greater, it is recommended to only run this utility with the advice of an Linux administrator. Must be run from the root account.

No comments: