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