Flight Engineer
Flight Engineer

Partitioning using fdisk vs gdisk

What is the correct method to identify a partition to know if it is created using fdisk or gdisk partitioning utility. Can a system with more than 1 disk have both fdisk and gdisk partitions created on different disks ?

Tags (2)
0 Kudos
1 Reply
Mission Specialist
Mission Specialist

Could you please explain what you want to see?

The classical fdisk is only for MBR partition tables, not for GPT.

The gdisk is the equivalent of it for GPT. It is also known (from the man page) as the GPT fdisk .

From man of gdisk:
The gdisk program employs a user interface similar to that of Linux's fdisk, but gdisk modifies GPT partitions.

In that sense, a partition table (or partition) created by those tools should be identical, if it is of the same type (i.e. MBR or GPT). Whichever tool should make no difference.

I suppose the question then is whether you have GPT or MBR partitions, which is quite easy to say, from whichever tool, and quite some more:

1. The fdisk, as in fdisk -l , will show you the disklabel :
        Disklabel type: gpt

2. The gdisk works somewhat differently in that it needs a device, in which case it will again show you the type of partition table:

      # gdisk <the_device>
      GPT fdisk (gdisk) version 1.0.4

      Found valid GPT with protective MBR; using GPT.

3.  The  parted -l  will also show:

     Partition Table: gpt

4. If you feel so adventurous, you can also hexdump -c <the_device> | head  , which will show, in line numbered 0000200 (i.e. 512 bytes) , the text 'E F I   P A R T'  .

I hope that clarifies the things a bit. Otherwise, it would be needed to elaborate a bit more on what you actually want to see.

Join the discussion
You must log in to join this conversation.