Why Use GPT fdisk?

by Rod Smith, rodsmith@rodsbooks.com

Last Web page update: 4/24/2022, referencing GPT fdisk version 1.0.9

This Web page, and the associated software, is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find GPT fdisk or this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

Donate $1.00 Donate $2.50 Donate $5.00 Donate $10.00 Donate $20.00 Donate another value
Donate with PayPal
Donate with PayPal
Donate with PayPal
Donate with PayPal
Donate with PayPal
Donate with PayPal

Note: This page is part of the documentation for my GPT fdisk program.

Today, three families of GPT partitioning software are common in Linux: The util-linux package, which provides the fdisk partitioning tool; the GNU Parted package (consisting of the libparted library and parted command-line program) and other programs that rely on the library (GParted, KPartEd, and so on); and my own GPT fdisk family (which this set of Web pages documents).

In 2009, when I first wrote GPT fdisk, the alternative GPT partitioning options for Linux were limited. The libparted libraries were limited and buggy; and the Linux fdisk program did not support GPT. Thus, I decided to write my own GPT partitioning tool. I was initially interested mainly in MBR-to-GPT conversions; but once that was done, I expanded what I had written into a complete partitioning program: gdisk. I then created additional user interfaces to create the whole GPT fdisk family, including cgdisk, sgdisk, and fixparts. Since that time, the util-linux fdisk package has acquired GPT functionality and libparted has become more capable. Thus, you must decide which program to use. (Of course, in practice you may end up using several programs spanning all three families, depending on your needs at different times.)

Comparing GPT fdisk to fdisk

Two of the four programs in the GPT fdisk family have user interfaces that are modeled after those of the util-linux fdisk family, and three of GPT fdisk's programs fill roles that are similar to those from the fdisk family. (GPT fdisk uses entirely different code from fdisk, though.) The fourth program (fixparts) is unique. To summarize:

I wrote GPT fdisk as a more-or-less drop-in replacement for fdisk and its siblings; somebody familiar with fdisk should be able to use gdisk without learning a lot of new commands or fundamentally re-thinking how they partition disks. This was an advantage of GPT fdisk over some other tools at the time, but it was also a weakness. fdisk has been criticized as being obscure and not very user-friendly, particularly to users who aren't already experts at disk partitioning. The same criticism applies to gdisk. The cfdisk and cgdisk programs are partial answers to this criticism, but they aren't fully GUI tools; they're still text-based and hark back to the bygone era of text-based OS installation procedures and glowing green CRT displays.

Despite these limitations, GPT fdisk is a powerful GPT tool. It enables manipulating most aspects of the GPT data structures, up to and including obscure settings such as the size of the partition table — 128 entries by default, but not fixed at that value by the specification, so gdisk can change it. One of the design goals of GPT fdisk, and especially of the gdisk program, is to provide complete control over the GPT data structures, rather than just enabling control of the more common features, as some partitioning tools do.

After the release of GPT fdisk, fdisk acquired the ability to manipulate GPT data structures. Today, the two program families have similar capabilities when it comes to manipulating GPT disks. In addition to basic functions such as creating new partitions, both program families permit setting arbitrary partition type codes, setting partition attributes, adjusting the partition table size, backing up and restoring partition tables (albeit using different file formats), and adjusting other common and obscure GPT data structures that are not accessible (or are poorly supported) using libparted-based tools. Compared to util-linux fdisk, GPT fdisk provides better control of some low-level GPT data structures, including the ability to load backup data structures by user command, create a hybrid MBR, convert between GPT and MBR formats, set sector alignment values, and destroy GPT data structures so that a disk can be safely re-used as an MBR disk.

Like fdisk, GPT fdisk manipulates partition table data structures only; it does not touch, or even read, the contents of partitions. Thus, when you create new partitions, you must use another tool, like mkfs or pvcreate, to prepare a newly-created partition for use. Similarly, if you want to resize a partition, GPT fdisk can't do the job by itself; you must use a tool like resize2fs to do part of the job.

Comparing GPT fdisk to GNU Parted

Differences between GPT fdisk and GNU Parted are greater than those between GPT fdisk and Linux fdisk. Where I designed GPT fdisk from the ground up as a GPT-specific partitioning tool, GNU Parted provides a user interface that's more agnostic about the underlying partition data structures. This makes GNU Parted work similarly on MBR vs. GPT disks, but it robs the user of the ability to properly handle GPT-specific features. Broadly speaking, GPT fdisk has advantages over GNU Parted when:

Chances are you'll be happier with GNU Parted, its GUI cousins, or some other program entirely if:

Overall, I believe gdisk will appeal to those who like to use low-level tools that provide relatively direct control over the things they manage. If you prefer fdisk to parted on MBR disks, you'll probably prefer gdisk to Parted on GPT disks.

Comparing GPT fdisk to Other Programs

I originally wrote GPT fdisk for Linux, and I consider Linux to be its primary target OS; however, GPT fdisk is now available for macOS, FreeBSD, and Windows. Solaris is also supported as a build target, although I personally haven't tested it on Solaris. A wide range of partitioning tools are available for these OSes, and if you use one of them, you may wonder how GPT fdisk compares to the platform's native tools. I can offer less in the way of specifics than I can about how GPT fdisk compares to other Linux-native tools, but I do have some thoughts.

Most GUI partitioning tools that come with OSes, such as Disk Utility in macOS and Disk Management in Windows, are fairly basic programs. They're perfectly adequate for creating, deleting, and sometimes moving or resizing partitions for the host OS. They seldom give good access to more obscure partition table features; I don't know of a way to enter an arbitrary partition type code in Disk Utility or Disk Management, for instance. On the other hand, like GParted in Linux, these tools often integrate filesystem management with partition management, which is invaluable if you want to resize existing partitions.

Third-party GUI tools, such as MiniTool Partition Wizard, generally expand on the capabilities of the OS's built-in partitioning tools. These programs vary greatly in capabilities. Some provide features like lossless conversion between MBR and GPT that can rival GPT fdisk. Most, like OS-provided GUI tools, are filesystem-aware. These can be very powerful programs; however, most are also non-free. (Some publishers provide free trial versions with limited features, though.)

Text-mode tools exist for non-Linux OSes, too. The most notable of these are the gpt command in macOS and gpart in FreeBSD. These are similar programs, and both provide command-line interfaces that are similar to the one provided by sgdisk.

Concluding Throught

There's wisdom to the saying "don't put all your eggs in one basket." Even if you regularly use just one partitioning tool, keeping another available can be very useful in the event that a bug or limitation causes problems with your primary tool. Note that a bug that affects one libparted-based program, such as GNU Parted, is likely to affect other libparted-based programs, such as GParted. Thus, on Linux, you need both GPT fdisk and one or more libparted-based programs to get the benefit of unrelated tools that can potentially work around each others bugs and limitations. Similarly, libparted and the fdisk family from util-linux-ng provide redundancy for MBR operations. (Note that there's a GNU fdisk that's based on libparted but that attempts to mimic Linux fdisk's operations. It's useless for providing redundancy with other libparted-based tools.)

Go on to "A gdisk Walkthrough"

Return to "GPT fdisk" main page

copyright © 2009–2022 by Roderick W. Smith

If you have problems with or comments about this web page, please e-mail me at rodsmith@rodsbooks.com. Thanks.

Return to my main web page.