In a computer, MBR and GPT are two ways of storing the partitioning information on a disk. The MBR is a legacy while GPT is a newer disk partitioning style which requires to boot the system in UEFI mode.
Most of the modern system comes with only UEFI support, a disk should be in GPT format if you want to boot it on these systems.
Here in this article, we will explain how to check if a disk is using GPT or MBR in Linux.
Check if your disk is GPT or MBR using gdisk tool
Before you use gdisk command, first run the given command in your terminal to install gdisk if it is not in your system –
sudo apt install gdisk -y
After installing gdisk use the following command to list the available disks –
sudo fdisk -l
Now see the list and identify the correct disk where you want to check the partitioning style of the disk.
To check if the disk is GPT or MBR use the following command in your terminal –
sudo gdisk /dev/sda1
In the above command
/dev/sda1 is my disk that we are going to scan to check which partition table is present on the disk. Repalce it with the your disk name.
This command will scan for the partition table present on the disk and display it inside the terminal. See the image below the highlighted part shows that the disk is MBR only.
If the partitioning style of the disk is GPT then it will display the output as given in the image below –
GPT or MBR: Check using the parted command
The parted command is also used to create and manipulate the partition table. It supports multiple partition table formats including MBR and GPT.
We can use the patrted command to check the partition table format, use the following command in your terminal –
sudo parted /dev/sda1 p
And this will display the output as given in the image below. The partition table present on this disk is gpt.
There may some other ways to check the partition table format on a disk. The method describes one of the easiest ways to find if disk uses GPT or MBR. Now if you have a query on this topic then write us in the comments below.