[步骤] Linux GRUB 的修复

步骤一:挂载系统光盘进入拯救模式

(步骤略)

步骤二:将相应分区挂载到 /mnt

# mount <系统根分区> /mnt

(补充:如果还有其他目录的话也要像这样挂载)

(注意:swap 分区不需要挂载)

步骤三:管理关在后的系统环境

# mount --rbind /proc /mnt/proc
# mount --rbind /sys /mnt/sys
# mount --rbind /dev /mnt/dev

步骤四:使用挂载后的系统环境

# chroot /mnt /bin/bash

步骤五:重装 GRUB2
5.1 生成 /boot/grub2/grub.cfg

# grub2-mkconfig -o /boot/grub2/grub.cfg

5.2 将 GRUB2 安装到对应硬盘

# grub2-install <disk>

(注意:这里的 <硬盘> 是硬盘例如 /dev/sda,而不是分区或者目录)

[内容] Linux 官方软件库链接列表 (CentOS 版)

内容一:CentOS 7 基础库列表
1.1 CentOS 7 基础库官方链接列表
1.1.1 CentOS-7 – Base

http://mirror.centos.org/centos/7/os/x86_64/

1.1.2 CentOS-7 – Updates

http://mirror.centos.org/centos/7/updates/x86_64/

1.1.3 CentOS-7 – Extras

http://mirror.centos.org/centos/7/extras/x86_64/

1.1.4 CentOS-7 – Plus

http://mirror.centos.org/centos/7/centosplus/x86_64/

1.2 CentOS 7 基础库官方推荐列表
1.2.1 CentOS-7 – Base

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=$infra

1.2.2 CentOS-7 – Updates

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=$infra

1.2.3 CentOS-7 – Extras

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=$infra

1.2.4 CentOS-7 – Plus

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=$infra

内容二:CentOS 8 基础库列表
2.1 CentOS 8 基础库官方链接列表
2.1.1 CentOS Linux 8 – BaseOS

http://mirror.centos.org/centos/8/BaseOS/x86_64/os/

2.1.2 CentOS-8 – Updates

http://mirror.centos.org/centos/8/AppStream/x86_64/os/

2.2 CentOS 8 基础库官方推荐列表
2.2.1 CentOS Linux 8 – BaseOS

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=$infra

2.2.2 CentOS Linux 8 – AppStream

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=$infra