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

WBOY
Release: 2022-07-13 15:23:17
Original
6453 people have browsed it

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
Copy after login

The example is as follows:

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

Method 2:

parted -l
Copy after login

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
Copy after login

Use interaction-free plus -s

parted /dev/sdb mklabel msdos -s  #转换成mbr格式
parted /dev/sdb mklabel gpt -s    #转化成gpt格式
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template