Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for installing GRUB on Linux server

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How to install GRUB for a Linux server

When you are unable to migrate Linux servers with lower kernel versions, such as CentOS 5 and Debian 7, with your own system bootstrap GRand Unified Bootloader (GRUB) version less than 1.99 through the cloud migration tool. And when the log file prompts Do Grub Failed, it may be because version 1.99 of the system bootstrap program GRUB is not installed.

This article focuses on how to install the system bootstrap GRUB version 1.99 for your source server. The process of installing GRUB version 1.99 and above such as 1.99 and 2.02 is the same. The main difference is that the GRUB version source code package downloaded during installation is different. You can visit https://alpha.gnu.org/gnu/grub/ to obtain the download address of the new version.

Install GRUB version 1.99

Log into the source server.

Run the following command to view the paths to the original grub, grub-install, and grub-mkconfig:

Which grubwhich grub-installwhich grub-mkconfig

Use the mv command to rename older versions of grub, grub-install, and grub-mkconfig to back up files. After using the cloud migration tool to migrate the server, you can restore the original name to use the original configuration.

Mv / sbin/grub / sbin/grub-oldmv / sbin/grub-install / sbin/grub-install-old mv / sbin/grub-mkconfig / sbin/grub-mkconfig-old

Run yum install-y bison gcc make to install bison, gcc, and make tools that GRUB depends on.

Run the following command to install flex.

Test-d / root/tools | | mkdir-p / root/toolscd / root/toolswget https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gztar xzf flex-2.6.4.tar.gzcd flex-2.6.4mkdir-p buildcd build../configuremake & & make installln-s / usr/local/bin/flex / usr/bin/flex

Run the following command to install the GRUB 1.99 dependency.

Test-d / root/tools | | mkdir-p / root/toolscd / root/toolswget https://alpha.gnu.org/gnu/grub/grub-1.99~rc1.tar.gztar xzf grub-1.99~rc1.tar.gzcd grub-1.99~rc1mkdir-p buildcd build../configuresed-I-e "s/-Werror//". / grub-core/Makefilemake & & make installln-s / usr/local/sbin/grub-install / sbin/grub-installln-s / usr/local/sbin/grub-mkconfig / sbin/grub-mkconfig

Note: if a-Werror error occurs in the compilation process, you can navigate to the compilation file makefile of the compilation object, and recompile without the-Werror option.

Run grub-install-- version to check that the GRUB version is updated to 1.99.

Next step

After successfully updating the system bootstrap GRUB version 1.99, you can use the cloud migration tool to migrate the server to Aliyun.

(optional) after the cloud migration is successful, run the following command to restore the old version of GRUB:

Rm / sbin/grub-installrm / sbin/grub-mkconfigrm / boot/grub/grub.cfgmv / sbin/grub-old / sbin/grubmv / sbin/grub-install-old / sbin/grub-install

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report