Linux : GPT vs MBR

 

Modern Disk: GPT vs. MBR Partitioning Schemes

When setting up a new disk, you have two main partitioning schemes to choose from: MBR (Master Boot Record) and GPT (GUID Partition Table). Let’s break them down:


1. MBR (Master Boot Record)

Best for:

  • Older systems (Legacy BIOS-based booting).
  • Disks smaller than 2 TB.
  • Simple partitioning needs (up to 4 primary partitions).

Limitations:

  • Maximum disk size: 2 TB.
  • Can have only 4 primary partitions (or 3 primary + 1 extended partition with logical partitions inside).
  • Less resilient to corruption (bootloader issues can make the system unbootable).

🛠️ How to Check if a Disk Uses MBR?


sudo fdisk -l /dev/sdX

If you see Disklabel type: dos, it means MBR.


2. GPT (GUID Partition Table)

Best for:

  • Modern systems (UEFI-based booting).
  • Disks larger than 2 TB.
  • Creating more than 4 partitions (supports up to 128 partitions).
  • Better error recovery (stores multiple copies of partition data).

Limitations:

  • Not supported on very old BIOS-only systems.

🛠️ How to Check if a Disk Uses GPT?


sudo parted /dev/sdX print

If you see Partition Table: gpt, it means GPT.




Key Differences Between MBR and GPT












Which One Should You Use?

Use MBR if:

  • You are working with a legacy BIOS system.
  • Your disk is smaller than 2 TB.
  • You only need basic partitioning (≤ 4 partitions).

Use GPT if:

  • Your system supports UEFI boot.
  • Your disk is larger than 2 TB.
  • You need more than 4 partitions.
  • You want better data protection and performance.

How to Convert Between MBR and GPT?

⚠ Warning: Converting will delete all data on the disk! Backup first.

 

🔄 Convert MBR to GPT:

sudo parted /dev/sdX mklabel gpt

🔄 Convert GPT to MBR:

sudo parted /dev/sdX mklabel msdos


To know more about BIOS and UEFI, refer previous blog!

Thank you.















 




 
       


=======================================================================
Thank you, check out more blogs for such information..!
For any queries,feel free to reach out me on shubhammore07007@gmail.com

Comments

Popular posts from this blog

Nginx : Setting Up Nginx with Load Balancing

Nginx : Virtual hosting using Location directives

Terraform project with AWS to build infra within seconds! (Web Ec2 with eIP)