From: http://hi.baidu.com/youdianweidao/blog/item/b3ef79ecb197e42e62d09fdb.html
$ CD/etc & sudo find-name "RC. Local" found that my RC. Local is different from the text. It is too normal.
To tell the truth, I have always looked down on boot. I can press the power supply and then slide back to use it. Why should I consider this process. However, later I found that if I did not learn Linux, it would be a huge obstacle for future study. Therefore, you must learn it several times. Online boot describes many Linux boot processes. However, if you do not write it again in your mind, you can only know about it. In order to achieve the unity of man and sword, the sword is both me and me. Review it.
To sum up, the entire Linux boot process.
· 1: After the power supply is enabled, the first step of the host is to query the BIOS (Basic Input/Output System) information. Understand the hardware status of the entire system, such as CPU, memory, video card, and nic. Well, Windows computing and it are one. No.
· 2: Next, the Host reads the Boot Loader from MBR (the first sector of the hard disk. This is important. It is said that troubleshooting will take this test and give a bad loader and ask you to correct it. Windows does not support the partition format of Linux. Therefore, use Windows boot. INI cannot find the Linux system. Generally, Windows and Linux are installed first, and grub is used as the boot loader. Two words: worry-free! Because Linux is not as stingy as windows. Grub supports windows partition format.
· 3: After the Host reads the boot loader, it will read the information and know who is waiting for it. If the host wants to access the Linux system, read to the Linux core is loaded into the memory in the/boot file directory. Start the next analysis journey.
· 4: OK, first runProgramWho is it? Is the/sbin/INIT program. If you don't believe it, you can use the top program to check whether the PID is 1 or not. It is the ancestor of all things. I am short for it as the nvwa Niang (not like Adam and Eve ).
· 5: init first looks for the start level (run-level ). Because the startup levels are different, the running scripts (that is, services) are different. The default levels include the following:
0-halt (direct system shutdown)
1-single user mode (single user mode, used for system maintenance)
2-multi-user, without NFS (similar to 3 mode, but NFS service is missing)
3-full multi-user mode (full mode, but text mode)
4-unused (system reservation function)
5-X11 (similar to 3 mode, but X terminal display)
6-Reboot (reboot)
(Do not select 0 or 4 or 6. Otherwise, the system is improved)
· 6: OK. After the system knows its startup level, the next step is not to start the service, but to set the host runtime environment first. The read file is/etc/rc. D/RC. Sysinit file. Which environments should I set?
· Set the network environment/etc/sysconfig/network, such as the host name, gateway, IP address, and DNS.
· Mount/proc. This file is a special file with a size of 0 because it is in the memory. It is best not to delete the content.
· Based on the kernel boot result/proc/sys/kernel/modprobe. Start detection of peripheral devices.
· Load the User-Defined module/etc/sysconfig/modules /*. Modules
· Read/etc/sysctl. The conf file sets the kernel.
· Set the time, terminal font, hard disk LVM or raid, and perform disk detection with fsck.
· Record the boot status to/var/log/dmesg. (You can run the dmesg command to view the result)
· 7:
OK. Next, start the system service. Different Run-levels may start different services. To/etc/rc. In the d directory, different levels have different directories. For example, start
3 mode, there will be RC3. D directory, which stores the service. In this example, start indicates that the instance is started, and kill indicates that the instance is not started. A number indicates the startup sequence.
The smaller the number, the earlier the startup.
Note that they are all connected to etc/rc. D/init. D/related files in the directory. Therefore, you can use "/etc/rc" to manually start a service. D/init.
D/start a service. On the contrary, we can also send a service Ln (link command) to different run-level directories. Remember to add s or K + numbers.
· 8: after reading the service, the host will read/etc/rc. D/RC. Local file. Therefore, if you need to start the system, you can write a script or command here. It doesn't have to be as troublesome as above. It is also convenient to delete it later.
OK. After a long journey, the system can finally start shell with peace of mind. We have handed over control. We can do whatever we want. It is best to develop a good habit. Do not Log On As A root user at ordinary times.