Linux system startup process
From the end of November to enroll Marco Linux training course, the beginning of December really began to learn, has been the past one months, starting from learning the history of Linux, followed by learning command line, file system mount and management, directory, Bash Shell basic features and so on, Linux is really profound, Today is a simple summary of the start-up process for CentOS 5,centos 6. Because of the Caishuxueqian, the knowledge is limited, some local analysis improper place also invites the master to be generous to enlighten.
The system startup process is mainly through the following processes:
POST "Bootsequence (BIOS)" Bootloader (MBR) "Kernel (Ramdisk)" Rootfs (Read only) "INIT
650) this.width=650; "title=" Systemboot.png "alt=" Wkiol1azsrdabdvyaadbsfgtmo0947.png "src=" http://s2.51cto.com/ Wyfs02/m02/79/b9/wkiol1azsrdabdvyaadbsfgtmo0947.png "/>
Through the above process, we probably understand the whole process of Linux starting from the power down to the user login interface, and then we will add a few more important concepts, which are an integral part of the startup process:
Start step three: Boot loader
Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device, set up a map of the memory space, so as to bring the system's hardware and software environment to a suitable state, in order to finally call the operating system kernel ready to do everything.
The system reads the GRUB configuration information in memory (typically menu.lst or grub.lst) and launches a different operating system according to this configuration information.
Start the fifth step:
1) Linux runlevel (user layer init based on Inittab file set RunLevel)
Function: It is set for the purpose of running or maintaining the system: 0-6:7 levels 0: Shutdown 1: Single user mode (root, no login required), one, Maintenance Mode 2: Multi-user mode, will start the network function, but will not start NFS: Maintenance Mode 3: Multi-user mode, Normal mode, Text Interface 4: Reserved level, function as Level 3, by not using 5: Multi-user mode, Normal mode, graphical interface 6: Restart the default level 3,5 switch Level init # (#代表对应的级别号) view level [[email protected] ~]# runlevel N 5 [ [Email protected] ~]# who-r run-level 5 2016-01-15 17:07
2) scripting at different operating levels
The system will run the appropriate script in RC0.D to RC6.D to complete the appropriate initialization and start the appropriate service
Storage location
[Email protected] ~]# ls/etc/rc.d/init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local
3) Execute/etc/rc.d/rc.sysinit: System init script
(1) Set host name (2) Set Welcome information (3) Activate Udev and SELinux (4) Mount the file system defined in the/etc/fstab file (5) to detect the root file system and re-mount the root file system (6) to set the system clock (7) To activate the swap device (8) according to /etc/sysctl.conf file Setting kernel parameters (9) activating LVM and software RAID device (10) Loading drivers for additional devices (11) Cleanup operation
The whole process is/sbin/init--------------------run the System init script to set the default run level, complete the system initialization-->> close the service you need to shut down, start the service you need to start- > Set up a login terminal
The above summary just describes the Linux in the boot process involved in several large modules, each large module also has a lot of small modules, the following is a good Linux system start Flowchart:
650) this.width=650; "Title=" Details of the Linux book.jpg "alt=" wkiol1azyt_dw9gbaafcuuisi8m353.jpg "src="/http S3.51cto.com/wyfs02/m00/79/ba/wkiol1azyt_dw9gbaafcuuisi8m353.jpg "/>
Reference documents:
Http://blog.chinaunix.net/uid-23069658-id-3142047.html
http://blog.itpub.net/8111049/viewspace-680043
Http://blog.chinaunix.net/uid-26495963-id-3066282.html
Http://baike.baidu.com/subview/9485/9079238.htm
This article is from the "near home" blog, be sure to keep this source http://nearlv.blog.51cto.com/2432295/1735544
Linux System Management (II): Linux system startup process