Summary of the relationship between Mbr&/boot and grub

Source: Internet
Author: User

Made a nature porter, introduced well, backed up under

The MBR is a sector on the hard disk that contains three parts (a bootstrapper, a partition table and a delimited identity, a total of 512 bytes in the MBR, a bootstrapper that takes up to 446 bytes), and why this MBR is needed, mainly because the BIOS is too small and has limited functionality. When the system is on power, the BIOS self-test will load the MBR into memory. This means that the bootstrapper is activated, the partition table information is loaded into memory, and it means that the control of the system transitions from BIOS to grub.

GRUB is the abbreviation for Grand Unified bootloader, which is a multiple operating system startup manager. Used to guide different systems. Grub is a system boot program that is divided into two phases 1. The first stage it is stored in the MBR. Written in assembly language, which is the part of the boot program in the MBR. ① Basic Hardware Device initialization (masks all interrupts, shuts down processor internal instructions/data cache, etc.). ② prepare space for the Stage2 that loads the Bootloader. ③ if it is from a solid-state storage medium, copy the Bootloader stage2 into RAM space. ④ set the stack. ⑤ jumps to Stage2 's C program entry point. 2. The second phase of the Grub boot program, usually written in C, has the following tasks: ① Initializes the hardware device to be used at this stage. ② detects system memory mappings. ③ reads the kernel image and the root file system image from Flash to ram space. ④ set the startup parameters for the kernel ⑤ call the kernel. It is usually stored in/boot/grub/. When we start the system into the grub interface, we see selective information, and if we compile the system kernel ourselves, you can choose to boot from a kernel. Also note that the grub configuration file and kernel are in the/boot partition. As we can see from the previous analysis, there is no inclusion relationship between the/boot and the MBR. The first phase of grub needs to go to the MBR to read the bootstrapper, and Grub II needs to read the system kernel and configuration files to the/boot partition.

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.