Linux Learning notes-boot process

Source: Internet
Author: User

Linux system Boot Process

1th Step Power-on self-test

once the server is powered on, the BIOS chip on the motherboard will check each hardware. After checking the hardware for no problems, the power-on task will be handed over to the next step.

2nd Step MBR Boot

After the BIOS self-test is completed, the boot task is handed over to the MBR boot program. The MBR bootstrapper will read the default boot entry hard disk 0 cylinder 0 Tracks 1 sectors of the first 446 bytes (the next 66 bytes are the partition table of the hard disk and the end flag of the partition), eventually loading the Grub menu.

3rd Step Loading Grub Boot Menu

The actual storage path for the Grub menu is/boot/grub/grub.conf, which is configured with basic information such as the kernel

[[email protected] ~]# ls -l /etc/grub.conf    #<== can see/ Etc Grub below is a soft link file lrwxrwxrwx. 1 root root 22 jul  3  2016 / ETC/GRUB.CONF&NBSP;-&GT;&NBSP, .... /BOOT/GRUB/GRUB.CONF[[EMAIL&NBSP;PROTECTED]&NBSP;~]#&NBSP;LS&NBSP;-L&NBSP;/BOOT/GRUB/GRUB.CONF&NBSP;-RW------- .  1 root root 819 jul  3  2016 /boot/grub/grub.conf[[email  protected] ~]# cat /boot/grub/grub.conf #<== to view grub content # grub.conf  Generated by anaconda## note that you do not have to rerun  grub after making changes to this file# NOTICE:  You  have a /boot partition.  this means that#           all kernel and initrd paths are relative to /boot/, eg.#          root  (hd0,0) #           kernel /vmlinuz-version ro root=/dev/ mapper/volgroup-lv_root#          initrd /initrd-[ generic-]version.img#boot=/dev/sda   #<== here explains where the partition is located default=0    #<== menu item 0 Indicates the first item, if it is multi-system can modify this option timeout=5    #<== in the menu to automatically start the system before the dwell time, in sec, can be on Demand splashimage= (hd0,0 /grub/splash.xpm.gz    #<== the background icon of the boot menu hiddenmenutitle centos  (2.6.32-431. EL6.X86_64)    #<== Startup project name, you can modify root  (hd0,0)     #<==root location, hd0, 0 name and definition of the reference disk under Linux Kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/volgroup-lv_root  rd_no_luks lang=en_us. utf-8 rd_no_md rd_lvm_lv=volgroup/lv_swap sysfont=latarcyrheb-sun16 crashkernel=128m rd_lvm_lv=volgroup/lv_root  keyboardtype=pc keytable=us rd_no_dm rhgb  quietinitrd /initramfs-2.6.32-431.el6.x86_64.img   #<== the specific parameters of the kernel configuration, etc.

4th Step Load Kernel kernel

Depending on the configuration inside the grub.conf, the system will load the kernel program. After the kernel quotation marks are completed, the INIT process starting with process number 1 is run first

5th step to start the init process

[[email protected] ~]# ps-ef |grep initroot 1 0 0 06:14? 00:00:00/sbin/init

6th Step reading the Inittab configuration file

1) When starting the Init process, the/etc/inittab configuration file is read first

[[email protected] ~]# cat /etc/inittab # inittab is only used  by upstart for the default runlevel.## ADDING OTHER  Configuration here will have no effect on your system.## system  initialization is started by /etc/init/rcs.conf## individual runlevels  are started by /etc/init/rc.conf## ctrl-alt-delete is handled by  /etc/init/control-alt-delete.conf## terminal gettys are handled by /etc/ init/tty.conf and /etc/init/serial.conf,# with configuration in /etc/sysconfig/ Init.## for information on how to write upstart event handlers,  or how# upstart works, see init (5),  init (8),  and initctl (8). # #  Default runlevel. The runlevels used are:#   0 - halt  (Do not set initdefault  to this) #   1 - single user mode#   2 -  Multiuser, without NFS  (The same as 3, if you do not  have networking) #   3 - full multiuser mode#   4  - unused#   5 - X11#   6 - reboot  (do  Not set initdefault to this) # id:3:initdefault:    #<== Define the RunLevel level at system startup

