Linux gdisk command (partitioning disk)
The gdisk command in Linux is similar to fdisk and allows you to manipulate and create partitions. It was specially created to handle GPT partitions.
It automatically converts the Master Boot Record (MBR) to the new format called Globally Unique Identifier Partition Table (GPT).
This new partition allocation table scheme was created to work with the new EFI and UEFI motherboard firmwares. Windows XP 32-bit and earlier versions of Windows cannot normally read or write to drives formatted with a GUID partition table, however, Windows Vista and Windows 7 and Windows 8 have this capability.
This new standard uses logical block addressing (LBA) instead of the old cylinder-head-sector addressing. This addressing system does not have the limitation of placing the boot loader within the first 1024 cylinders.
The gdisk menus, although with more options, are very similar to that of fdisk. The gdisk options are:
-
b Backs up the GPT to a file
-
c Change the partition name
-
d Delete a partition
-
i Show detailed information for a partition
-
l List partition types
-
n Create a new partition
-
o Create an empty GUID partition table (GPT)
-
p Show data from partition that
-
q leaves without saving
-
r Recovery and transformation (for experts)
-
s Sort the Linux partitions
-
t Change the partition type
-
v Check the disk
-
w Save the partition table
-
x Extra features (for experts)
-
? Print this menu
In this example, a GPT-type partition was created on the /dev/xvdb disk. If nothing is entered at the interactive prompt, it will assume the default options: