CentOS 5 CentOS 6 startup process and key steps

Source: Internet
Author: User
Tags network function

CentOS 5 CentOS 6 START process and key steps

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/00/wKiom1YLxFGQwfI-AACjpunNGng763.jpg "title=" 1.png " alt= "Wkiom1ylxfgqwfi-aacjpunngng763.jpg"/>

1 , power-on self-test: When the host power is turned on, the main opportunity wakes the CPUto run the BIOS in the CMOS,

BIOS checks for the presence of necessary hardware (memory, hard disk, etc.)

The BIOS is actually a small system that can perform some tasks like detection.

If the self-test does not pass, shut down the machine

2 , BIOS to find a bootable device

self-test pass, according to The boot sequence of the BIOS setting (typically a hard drive, disc boot, mobile device startup, and network boot, etc., this setpoint can be modified by manual intervention to load different systems) to find the first to have a boot program (bootloader) is to load the device, Otherwise continue to find

3 , MBR Boot

bootstrapper in windows ntloader linux LInux loader Centos5 6 etc version is GRUB 0.x bootloader mbr ( 512 446 bytes 64 bytes is the partition table, the remaining two bytes indicate whether the partition table is available

4 , GRUB find the load to be loaded Kernel

here to C5 C6 , for example, the main function of GRUB is to provide a menu that allows the user to choose to launch the system or a different kernel version, load the user-selected kernel into a specific space in memory, unzip the deployment, and transfer control of the system to the kernel. More than one operating system may be installed on one host, and the user can select the operating system based on the boot menu provided by GRUB and load the specified kernel

         grub divided into three stages,

Stage 1 One piece of code in this code is Bootloader (446 bytes ) in the MBR , This step is essential in GRUB and is primarily responsible for when the BIOS when handing over to GRUB , load the boot files that exist in each partition, the so-called Boot management program. Its size is approximately bytes

stage1_5This code is immediately followed by theMbr, AuxiliaryGrubIdentifyStage2The disk where the file system resides. stage1.5is loaded, it has been givenGRUBability to access the file system directory(This program has access toStage2file system drivers), so that nature can not be found at the beginningStage2In the case of the file system directory, locate theStage2location, and activate theLinux.

its size about 32K

Stage 2 in the boot directory, it is not necessarily on the root partition, that is, it can be partitioned independently;

Stage provides a GRUB boot Menu for users to select different operating systems to choose from

provides options to access the configuration file, connect to the next bootsector (more than one system may be installed on the host, possibly manually select which system to start, or modify its configuration file to achieve different effects)Stage2 The main is based on the configuration file, or manually select, set up the required kernel or system!

Press any key during system read seconds to enter GRUB selects the menu, for example, if you have more than one operating system on your console, you can choose different operating systems depending on your needs;650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/ 73/fd/wkiol1ylxhbirgqiaafnxpfq4dc020.jpg "title=" 2.png "alt=" Wkiol1ylxhbirgqiaafnxpfq4dc020.jpg "/>

Take a closer look at the options below the menu and type the E key to enter edit mode before booting, e.g.,

The first row in the box represents the location of the boot directory, where it is the first partition of the first disk,

The second line in the box is your kernel location and kernel,

The third row in the box RAMDisk(Ramfs), which is a virtual file system, can be found in the root partition location to facilitate the kernel to find the root partition,init program, As well as the necessary drivers, library files

in this interface, if you type the E key again, you can change the options you choose!

in both of these interfaces you can also press C to enter the GRUB command

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/FD/wKioL1YLxIeSzWBhAAG_XY-tJ88444.jpg "title=" 3.png " alt= "Wkiol1ylxieszwbhaag_xy-tj88444.jpg"/>

in the above two interfaces you can also press C to enter the GRUB command line mode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/00/wKiom1YLxImi6gUgAAFI0aCupd8629.jpg "title=" 4.png " alt= "Wkiom1ylximi6gugaafi0acupd8629.jpg"/>

This allows you to manually specify the kernel and initrd to start the system

5 , loading the kernel s

         grub through Grub2 grub will cpu< Span style= "font-family: ' The song Body '; The control is given to the kernel; cpu Cpu kernel Ramdisk find the real root partition, mount the root filesystem in read-only mode, and complete the root switch.

Linux kernel is a single core system design , but the modular mechanism is introduced; Kernel core is common (/boot/vmlinuz) , kernel objects (lib/modules/version-release) , auxiliary files (/boot/[initrd|initramfs])

Kernel the function : Process management, memory management, file system management, network management, driver management, security features

RAMDisk have root filesystem driver, root file system, is generated dynamically based on the root partition file system and hardware driver when installing the system .

         ramdisk in c entos5 ( Initrd) is in the format of a disk, cpu CentOS 6, or /boot/ Initramfs-version-release.img

RAMDisk files are available through MKINITRD or Dracut Command Making , the production principle and the dynamic generation when installing the system

6 , run /sbin/init

int is the starting point for all processes, Init program is responsible for creating processes and destroying processes

Init program in CentOS5 SysV(service serial run, slower) configuration file in/etc/initab , in CentOS6 in the Upstart (close to parallel running, faster) , configuration files are /etc/inittab and /etc/init/*.conf

Linux has seven levels of operation:

Init0 equivalent to shutting down the machine

Init1 Single-user mode (root no login required)one, maintenance mode

Init2 Multi-user mode, which starts the network function by default, but does not start NFS, Maintenance mode

INIT3 Multi-user mode, normal mode; text interface

INIT4 reserved level, Normal mode, graphical interface

INIT5 Multi-user mode, graphical interface

Init6 equivalent to restart

definition of content under configuration file /etc/inittab

ID : Runlevel:action:process

ID:3:initdefault indicates that the default boot level is 3and automatically enters the character interface

Si::sysinit:/etc/rc.d/rc.sysinit System initialization

L#:#:WAIT:/ETC/RC.D/RC 0 When you type init # , enter the runlevel

tty1:2345:respawn:/usr/sbin/mingettytty1 Run mid- tier Tty1 at 2345 level

Note: CentOS6 is by /etc/init/rcs.conf Start the service

When the specified level is entered, the service at the specified level is run, and the service script link under the specified level, when entered in the specified level, runs under its directory (kill or start script beginning with k/s )

You can also manually modify, delete, or add services under a certain level (chkconfig)

7 , System initialization

according to /etc/rc.d/rc/rc.sysinit/ The system initialization script implements the

(1) Set host name

(2) Setting up the Welcome screen

(3) activate udev and SELinux

(4) Mount The file system defined in the/etc/fstab file

(5) Detecting the root file system and re-mounting the root filesystem in read and write mode

(6) Setting the system clock

(7) activate swap device

(8) Set kernel parameters According to /etc/sysctl.conf file

(9) activation of LVM and software RAID devices (hard raid is initiated at boot time)

(Ten) Load additional device drivers

(one) cleanup Operations

The specified service is run at the specified level since this boot is complete

(3) after kernel2.4 (3) , udev mainly generates/dev based on the files in the/sys directory when the system first accesses the hardware. to facilitate administrator-managed hardware

(5) with the help of RAMDisk,kernel for the first time to load the root file system as read-only mode, such as memory,

It can read only, cannot write data, and this time it will load the root filesystem in read and write mode.


This article is from the "Fall Camel" blog, so be sure to keep this source http://fallcamel.blog.51cto.com/8079848/1699646

CentOS 5 CentOS 6 startup process and key steps

Related Article

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.