2) Read/etc/rc.d/rc.sysinit script

The configuration file defines the hostname, SELinux service, Sync,device mapper .... And so on a series of services.

#/etc/rc.d/rc.sysinit-run once at boot time## taken on part from Miquel van Smoorenburg ' s BCHECKRC.

3) Read/ETC/RC.D/RC script

Determine the configuration required to run the current default boot RunLevel

# RC This file was responsible for starting/stopping# services when the runlevel changes.

4) Run the program under the corresponding operating level/etc/rc3.d/

The files under this directory are soft-linked files that correspond to the startup scripts for their respective services, and are related to the chkconfig principle.

[[Email protected] rc3.d]# ls -lih /etc/rc3.d/total 0136917 lrwxrwxrwx. &NBSP;1&NBSP;ROOT&NBSP;ROOT&NBSP;16&NBSP;AUG&NBSP;&NBSP;2&NBSP;07:14&NBSP;K01SMARTD&NBSP;-&GT;&NBSP, .... /init.d/smartd136962 lrwxrwxrwx  1 root root 13 sep 14 23:55 &NBSP;K05ATD&NBSP;-&GT;&NBSP, .... /init.d/atd136988 lrwxrwxrwx. 1 root root 16 aug  2 07:14  K10PSACCT&NBSP;-&GT;&NBSP, .... /init.d/psacct136180 lrwxrwxrwx. 1 root root 19 aug  2 07:14 &NBSP;K10SASLAUTHD&NBSP;-&GT;&NBSP, .... /init.d/saslauthd137309 lrwxrwxrwx  1 root root 22 sep 17 10:32 &NBSP;K15HTCACHECLEAN&NBSP;-&GT;&NBSP, .... /init.d/htcacheclean137302 lrwxrwxrwx  1 root root 15 sep 17  10:32&NBSP;K15HTTPD&NBSP;-&GT;&NBSP, .... /init.d/httpd136927 lrwxrwxrwx. 1 root root 18 aug &NBSP;2&NBSP;07:14&NBSP;K15SVNSERVE&NBSP;-&GT;&NBSP, .... /init.d/svnserve135882 lrwxrwxrwx  1 root root 19 sep 14 23:55 &NBSP;K16ABRT-CCPP&NBSP;-&GT;&NBSP, .... /init.d/abrt-ccpp135866 lrwxrwxrwx  1 root root 15 sep 14 23:55 &NBSP;K16ABRTD&NBSP;-&GT;&NBSP, .... /init.d/abrtd136200 lrwxrwxrwx  1 root root 17 sep 14 23:55  K30POSTFIX&NBSP;-&GT;&NBSP, .... /init.d/postfix136095 lrwxrwxrwx. 1 root root 20 aug  2 07:14 &NBSP;K50NETCONSOLE&NBSP;-&GT;&NBSP, .... /init.d/netconsole136882 lrwxrwxrwx  1 root root 15 sep 14 23:55 &NBSP;K74ACPID&NBSP;-&GT;&NBSP, .... /init.d/acpid136129 lrwxrwxrwx  1 root root 19 sep 14 23:55  K74HALDAEMON&NBSP;-&GT;&NBSP, .... /init.d/haldaemon136783 lrwxrwxrwx  1 root root 14 sep 14&NBSP;02:53&NBSP;K74NTPD&NBSP;-&GT;&NBSP, .... /init.d/ntpd136827 lrwxrwxrwx  1 root root 26 sep 14 23:55  K75BLK-AVAILABILITY&NBSP;-&GT;&NBSP, .... /init.d/blk-availability136081 lrwxrwxrwx  1 root root 15 sep 14  23:55&NBSP;K75NETFS&NBSP;-&GT;&NBSP, .... /init.d/netfs136170 lrwxrwxrwx  1 root root 17 sep 14 02:53  K75NTPDATE&NBSP;-&GT;&NBSP, .... /init.d/ntpdate136868 lrwxrwxrwx. 1 root root 19 aug  2 07:14 &NBSP;K75QUOTA_NLD&NBSP;-&GT;&NBSP, .... /init.d/quota_nld136105 lrwxrwxrwx  1 root root 19 sep 14 23:55 &NBSP;K75UDEV-POST&NBSP;-&GT;&NBSP, .... /init.d/udev-post136805 lrwxrwxrwx  1 root root 15 sep 14 23:55 &NBSP;K80KDUMP&NBSP;-&GT;&NBSP, .... /init.d/kdump136140 lrwxrwxrwx  1 root root 19 sep 14&NBSP;23:55&NBSP;K85MDMONITOR&NBSP;-&GT;&NBSP, .... /init.d/mdmonitor130669 lrwxrwxrwx  1 root root 20 sep 14 23:55 &NBSP;K85MESSAGEBUS&NBSP;-&GT;&NBSP, .... /init.d/messagebus136442 lrwxrwxrwx  1 root root 20 sep 14 23:55 &NBSP;K87IRQBALANCE&NBSP;-&GT;&NBSP, .... /init.d/irqbalance135928 lrwxrwxrwx. 1 root root 21 aug  2 07:14 &NBSP;K87RESTORECOND&NBSP;-&GT;&NBSP, .... /init.d/restorecond136979 lrwxrwxrwx  1 root root 16 sep 14 23:55 &NBSP;K88AUDITD&NBSP;-&GT;&NBSP, .... /init.d/auditd135974 lrwxrwxrwx. 1 root root 15 aug  2 07:14 &NBSP;K89RDISC&NBSP;-&GT;&NBSP, .... /init.d/rdisc136238 lrwxrwxrwx  1 root root 19 sep 14 23:55  K92IP6TABLES&NBSP;-&GT;&NBSP, .... /init.d/ip6tables135936 lrwxrwxrwx  1 root root 18 sEP&NBSP;13&NBSP;04:20&NBSP;K92IPTABLES&NBSP;-&GT;&NBSP, .... /init.d/iptables136907 lrwxrwxrwx  1 root root 18 sep 14 23:55 &NBSP;K99CPUSPEED&NBSP;-&GT;&NBSP, .... /init.d/cpuspeed136820 lrwxrwxrwx  1 root root 22 sep 14 23:55 &NBSP;K99LVM2-MONITOR&NBSP;-&GT;&NBSP, .... /init.d/lvm2-monitor136891 lrwxrwxrwx. 1 root root 14 aug  2  07:14&NBSP;K99RNGD&NBSP;-&GT;&NBSP, .... /init.d/rngd136771 lrwxrwxrwx. 1 root root 17 aug  2 07:14  S01SYSSTAT&NBSP;-&GT;&NBSP, .... /init.d/sysstat136088 lrwxrwxrwx. 1 root root 17 aug  2 07:14 &NBSP;S10NETWORK&NBSP;-&GT;&NBSP, .... /init.d/network136159 lrwxrwxrwx. 1 root root 17 aug  2 07:14 &NBSP;S12RSYSLOG&NBSP;-&GT;&NBSP, .... /init.d/rsyslog136855 lrwxrwxrwx  1 root root 14 sep&nbSP;14&NBSP;23:56&NBSP;S55SSHD&NBSP;-&GT;&NBSP, .... /init.d/sshd136229 lrwxrwxrwx. 1 root root 15 aug  2 07:14  S90CROND&NBSP;-&GT;&NBSP, .... /init.d/crond136029 lrwxrwxrwx. 1 root root 11 aug  2 07:14  S99LOCAL&NBSP;-&GT;&NBSP, .... /rc.local

7th step to start the Mingetty process

After starting the process, enter the login interface and the boot process is complete.

Linux Learning notes-boot process

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.