Linux将磁盘格式从MBR转换到GPT

技术分享 2024-12-25

利用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类型了,并且数据完好无损。

评论 (0)

发表评论

最多500字符

验证码

暂无评论

成为第一个评论的人吧!