一、查看現有分區
[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 /]#
磁盤標簽類型:dos 既為mbr分區
二、利用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類型了,並且數據完好無損。