博舍

linux下将mbr分区转换为gpt分区 mbr转为gpt无法启动

linux下将mbr分区转换为gpt分区

一、查看现有分区[root@localhost/]#fdisk-l磁盘/dev/sda:299.4GB,299439751168字节,584843264个扇区Units=扇区of1*512=512bytes扇区大小(逻辑/物理):512字节/512字节I/O大小(最小/最佳):512字节/512字节磁盘标签类型:dos磁盘标识符:0x000e7372设备BootStartEndBlocksIdSystem/dev/sda1*20482099199104857683Linux/dev/sda220992005848432632913720328eLinuxLVM磁盘/dev/mapper/centos-root:53.7GB,53687091200字节,104857600个扇区Units=扇区of1*512=512bytes扇区大小(逻辑/物理):512字节/512字节I/O大小(最小/最佳):512字节/512字节磁盘/dev/mapper/centos-swap:16.8GB,16844324864字节,32899072个扇区Units=扇区of1*512=512bytes扇区大小(逻辑/物理):512字节/512字节I/O大小(最小/最佳):512字节/512字节磁盘/dev/mapper/centos-home:227.8GB,227826204672字节,444973056个扇区Units=扇区of1*512=512bytes扇区大小(逻辑/物理):512字节/512字节I/O大小(最小/最佳):512字节/512字节[root@localhost/]#

磁盘标签类型:dos既为mbr分区

二、利用gdisk工具进行分区转换[root@localhost/]#yuminstall-ygdisk

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

[root@localhost/]#gdisk/dev/sda2GPTfdisk(gdisk)version0.8.10Partitiontablescan:MBR:notpresentBSD:notpresentAPM:notpresentGPT:notpresentCreatingnewGPTentries.Command(?forhelp):wFinalcheckscomplete.AbouttowriteGPTdata.THISWILLOVERWRITEEXISTINGPARTITIONS!!Doyouwanttoproceed?(Y/N):

输入y,开始

OK;writingnewGUIDpartitiontable(GPT)to/dev/sda2.Warning:Thekernelisstillusingtheoldpartitiontable.Thenewtablewillbeusedatthenextreboot.Theoperationhascompletedsuccessfully.[root@localhost/]#

查看分区类型

[root@localhost/]#fdisk-l/dev/sda2WARNING:fdiskGPTsupportiscurrentlynew,andthereforeinanexperimentalphase.Useatyourowndiscretion.磁盘/dev/sda2:298.4GB,298364960768字节,582744064个扇区Units=扇区of1*512=512bytes扇区大小(逻辑/物理):512字节/512字节I/O大小(最小/最佳):512字节/512字节磁盘标签类型:gptDiskidentifier:CCBAA7C6-614C-4A45-BD26-2B2EDE14236D#StartEndSizeTypeName[root@localhost/]#

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

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。

上一篇

下一篇