In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how to repair the damage of grub.cfg files under the Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The grub.cfg file introduces the location of the 1.grub.cfg file.
/ boot/grub2/grub.cfg
[root@node1 grub2] # lsdevice.map fonts grub.cfg grubenv i386-pc [root@node1 grub2] # pwd/boot/grub2 [root@node1 grub2] # 2.grub.cfg File functions grub is the program that boots the operating system. It will boot the kernel according to its own configuration file. When the kernel is loaded into memory, the kernel will find the driver corresponding to the file system used by the root partition according to the configuration in the grub configuration file. Through the corresponding driver of the root partition file system, mount the root partition, so as to achieve the purpose of booting the operating system. 3. Introduction of system startup process 1. Load MBR into memory, MBR=512 bytes = bootstrap (446 bytes) + 64 bytes (partition table) + 2 bytes 2.BIOS load grub bootstrap, system control is given to bootstrap. 3. The bootstrapper loads the configuration file / boot/grub2/grub.cfg, tells / boot the partition where the directory is located and where the kernel file is, loads the kernel and initramfs, and places it in memory. Initramfs contains the necessary kernel modules and initialization scripts for the hardware at startup. The 4.Kernel initializes itself, and the kernel finds the drivers for all the hardware in initramfs and initializes the hardware. The / sbin/init in 5.initramfs starts with a process with pid as 1 and links to systemd. 6. The kernel switches the root from initramfs to the real root. 7. Start the first program, system II, grub.cfg file is damaged, the system boot interface
Third, repair step 1. Specify the partition where the / boot directory is located
two。 Load the kernel file and mount the root partition as read-only
3. Specify the initramfs file
4. Start
5. Enter the system and regenerate the grub.cfg file
Note: when mounting the root partition, fill in it according to the actual situation. When the system disk is installed by default, when the system disk is in nvme format, the root partition is / dev/nvme0n1p3.
The system disk is a sata hard disk, and the root partition is usually / dev/mapper/rhel-root, or the system partition that is customized when you install the system.
This is the end of the content of "how to repair the damage of grub.cfg files under the Linux system". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.