The full name of Grub is Grand Unified Bootloader
First generation grub0.x Grub legacy Traditional Grub
Second generation grub1.x GRUB2
The second generation and the first generation have no relation to the code, and the second generation of grub is completely rewritten.
Grub Legacy
1th stage: Run a piece of code that takes up the code location of the boot launcher
Stage 1.5: Run a piece of code, this code in the 27 sectors after bootloader, this phase of the code can be said to be a disk driver, in order to allow the first stage of the program can load the second phase of code (the second phase of the code on disk).
Phase 2nd: The 1th Stage program successfully loads the GRUB program script after the 2nd stage and executes the GRUB program and loads the kernel program. Grub configuration file exists in/boot/grub/grub.conf or/boot/grub2/grub.cfg
Note: the/boot partition must be stored with the basic disk partition
The client can choose to start the kernel file when booting the system, this program is the GRUB program.
Function:
1, provide the menu, and provide interactive interface
E: Edit mode for Edit menu
C: Enter the command line mode, also known as access to the GRUB system
2. Load the user-selected kernel or operating system
Allows the user to pass parameters to the kernel
To hide this menu
3. Provide a protection mechanism for the menu
Certification for the Edit menu
Authenticating to boot the kernel or operating system
How GRUB identifies devices
The boot partition can be partitioned individually, or it can be a directory under the root file system. The core idea is that boot must be on a basic partition.
The Grub Legacy version uses (HDN,M) to identify the partition, and the nth disk of section M partitions
Basic GRUB Concepts for Linux