Partition Tables
Partition Tables are parts of a disk drive that an operating system reads in order to understand how to read the rest of that disk drive. There are many historical standards, but in modern terms we are referring exclusively to GUID Partition Tables (GPT), part of the UEFI standard.
You almost certainly don't want to stop at creating a partition table--take a look at setting up a file system.
gdisk
gdisk is the Linux utility for formatting a drive. Older tutorials may recommend fdisk, which gdisk has superseded.
It is called by superuser on a device, and starts a REPL. Suppose we want to format /dev/sde:
# gdisk /dev/sde GPT fdisk (gdisk) version 1.0.4 Partition table scan: MBR: hybrid BSD: not present APM: not present GPT: present Found valid GPT with hybrid MBR; using GPT. Command (? for help):
As the prompt suggests, ? prints help. Some other useful commands:
Command |
Action |
o |
Create a new partition table (i.e. Delete all partitions) |
d |
Delete a partition |
n |
Create a partition |
p |
Print partition table |
l |
List known partition types |
w |
Write partition table to disk and exit |
