linux 磁盘标签类型MBR转换为GPT

root@localhost /# fdisk -l

磁盘 /dev/sda:299.4 GB, 299439751168 字节,584843264 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000e7372

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 584843263 291372032 8e Linux LVM

磁盘 /dev/mapper/centos-root:53.7 GB, 53687091200 字节,104857600 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘 /dev/mapper/centos-swap:16.8 GB, 16844324864 字节,32899072 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘 /dev/mapper/centos-home:227.8 GB, 227826204672 字节,444973056 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

root@localhost /#

利用gdisk工具进行分区转换

复制代码
[root@localhost /]# yum install -y gdisk

转换/dev/sda2分区,sda1分区为系统启动分区,不需要转换

复制代码
[root@localhost /]# gdisk /dev/sda2
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N):

输入y,开始

复制代码
OK; writing new GUID partition table (GPT) to /dev/sda2.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[root@localhost /]# 

查看分区类型

复制代码
[root@localhost /]# fdisk -l  /dev/sda2
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sda2:298.4 GB, 298364960768 字节,582744064 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:gpt
Disk identifier: CCBAA7C6-614C-4A45-BD26-2B2EDE14236D


#         Start          End    Size  Type            Name
[root@localhost /]#

已经转换为GPT类型了,并且数据完好无损。

相关推荐
星野川崎2068 分钟前
电商多店运维:云机24小时挂机频繁掉线、账号无故风控深度原因分析及解决方案
大数据·运维·服务器·云计算·电商
ltl20 分钟前
新硬件对存储的影响:ZNS、CXL 与计算存储
linux
RisunJan1 小时前
Linux命令-xauth(X11 认证授权管理)
linux·服务器·microsoft
不灭的程序员阿澄2 小时前
在飞牛 NAS 上用 Docker 运行 DeepSeek Harness
运维·docker·容器
Elastic 中国社区官方博客3 小时前
让大模型思考,让小模型执行:在 Elastic Workflows 中拆分 LLM 成本
大数据·运维·数据库·人工智能·elasticsearch·ai
艾伦_耶格宇3 小时前
【AI】-4 OpenCode Go 接入 Obsidian 完整指南
运维·开发语言·人工智能·agent·opencode
SXkehuirongsheng3 小时前
APP开发定制和模板开发哪个更实用?
大数据·运维·人工智能
fb_123454 小时前
Linux三剑客超全精讲(grep+sed+awk)零基础入门|正则+实战面试题
linux·运维·服务器
HiDev_5 小时前
【非标自动化】2、认识元器件(节流阀)
运维·自动化
火车叼位5 小时前
Bash 实现 IDE 式补全的组件与配置
linux·运维