当前位置: 首页 > news >正文

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

http://www.cnnetsun.cn/news/116075.html

相关文章:

  • N-乙酰神经氨酸——连接生命与健康的“智慧糖链”核心组分 CAS:131-48-6
  • ZooKeeper:enableACL和requireClientSASLAuth
  • 为什么K8s 1.24 的容器时间调整会影响宿主机的时间啊?
  • AI时代核心竞争力:手写多智能体系统,不依赖LangChain/LlamaIndex
  • WebSocket 对比 MQTT通信优势
  • 基于springboot面料花型试衣系统
  • 域名被污染是什么意思?还能不能继续使用?
  • Python大数据基于深度学习的音乐推荐系统-250326--论文
  • Python大数据影评情感分析可视化及推荐系统的设计与实现_u5ck1y17_论文
  • AI Agent设计模式大揭秘:9种架构让你从编程小白变身架构师!
  • Python大数据基于Spark的南昌房价数据分析系统的设计与实现_45i0b357_论文
  • 9 个降AI率工具,自考人必备的降重神器!
  • 9 个降AI率工具,自考人必备!
  • 旅行记录应用新建旅行 - Cordova OpenHarmony 混合开发实战
  • 9 个降AI率工具推荐,继续教育学生必备
  • Java八股文(Java基础面试题)
  • 邦芒忠告:职场中没有好人缘的10种人
  • 基于Spring Boot人才招聘管理系统
  • 拒绝“魔法值”注入:手把手教你实现 Spring Boot 高性能枚举校验注解 @InEnum
  • 国内容易上手的claudecode一键配置指南
  • 复原IP地址
  • Redis 发布订阅
  • JQuery支持WebUploader完成百万文件断点续传的原理?
  • Vue3如何结合组件实现大文件分片的并行上传优化?
  • 类型分布统计-Cordovaopenharmony多维分析实战
  • 四时四名,一山万象:朝鲜金刚山的锦绣风姿
  • 基于Spring Boot的果蔬销售系统
  • Scala Collection(集合)
  • 介观交通流仿真软件:DynusT_(11).交通事件管理
  • django基于Python天气分析系统