In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Linux operating system boot process is what, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
1. Preface
We will review the boot process in the Linux operating system. How the operating system passes through different startup status phases. It is important to understand how Linux starts for effective troubleshooting in the event of system failure. When the system is turned on, a few minutes later, we get a login prompt. Have we tried to find out what happens at all stages of the startup sequence and what happens behind the scenes during system startup?
two。 Start the power supply
The BIOS basic input and output system is a software program that is preset in the motherboard chipset.
BIOS loads and scans devices such as hard drives, CD-ROM, RAM, etc.
BIOS searches for the MBR of the primary hard drive (master boot record: first sector), scans for the first stage loader (in our example, the boot loader is (GRUB LILO), and transfers responsibility to MBR.
Boot PROM/FLASH/BIOS is adept at loading MBR into RAM and executing it.
3. MBR (Master Boot Record)
512 bytes of space-> MBR
MBR contains loader information for most operating systems. Such as UNIX, Linux and WINDOWS.
MBR stores binary information for the loader phase.
MBR includes the physical sector of the first disk drive (usually 512bytes), which is not part of any partition.
Placed on the primary disk drive, the main sector of the first cylinder of the track is 0 and the head is 0 (this entire path is usually booked for the bootstrap)
MBR includes a small executable and a table that specifies the primary partition.
BootCode (GRUB) 446bytespartition1:16bytespartition2:16bytespartition3:16bytespartition4:16bytesmagicNumber:2bytes
MBR also records which primary partition is active.
BIOS submits permissions to the first stage boot loader, which starts the loader and then scans the partition table and finds the second stage boot loader on the partition configured to be bootable.
4. Linux operating system bootstrap Boot Loader
The boot loader is defined from the first stage loader and loads itself into RAM. All of this happened in milliseconds.
The default second stage boot loader is GRUB (Grand Unified boot loader) or LILO (Linux loader)
Once GRUB is loaded into RAM, it searches for the location of the kernel.
GRUB will carefully examine the mapping file to find the kernel image located under (/ boot) and load it.
GRUB loads the kernel from the / boot partition (vmlinux-version)
Linux operating system Bootstrap Boot Loader
5. Grub of Linux operating system bootstrap
GRUB is initrd-> organization RAMDISK (RAMDISK is the space reserved from RAM). In addition, it drives initrd into RAM so that the kernel is ready to load itself into memory and dependent modules, so it can leave the system to the "init" process
Grub of the bootstrap of Linux operating system
In Linux, most drivers are pre-built as modules, which are the initial ram drivers (initrd.img), which hold all the information about the add-in. Therefore, when the kernel boots, it creates the ramdrive and loads the initrd.img and its associated modules.
GRUB read / boot/grub/grub.conf provides a clean interface for users to choose an operating system.
Once the kernel loads the module it depends on, it is handed over to the "init" process. The kernel image has a small, unpackaged program that decompresses the kernel and runs it.
6. LILO of the boot process of Linux operating system
In order to locate the operating system on the hard disk, LILO needs to instruct MBR. Any changes made to / etc/lilo.conf must be updated in MBR, but do not need to be updated in the case of GRUB, it is read directly from the file / boot/grub/grub.conf.
After the / etc/lilo.conf changes, we must update the MBR manually
LILO of booting process of Linux operating system
/ sbin/lilo-v
7. The second phase of the boot process of the Linux operating system
The GRUB second phase loader resides in the MBR and / boot partitions. Once the GRUB is loaded into memory, it becomes the second phase loader.
8. The third stage of the boot process of the Linux operating system
The / initrd directory should not be deleted, which is a temporary placeholder for modules (including device drivers) needed by the kernel to quickly access startup system modules.
9. The key points of Linux kernel initialization include:
Initialize CPU components, such as MMU
Initialize the scheduler (PID 0)
Mount the root file system in rw mode
Derived init process (PID 1)
In essence, kernel initialization does two things:
Start the core system of shared resource managers (RAM, processors, and mass storage).
Start a single process / sbin/init
The Init process (sbin/init) is the first process that loads all the different daemons and mounts all partitions listed under / etc/fstab.
10. About / etc/fstab
/ sbin/init read / etc/inittab file
Set the default run level (the telinit command allows the administrator to tell the init process to change its current run level)
Call / etc/rc.d/rc.sysinit and / etc/rc.d/rc x (where "x" is a runtime)
The script that kills the process is represented by the letter K in the / etc/rc.d/rc5.d directory file. The file begins with the letter S for the startup script.
Start the tty process and xdm (X display manager)
Launch the user login screen
After reading the above, have you mastered the method of booting the Linux operating system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.