惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
Security @ Cisco Blogs
S
Secure Thoughts
Attack and Defense Labs
Attack and Defense Labs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
博客园 - 叶小钗
H
Heimdal Security Blog
Microsoft Security Blog
Microsoft Security Blog
Forbes - Security
Forbes - Security
AI
AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
爱范儿
爱范儿
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
TaoSecurity Blog
TaoSecurity Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
D
DataBreaches.Net
Recent Announcements
Recent Announcements
Schneier on Security
Schneier on Security
C
Cisco Blogs
美团技术团队
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
月光博客
月光博客
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
B
Blog RSS Feed
Cisco Talos Blog
Cisco Talos Blog
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V2EX - 技术
V2EX - 技术
Y
Y Combinator Blog
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
G
GRAHAM CLULEY
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News

Zero の 日常

MacBook M1 Pro 双屏方案 上海电信SDN更换7015TV CNAME与MX记录冲突小记 Hardware upgrade for 2022 Valve Index + HTC Tracker 3.0 开箱记录! 有手就行系列:SlimeVR全身追踪方案 基于goestools与xrit-rx的GK2A气象卫星接收教程 Prometheus实现对IDRAC的SNMP监控 Maven中央仓库项目上传指南 CQ CQ CQ DE BG5ISN PSE K 关于我买不到空气显卡这件事 Mac iTerm2 lrzsz 从零开始的飞机追踪之旅 GitHub单个文件脱敏处理 Protobuf浅解 Prometheus + AlertManager实现告警推送 Prometheus Exporter Prometheus监控系统部署 Nginx负载均衡(加权轮询)
RHEL 7.9 从 GRUB 引导启动
Zero · 2022-07-15 · via Zero の 日常

0x01 序

此文档适用于 RHEL 7.x 与 CENTOS 7.x 版本,其它版本未经过验证。

在对一批设备批量修改内核参数后,发现有一台设备失联,经检查发现该设备启动后显示 grub>,导致该原因的可能性为 grub 配置文件错误、损坏或丢失,致使操作系统无法正确引导启动,更新的内核参数如下,本次操作使用 ansible 执行,但是只有一台设备出现异常,导致该问题的原因未知,故简单简单记录下修复过程。

1
grubby --update-kernel=ALL --args="numa=off"

0x02 修复

首先列出所有的磁盘

1
grub> ls

我这边执行结果如下,系统盘为 hd0,并且包含3个分区(省略数据盘···)

(hd0),(hd0,msdos1),(hd0,msdos2),(hd0,msdos3)

确定 boot 分区

1
grub> ls (hd0,msdos2) /boot/grub

如果该目录存在,则会列出该目录下的所有文件,不存在则会报错,如果你的 boot 为独立的分区则使用下面这条命令

1
grub> ls(hd0,msdos2) /grub2

将 boot 分区临时设置为 root 目录

1
grub> set root=hd0,msdos2

加载内核

xxxx 为内核版本号,tab 补全即可。如果系统分区为 lvm,那么默认应该是 /dev/mapper/rhel-root,CentOS 应该为 /dev/mapper/centos-root,根据自己的实际情况调整,如果是非lvm文件系统,那么则需要填写实际的 label,例如 /dev/sda1

1
2
grub> linux16 /vmlinuz-xxxx.e17.x86_64 root=/dev/mapper/rhel-root
grub> initrad16 /initramfs-xxxx.e17.x86_64.img

启动系统

1
grub> boot

重建 grub 配置文件

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