CentOS system Start-up process

Source: Internet
Author: User

CentOS 6 startup process:

POST--Boot Sequence (BIOS)--BootLoader (MBR)--Kernel (RAMDisk)--Rootfs Switchroot /init---/etc/inittab,/etc/init/*.conf--Set the default run level--system initialization script--shut down or start the service under the corresponding level-boot terminal grub (boot Loa Der):

    1. Grub:grand Unifiedbootloader

    2. Grub 0.x:grub Legacy

    3. Grub 1.X:GRUB2 Grub Legacy:

    4. Stage1:mbr

    5. STAGE1_5:MBR after the sector, so that the stage1 in the bootloader can identify the Stage2 partition on the file system;

    6. Stage2: Disk Partitioning (/boot/grub/) Profile:/boot/grub/grub.conf <--/etc/grub.confstage2 and kernels are typically placed on a basic disk partition;



Function:

(1) menu and interactive interface available

E: Edit mode, for editing menus;

C: Command mode, interactive interface;

(2) Loading the user-selected kernel or operating system

Allow parameters to be passed to the kernel

To hide this menu

(3) provides a protection mechanism for the menu

Certification for the Edit menu

To enable the kernel or operating system for authentication how to identify the device:


Linux Kernel:

CentOS Boot process: POST--Bootloader (BIOS, MBR)--Kernel (INITRD)--rootfs---Switch_root

Kernel Design System: Single core, micro core

Linux: Single-core design, but fully learn the advantages of micro-kernel system design, the introduction of the kernel of the modular mechanism;

Components of the kernel:

Kernel: Kernel core, generally bzimage, usually located in the/boot directory, named Vmlinuz-version-release;

Kernel object: Kernel objects, kernel modules, typically placed in/lib/modules/version-release/

components of the kernel:kernel, kernel object, RAMDisk

Kernel:uname

Kernel object:lsmod, Modinfo, Modprobe,insmod, Rmmod, Depmod

Ramdisk:mkinitrd,dracut START Process: POST--Bootsequence (BIOS)--Bootloader (MBR)--Kernel (ramdisk)--Rootfs (switch_root)-/sbin/init (/etc/inittab,/etc/init/*.conf,/usr/lib/systemd/system/)--default RunLevel, System initialization, Shut down and start the service, start the terminal (graphics terminal)

Grub:

1st STAGE:MBR

1_5 the sector after STAGE:MBR

2nd stage:/boot/grub/Encryption: Edit, kernel



(hd#,#)

hd#: Disk number, expressed as a number; numbering starting from 0

#: Partition number, expressed in numbers; Numbering starting from 0 (hd0,0) Grub command-line interface

    1. Help: Get assistance list

    2. Help KEYWORD: More information

    3. Find (hd#,#)/path/to/somefile:

    4. Root (hd#,#)

Kernel/path/to/kernel_file: Set the kernel file used in this boot, and add many cmdline parameters which the kernel supports.

Example: Init=/path/to/init, selinux=0

    1. Initrd/path/to/initramfs_file: Set the RAMDisk to provide additional files for the selected kernel;

    2. Boot: Booting the selected kernel, manually booting the system on the GRUB Command line interface:

    3. grub> Root (hd#,#)

    4. Grub> Kernel/vmlinuz-version-release Roroot=/dev/device

    5. Grub> initrd/initramfs-version-release.img

    6. grub> Boot configuration file:/boot/grub/grub.conf


Configuration items:

    1. default=#: Sets the default Start menu item, and the entry (title) number starts at 0;

    2. timeout=#: Specifies the length of time the menu item waits for an option to be selected;

    3. Splashimage= (hd#,#)/path/to/xpm_pic_file: Indicates the menu background picture file path;

    4. Hiddenmenu: Hide menu;

    5. Password [--MD5] STRING: Menu Editor authentication;

    6. Title Title: Define the menu item "title", can appear multiple times;

    7. Root (hd#,#): Grub finds the device partition where the Stage2 and kernel files are located; "root" for grub;

    8. Kernel/path/to/vmlinuz_file [PARAMETERS]: Boot kernel

    9. Initrd/path/to/initramfs_file: Kernel-matched Ramfs file;

    10. Password [--MD5] STRING: Authentication when the selected kernel or operating system is started; Grub-md5-crypt command enters single-user mode:

(1) Edit the Grub menu (select the title to edit, then use the e command);

(2) attach after selected kernel

1, S, s or single can be;

(3) In the kernel line, type "b" command; Install Grub:

(1) Grub-install

Grub-install--root-directory=root/dev/disk (2) Grub

grub> Root (hd#,#)

grub> Setup (hd#) Exercise:

1, new hard drive, to provide direct operation of the bash system alone;

2, the destruction of the native grub Stage1, and then in the rescue mode repair;

3. Set up protection function for grub; blog job: Grub Application;


Kernel module and kernel Core version must be strictly matched; []:n

[M]:module

[*]:y, compiled into kernel core kernel: dynamic loading and unloading; RAMDisk: Auxiliary files, not required, depending on whether the kernel can directly drive the device Rootfs;

Target device drivers, such as SCSI device drivers;

Logical device drivers, such as those of LVM devices;

File systems, such as XFS file systems; RAMDisk: is a lite version of the root file system; Kernel Information acquisition:


This article is from the "Perfect World" blog, so be sure to keep this source http://angelababy.blog.51cto.com/6326130/1755127

CentOS system Start-up process

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.