fdisk vs parted – Compared

Written by: Bobbin Zachariah   |   Last updated: November 1, 2023

fdisk and parted are command-line utilities in Linux for managing disk partitions. While both serve the same purpose, they come with different features and compatibilities.

fdisk

fdisk is a traditional disk partitioning tool primarily designed for MBR (Master Boot Record) partition tables.

Key Features

  • MBR Support: Traditionally used for creating and manipulating MS-DOS partition tables.
  • GPT Support: Recent versions support GPT (GUID Partition Table) but it's considered experimental.
  • Interactive Mode: Offers a menu-driven interface.
  • Automatic Alignment: Aligns partitions on a one-megabyte boundary when DOS compatibility mode is off.
  • Scripting: Can be used in scripts, although not as straightforward.

Usage

# Launch fdisk in interactive mode
sudo fdisk /dev/sda

# Sample commands in interactive mode
n   # Create a new partition
p   # Print the partition table
w   # Write changes

parted

parted is a more modern tool designed to handle large disks and supports multiple partition table formats.

Key Features

  • GPT and MBR Support: Can manipulate both GPT and MBR partition tables.
  • Larger Disk Support: Can handle disks larger than 2TB.
  • More Partitions: Supports up to 128 partitions in GPT by default.
  • Resizing: Can shrink and extend partitions.
  • Interactive and Command-Line Modes: Offers flexibility in usage.
  • Alignment: Warns about improper alignment but aligns only the partition start.

Usage

# Command-line mode
sudo parted /dev/sda print

# Interactive mode
sudo parted
(parted) print

# Create a partition
sudo parted /dev/sda mkpart primary ext4 0GB 1GB

fdisk vs parted - Difference

The notable difference is that parted support shrinking and extending for partitions. When comes to larger disks parted is preferred, considering fdisk GPT is in an experimental phase.

Comparison of fdisk and parted presented in a table format:

Featurefdiskparted
Partition Table SupportMBR (GPT supported but experimental)MBR, GPT
Disk Size LimitTraditional limit of 2TBCan handle disks larger than 2TB, potential to address up to 8 zebibytes of space.
Partition AlignmentAutomatic (if DOS compatibility is off)Aligns only the start, warns on improper alignment
Display of Disk SizeUses binary (ex: GiB)
Display in decimal (ex: GB) (May round to nearest number)
Resizing PartitionsNoYes (Can shrink and extend)
Usage ModesInteractive modeInteractive and Command-line modes
Scripting CapabilityPossible, though not straightforwardSuitable for scripting
EFI Partition CreationYes (with GPT)Yes
Number of PartitionsLimited (up to 16 with MBR)Up to 128 by default with GPT (can be more)
Reliability FeaturesSingle copy of partition table (MBR)Two copies of partition table, CRC checksum (GPT)
AvailabilityUsually pre-installed in most distributionsMay need to be installed in some distributions

About The Author

Bobbin Zachariah

Bobbin Zachariah

Bobbin Zachariah is an experienced Linux engineer who has been supporting infrastructure for many companies. He specializes in Shell scripting, AWS Cloud, JavaScript, and Nodejs. He has qualified Master’s degree in computer science. He holds Red Hat Certified Engineer (RHCE) certification and RedHat Enable Sysadmin.

SHARE

Comments

Please add comments below to provide the author your ideas, appreciation and feedback.

Leave a Reply

Leave a Comment