news 2026/6/10 12:36:49

GPT格式分区扩展问题记录“GPT:Alternate GPT header not at the end of the disk.”

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
GPT格式分区扩展问题记录“GPT:Alternate GPT header not at the end of the disk.”

背景

在使用阿里云 redhat 8.2 镜像创建实例时启动信息中如下错误信息打印

[ 3.006529] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 3.007973] GPT:20971519 != 41943039 [ 3.008692] GPT:Alternate GPT header not at the end of the disk. [ 3.009702] GPT:20971519 != 41943039 [ 3.010444] GPT: Use GNU Parted to correct GPT errors. [ 3.011358] vda: vda1 vda2 vda3

原因分析

redhat 8.2 使用的是 gpt 格式分区,gpt 格式分区有两个分区表,分别位于分区的首尾

第一个分区表叫作 Primary GPT, 第二个叫作Backup GPT, 也叫作Alternate GPT。

阿里云基础镜像是大小是20G,在实例创建时,会根据用户的选择的大小 进行在线扩容,比如 用户选择的是40G ,那么实例启动时的 分区表 大致结果如下:

这就导致 第二个 gpt table 不在磁盘的末尾,所以启动时内核会报 Alternate GPT header not at the end of the disk。 在实例初始化过程中,cloud-init 会进行分区及文件系统扩容,(扩容至40G) 扩容后的 gpt 分区表大致如下

第二个gpt table 又回到了磁盘的末尾。

所以 在实例启动后,再次重启 ,启动信息中就没有这个报错信息了。

如果要复现这个错误信息,可以给实例 进行 在线磁盘扩容,扩容后执行 fdisk -l

[root@redhat8-2 ~]# fdisk -l GPT PMBR size mismatch (83886079 != 209715199) will be corrected by write. The backup GPT table is not on the end of the device. This problem will be corrected by write. Disk /dev/vda: 100 GiB, 107374182400 bytes, 209715200 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 7E3CDFD9-E4C6-44E5-B774-8875B5C717C5 Device Start End Sectors Size Type /dev/vda1 2048 4095 2048 1M BIOS boot /dev/vda2 4096 208895 204800 100M EFI System /dev/vda3 208896 83886046 83677151 39.9G Linux filesystem

会打印The backup GPT table is not on the end of the device 这个信息,此时重启机器,系统启动信息就会打印 GPT:Alternate GPT header not at the end of the disk. 这样的错误了。 执行分区及文件系统扩容后,再重启就 dmesg 里不会有这个信息了。

growpart /dev/vda 3 xfs_growfs /

参考链接

https://access.redhat.com/solutions/3236591

https://access.redhat.com/solutions/114503

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/1 14:10:50

强化学习REINFORCE求最优策略的代码实现

理论基础:注意:1. 策略的输出要加对数,因此net输出必须softmax,将输出限制为正数。2. 这里选择action不是greedy地选择最优action,而是按照概率分布选择action->exploration。3. 策略更新使用的是梯度上升&#xff…

作者头像 李华
网站建设 2026/6/9 6:23:20

Java 的现实主义哲学:一门为“失败必然发生”而设计的工程语言

在很多技术宣传中,系统总是被描述得近乎完美:高可用、高性能、可无限扩展。 但真正做过工程的人都知道: 失败不是例外,而是常态。系统会超载、依赖会失效、数据会异常、人为失误一定会发生。 区别只在于——系统是否为失败做好了准…

作者头像 李华
网站建设 2026/6/2 16:24:22

串练习--------首字母大写HDOJ2026

题目&#xff1a;HDOJ 2026 代码 /* HDOJ 2026 https://acm.hdu.edu.cn/showproblem.php?pid2026 首字母大写 */ #include<iostream> #include<cstring> using namespace std; char a[105]; int main() {while (fgets(a, sizeof(a), stdin)) {//getchar();这里不…

作者头像 李华
网站建设 2026/6/10 15:42:29

等保测评全流程实操手册:从自查到验收,一步不踩坑

2025年3月20日起&#xff0c;新版《网络安全等级测评报告模板》正式启用&#xff0c;标志着等保测评进入“精准防控”新阶段。对企业而言&#xff0c;合规不再是简单满足条款&#xff0c;而是要应对云原生、物联网等新增场景的防护要求&#xff0c;这让不少运维人员在测评中频频…

作者头像 李华