Home>Article>Operation and Maintenance> How to determine whether a partition is mbr or gpt in linux

How to determine whether a partition is mbr or gpt in linux

WBOY
WBOY Original
2022-07-13 15:23:17 6190browse

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.

How to determine whether a partition is mbr or gpt in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to determine whether a partition is mbr or gpt in Linux

Method 1:

fdisk -l

The example is as follows:

How to determine whether a partition is mbr or gpt in linux

Method 2:

parted -l

The example is as follows:

How to determine whether a partition is mbr or gpt in linux

##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?Yes

Use 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, loop

Recommended learning:

Linux video tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn