Linux system startup and kernel management

Source: Internet
Author: User
Tags what file system

Linux composition

Made up of kernel and rootfs.

Single Core: (Process management, memory management, network management, drivers, file system, security features)

/boot/vmlinuz-version-release

Auxiliary pseudo-Root system

/boot/initramfs-version-release.img This is an archive file in cpio format that stores a variety of drive modules

Md5sum Vmlinuz/boot/vmlinuz See if the contents of the two files are exactly the same, the MD5 value of the two files will be different as long as one character is not the same

Operation of the pseudo-root system

Unzip to view included files

 1  MV  initramfs- 3.10 . 0 -693 . El7.x86_64.img Initramfs-3.10 . 0 -693   2  3  gunzip  initramfs-3.10 . 0 -693   4  5  Cpio-tv < Initramfs-3.10 . 0 -693 . El7.x86_64.img 
View Code

Generate a pseudo file system (RAMDisk or Initramfs file creation):

(1) MKINITRD command to re-create the RAMDisk file mkinitrd/boot/initramfs-$ (uname-r) for the kernel that is currently in use. img $ (UNAME-R)

(2) Dracut command to re-create the RAMDisk file dracut/boot/initramfs-$ (uname-r) for the kernel that is currently in use. img $ (UNAME-R)

System startup process post power-on self-test

BIOS + MBR

The first 446 bytes in the MBR are stored in the bootloader program in the GRUB software.

UEFI + GPT

MBR boot

Finding the first 446 bytes of data in an MBR sector

Grub

Grub is a complex software that is installed in different locations on the disk

Part of the first 446 bytes installed in the MBR the MBR does not belong to any partition and is read and written in binary mode

The other part is installed in the/boot/grub

If you need to access the files under the boot partition, you must first identify the boot partition's file system, and if you need to identify the file system, you must first load the corresponding file system driver.

Grub Boot is divided into 3 stages

1 stage execution of the 446-byte program in bootloader

1.5 Stage MBR has the first sector, which drives the boot partition's file system to several sectors behind the MBR

2 stage read the files under the boot partition

Loading kernel files

/boot/vmlinuz-version-release start accessing the root partition on the hard disk after loading the kernel, find the root to start the first process in the system

The kernel files are released along with the release of the operating system and are stored on the disc

The root partition is passed to the kernel as a kernel boot parameter in the GRUB configuration file.

/BOOT/INITRAMFS-VERSION-RELEASE.IMG is the driver used to load the file system to which the root partition belongs, thus reading the files under the root partition

Pseudo file system files are generated temporarily when the operating system is installed, because only when you install the operating system do you know what file system type is used by the root partition

bootloader boot Loader

Windows:ntloader only boot OS does not support Linux

Linux:grub features rich support for both Linux and Windows

Windows Bootloader is installed by default when you install Windows, and Linux is installed when you install Linux bootloader

The bootloader of the installed operating system will overwrite the previously installed bootloader

One host can only install one bootloader. If you want to install a dual system on a single host, it's a good idea to install Windows before installing Linux.

Linux system startup and kernel management

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.