Linux : Fdisk vs Parted paritioning tools

 

When to Use fdisk and parted in Linux?

fdisk vs parted - Compared

Both fdisk and parted are partitioning tools in Linux, but they serve different purposes and support different disk types.

Use fdisk When:

  • You are working with MBR (Master Boot Record) partitioned disks (older partitioning scheme).
  • The disk size is less than 2 TB (MBR supports a maximum of 2 TB).
  • You need a simple, command-line-based tool for partitioning.
  • You are dealing with legacy systems that don’t support GPT.

Example:

sudo fdisk /dev/sdb

Use parted When:

  • You are working with GPT (GUID Partition Table) partitioned disks (modern partitioning scheme).
  • The disk size is greater than 2 TB (GPT supports up to 9.4 ZB).
  • You need to create more than four primary partitions (MBR allows only four).
  • You want a scriptable, flexible tool that supports both MBR and GPT.
  • You are working on modern Linux distributions where GPT is preferred.

Example:

sudo parted /dev/sdb

Then inside parted, you can create a new GPT partition:

mklabel gpt mkpart primary ext4 1MiB 100%

Conclusion

  • Use fdisk for MBR partitions and smaller disks (< 2 TB).
  • Use parted for GPT partitions and large disks (> 2 TB).
  • If you're setting up a new system with a modern disk, parted with GPT is usually the best choice.

(Refer next blog to know more about MBR and GPT.

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)