Linux boot and Shutdown

Source: Internet
Author: User
This section describes how to start and shut down a Linux instance. We hope that this book will help you build a correct concept of starting and shutting down a Linux instance. And a glimpse of Linux.
Main content of this Chapter
1. Start the system
2. System Shutdown
3. System Logon
4. System logout
5. Editor
□System startup
The boot information is very important, because it can tell you whether the current machine is normal at boot, or what part of the problem occurs. This boot content does not need to go to the master, but in order to understand the order of the information and the meaning of each line of information, it is absolutely important to manage the system, the success or failure of system management begins with this.
I. The following describes the boot system.
1. BIOS: when the power is on, the computer first loads the BIOS from CMOS and checks the basic hardware information. CPU. Hard Disk and other information. Then, the BIOS will look for whether there is a system boot disk. If there is no system boot disk, it will look for the hard disk MBR and execute the program recorded on the MBR. Generally, this program is the operating system boot program. (Lilo, rgub)
2. After the loader boot program is run in Linux, a red hat boot window will appear.
3. Linux kernel loading: After Linux is selected in the grub stage, the system starts to load kernet. At this time, it can be said that the system officially enters the Linux control. Linux searches for all hardware devices in the system.
4. Run/sbin/init. After the system loads kernet, the system calls the/sbin/INIT program. It selects a running level based on the/etc/inittab file.
5. Run/etc/rc. d/rc. sysinit: it is a script program, which is mainly used to set many system changes and preparations before the running level.
6. Run all scripts in the default running level directory by init.
7. Run/etc/rc. d/rc. Local: it is also a script program that will be executed after all the scripts in the running level directory are executed.
8. Run/bin/login: the login program prompts you to enter the account and password, encode the password, and confirm the correctness of the password. If the two are consistent, initialize the environment for the user and then hand over the control to the shell.
9. Open the logon page
After the preceding steps are correctly executed, the system opens or texts based on the specified running level.
2. Handling Failures during startup
Although Linux is a very stable operating system, sometimes the system cannot be started on due to some reasons. You can use the boot disk of Linux. Therefore, we recommend that you create a boot disk when installing Linux. Use the makebootdisk command to create a boot disk.
Makebootdisk-derive/dev/fd0 uname-R
3. Run the dmesg command to view the boot Information
□System Shutdown
I believe that many users know that the current computer does not simply turn off the power when it is shut down. If it is turned off directly, it is likely to cause damage to the file system. Enter the appropriate command before powering off the power to end the current job.
1. shutdown with the shutdown command
Shutdown: Enter the maintenance mode of a single user, transfer information, shut down the system, restart the computer, and shut down the process. Before shutdown, it is best to execute "sync" because it can write data in the memory buffer to the hard disk to avoid data loss.
1. transfer information:
The shutdown command can be used to send information to the user. Generally, we will prompt the user that the system is about to shut down. After sending the information, the system will send the information every minute until the time is reached. However, please note that, even if the time expires, the system will not shut down, but directly cancel the shutdown command,
Shutdown-K 2 attention: system will shutdown soon!
Inform the user of the command to start maintenance in 2 minutes.
Shutdown 2 attention: system will shutdown soon!
After the arrival time, enter the single-user maintenance mode.
2. System Shutdown
Shutdown-H now: shutdown now
Single-user maintenance mode after Shutdown
Shutdown now: Perform maintenance for a single user immediately.
Shutdown + 5: five minutes later.
3. restart the computer
Shutdown-R
Shutdown-R + reboot after 8 minutes.
Shutdown-R now: restart the computer.
2. Shut down with halt, power off, and reboot commands.
These three commands can be executed directly, but the following parameters can also be used.
-N: Do not run sync before restarting the computer.
-P: Shut down the system and the computer.
-F: directly reboot the instance. Shutdown is not called to shut down the system, and no information is displayed.
□System Logon
The Linux operating system provides a total of seven work areas, the first six of which are in the text mode, and the fourth is in the graphic mode. You can use Alt + Ctrl + f1_f7 to switch between different logon interfaces. The system administrator can also use Telnet and rlogin to log on.
I. Graphic logon interface:
The graphical logon interface is currently the most common logon mode and the default logon mode during system installation.
2. text login
In addition to graphical logon, you can also use Alt + Ctrl + f1_f6 in any group
Login: Enter the user name. Today
Password: enter the password that matches the user.
Prompt after Successful Logon:
[Today @ Linux today] # = [Login User Name @ login computer name the current directory of the login user] #
Note: When logging on, try to use the root account as little as possible because it is the system administrator and has the maximum permissions to avoid Operation errors. You can use a common user to log on, and then use the "Su-" command to switch to the system administrator identity.
3. logon via Telnet
In addition to local logon, you can also use Telnet to manage remote hosts. You can use various Telnet tools to log on to Windows 9x and 2000 computers. In the MS-doscommand line, enter
Telnet computer name or IP address
4. Log On with the LOGIN command:
# Login Username: Use another user to log on.
# Login-H computer name: log on to another computer.
5. Log On with the rlogin command
# Rlogin linux.abc.com: log on to the remote host: linux..abc.com
6. Use of the/etc/nologin file:
If you want only the root administrator to log on to the host and other accounts cannot log on, you can add a file named "nologin" in the/etc directory, enter a few characters in this file. Other users are prohibited from logging on.
□System logout
The logout command can be used to log the current user out of the system.
# Logout: the current system is exited and other users are replaced.
□Editor evergreen tree
I. Execution and exit of vi
1. Run the VI Editor: VI file name -- press Enter.
2. Exit the VI Editor: ": Q" -- press Enter.
Ii. VI Operation Mode
1. There are two parts in the VI interface: The editing area and the command area.
Command Line: at the bottom of the screen, you can enter the command in addition, And the range except the command area belongs to the editing area.
2. VI: There are three basic operation modes: Command mode, insert mode, and last line mode. Their basic functions are as follows:
A. Command Line: controls the movement of the cursor, the deletion of characters, the replication of segments, and the entry of insert mode or last line mode.
B. insert mode: The only function is the input of text data. Press ESC to return to command mode.
C. Last line mode: Save the file, exit VI, and other settings, such as searching for or replacing strings.
Iii. Last line mode: Command introduction:
W indicates the meaning of "and", and saves the current file content,
Q indicates that exit means that VI Execution is terminated, but if the file content is modified, VI will have an error message and ask me to use "!".
Q! Force exit VI without saving the file.
WQ saves the modified content and leaves VI.
Set nu adds a row number to each row in the file
Set Nonu cancel row number
Enter a number. If you enter a number and Press ESC, you can move the cursor to the beginning of the row.
/String in a long file, you can use the "/string" command to find a specific word, for example: "/tcp". If the searched string is not required, you can press the "N" key to continue searching.
? The string can use "?" String "command to find a specific word, for example:":/tcp "if the searched string is not required, you can press the" N "key to continue searching

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.