// The ID is used as an anchor for linking to the module. Avoid changing it after the module has been published to ensure existing links are not broken.
// The `context` attribute enables module reuse. Every module's ID includes {context}, which ensures that the module has a unique ID even if it is reused multiple times in a guide.
= Creating a Disk Partition in Linux
// Start the title of a procedure module with a verb, such as Creating or Create. See also _Wording of headings_ in _The IBM Style Guide_.
This procedure describes how to partition a storage disk in Linux using the `parted` command.
. List the partitions using the `parted -l` command to identify the storage device you want to partition. Typically, the first hard disk (`/dev/sda` or `/dev/vda`) will contain the operating system, so look for another disk to find the one you want. For example:
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
----
+
[IMPORTANT]
====
Be sure to indicate the specific device you want to partition. If you just enter `parted` without a device name, it will randomly select a storage device to modify.
====
+
. Set the partition table type to `gpt`, then enter `Yes` to accept it.
+
----
(parted) mklabel gpt
Warning: the existing disk label on /dev/vdc will be destroyed
and all data on this disk will be lost. Do you want to continue?
The `mklabel` and `mktable` commands are both used for making a partition table on a storage device. At the time of writing, the supported partition tables are: `aix`, `amiga`, `bsd`, `dvh`, `gpt`, `mac`, `ms-dos`, `pc98`, `sun`, `atari`, and `loop`. Use `help mklabel` to get a list of supported partition tables. Remember `mklabel` will not make a partition, rather it will make a partition table.
Providing a partition name under GPT is a must; in the above example, primary is the name, not the partition type. In a GPT partition table, the partition type is used as partition name.
====
+
. Quit using the `quit` command. Changes are automatically saved when you quit `parted`.