How to check if a disk uses GPT or MBR in Linux?
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.
Contents
Check if your disk is GPT or MBR using gdisk tool
The gdisk is a command-line menu-driven program for the creation and manipulation of the partition table. It can be used to convert an MBR disk to GPT or a GPT disk to MBR.
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.
Conclusion
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.
About author
You might also like
How to Download, Extract and update the Linux Kernel source
This post was last updated on December 1st, 2020 at 05:38 pmWhen you are starting to learn Linux development or Device driver development, then the first thing you need is
How to Unload or Blacklist Module in Linux
This post was last updated on January 22nd, 2019 at 11:06 amSometimes you need to unload a kernel module to load your own written code or you want to replace
How Manually Partition A Disk During Installation of Ubuntu?
This post was last updated on October 12th, 2020 at 08:31 amA partition is nothing but a logical division of a physical disk. Partition makes it easy to organize and
0 Comments
No Comments Yet!
You can be first to comment this post!