In RedHatEnterpriseLinux6, The init in the sysvinit package has been replaced by Upstart, which is an event-based init system. This system can process tasks and service boot during boot, shut them down during shutdown, and monitor them when the system is running. The rhel6 startup process has undergone major changes. It is very important to be familiar with the process and be helpful for system troubleshooting. --------------------------
In Red Hat Enterprise Linux 6, the init in the sysvinit package has been replaced by Upstart, which is an event-based init system. This system can process tasks and service boot during boot, shut them down during shutdown, and monitor them when the system is running. The rhel6 startup process has undergone major changes. It is very important to be familiar with the process and be helpful for system troubleshooting.
Bytes --------------------------------------------------------------------------------------------------
1. Power up the BIOS and perform hardware self-check. Then the terminal that generates int 19 reads the first bootable device, such as self-check, Initializing Various chips, controllers, and ports, including display, memory, keyboard, soft drive, and serial port, POST (Power-On Self Test) executes int h interrupt, finds the disk that can be started, loads the boot program into the memory, and gives control to the OS boot program. The system enters the OS Booting stage after the BIOS INT is executed for 19h.
Bytes --------------------------------------------------------------------------------------------------
2. A hard disk has a Master Boot Record, that is, 0-sided 0-Track 1-sector, also known as MBR. MBR is automatically loaded into the memory by the BIOS and the CPU jumps to the previous execution. The Master Boot Record (MBR), also known as the Master Boot sector, is the first sector that must be read when the computer accesses the hard disk after it is started, its 3D address on the hard disk is (cylindrical, Head, Sector) = (0, 0, 1 ). A total of 512 bytes.
_____________________________________________
|
| Boot Code 446 Byte | Partition Table 64 Byte | Terminator 2 Byte |
| _________________ | ______________ | _________ ___ |
Bytes --------------------------------------------------------------------------------------------------
3. Read the BootLoader program of the mbr of the first bootable device, which is Grub on the rhel system.
Stage1:
The stage1 file in/boot/grub is a backup file of the boot program (the first 446 bytes are the boot program) in the boot sector. It is used to load stage1.5 or stage2.
Stage1.5:
Because STAGE2 is large, it is usually placed in a file system, but STAGE1 does not recognize the file system format, so stage1.5 is required to guide STAGE2 located in a file system, according to different file system formats, STAGE1.5 also requires corresponding files, such as e2fs_stage00005 and fat_stage00005, which are used to identify ext and fat file system formats respectively. However, when stage1 loads 1.5, in principle, it does not know the ext file system and cannot find the 1.5 program. In fact, when grub is installed, the program has written the 1.5 program to the front 32 K of the hard disk, because the hard disk space that is closely connected to the MBR is usually blank and useless, grub writes the stage1.5 program to this place, there is no file system in this place. The stage1 program can directly load stage1.5.
Bytes --------------------------------------------------------------------------------------------------
4. The Grub process is guided in the second stage to read/boot/grub. the conf configuration file loads the corresponding kernel according to the definition in the configuration file, and then the kernel loads the corresponding hardware driver to initialize the necessary basic hardware.
Stage2:
Grub allows you to load, change parameters, and modify options of the OS in the option mode. All of these are functions of the stage2 program. Stage2 can obtain the content of grub. conf and menu. lst files.
[Root @ osdba ~] # Ls/boot/
Config-2.6.32-71.el6.i686 <=== System kernel configuration file, after the kernel is compiled, save this configuration file
Efi <=== Extensible Firmware Interface (EFI, Extensible Firmware Interface) is an Intel Recommendation Standard for the architecture, interfaces, and services of all new types of PC Firmware.
Grub <=== grub data directory
Initramfs-2.6.32-71.el6.i686.img <=== Virtual File System Files (RHEL6 replaced initramfs with initrd, and their purpose is the same, but the way they are processed is a bit different)
Initrd-2.6.32-71.el6.i686.img <=== this file is the main source of module supply when linux is started, initrd is to load the kernel information such as cpu and memory after the kernel system to identify the kernel information, let the system further know that the hardware is required for startup;
Symvers-2.6.32-71.el6.i686.gz <=== module Symbol Information
System. map-2.6.32-71.el6.i686 <=== is the variable correspondence table in the System kernel; (can also be understood as an index file)
Vmlinuz-2.6.32-71.el6.i686 <=== the system uses the kernel for starting the compressed kernel image.
[Root @ osdba ~] # Cat/boot/grub. conf
# Grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a/boot partition. This means that
# All kernel and initrd paths are relative to/boot/, eg.
# Root (hd0, 0)
# Kernel/vmlinuz-version ro root =/dev/sda3
# Initrd/initrd-[generic-] version. img
# Boot =/dev/sda
Default = 0
Timeout = 5
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux (2.6.32-71. el6.i686)
Root (hd0, 0)
Kernel/vmlinuz-2.6.32-71.el6.i686 ro root = UUID = bfd97ccd-15df-4e0f-8a66-b2da62213f62
Rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM
LANG = en_US.UTF-8 SYSFONT = latarcyrheb-sun16 KEYBOARDTYPE = pc KEYTABLE = us crashkernel = auto rhgb quiet
Initrd/initramfs-2.6.32-71.el6.i686.img
Default # which title is read by default without human intervention when the system is started. If multiple kernels of different versions or operating systems are installed, by default, multiple titles are generated, the first one for #0, the second one for 1, and so on.
Timeout # The timeout time for waiting for the user to start up, in seconds. At the end of the time-out period, if the user has no manual choice, the system reads the title specified by default.
Splashimage = (hd0, 0)/grub/splash.xpm.gz # grub background pattern
Hiddenmenu # Hide a menu
Title Red Hat Enterprise Linux (2.6.32-71. el6.i686) # Name of the specified menu after title
Root (hd0, 0)
# Root here is not the Administrator's meaning, here the root represents the root file system, hd represents the hard disk (do not distinguish IDE, SCSI), the first 0: the first hard disk, the second 0: the first partition.
# This indicates that the first partition of the first hard disk is the root file system.
Kernel/vmlinuz-2.6.32-71.el6.i686 ro root = UUID = bfd97ccd-15df-4e0f-8a66-b2da62213f62 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG = en_US.UTF-8 SYSFONT = latarcyrheb-sun16 KEYBOARDTYPE = pc KEYTABLE = us crashkernel = auto rhgb quiet
Initrd/initramfs-2.6.32-71.el6.i686.img
# Kernel/vmlinuz-2.6.32-71.el6.i686
After the Kernel File is read from the management of the boot loader, Linux will decompress the kernel to the main memory and use the kernel function to test and drive the peripheral devices, including storage devices, CPU, network card, and sound card. At this time, the Linux kernel will re-detect the hardware with its own functions, rather than using the hardware information detected by the BIOS. That is to say, the kernel begins to take over the BIOS. Generally, the kernel is placed in/boot and named/boot/vmlinuz.
# Ro root = UUID = bfd97ccd-15df-4e0f-8a66-b2da62213f62