Home >Operation and Maintenance >Linux Operation and Maintenance >How to determine whether a partition is mbr or gpt in linux
Judgment method: 1. Use the "fdisk -l" command. If the value of "Disk label type" in the displayed result is dos, the partition is mbr. If the value of the result is gpt, the partition is gpt; 2. Use the "parted -l" command. If the value of "Partition Table" in the displayed result is msdos, the partition is mbr. If the value of the result is gpt, the partition is gpt.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Method 1:
fdisk -l
The example is as follows:
Method 2:
parted -l
The example is as follows:
##Use the parted command to change the disk partition format[root@m8-9p51-duanzhengnan ~]# parted /dev/sdb (parted)mktable New disk label type? msdos Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No?YesUse interaction-free plus -s
parted /dev/sdb mklabel msdos -s #转换成mbr格式 parted /dev/sdb mklabel gpt -s #转化成gpt格式There is a small episode. According to custom, the MBR format is generally called dos under Linux. If you enter dos or mbr after New disk label type, an invalid command will be prompted. This You need to use help mktable to view the help information. You can see that the MBR partition in the parted command is called msdos. The other partitions are as follows: aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, loopRecommended learning:
The above is the detailed content of How to determine whether a partition is mbr or gpt in linux. For more information, please follow other related articles on the PHP Chinese website!