GPT Partition

From LQWiki
Jump to navigation Jump to search

GPT is a type of partition table or disk label. Until recently, the most common type was MSDOS, which has certain limitations (including maximum disk size) that GPT is able to overcome. In this tutorial, you'll learn how to create a GPT partition table on a disk, and add partitions to that disk.

The Graphical Way

For most people, this is the simplest way to get it done.

GParted (or QtParted) Open GParted from your Desktop Environment's menu (root access required). Select the device in the upper right that you want to edit. IMPORTANT: If you select the wrong device, you can erase all your data! Creating a new partition table deletes all data on the specified drive. Then, go to Device > Create Partition Table. In the dropdown menu, select, "GPT", then click Apply. You have now created a partition GPT table!

To create a partition, right-click on the unallocated (empty) space in the list, and click New. Select the options you like, and then click Add. Click the Apply icon at the top of GParted's window to apply the change.

The CLI Way

You can also do this with the command-line interface (CLI), in a terminal. Access a terminal by booting directly into one, pressing CTRL-ALT-F1, opening the terminal emulator of your choice, or any other method you prefer. Use sudo for the following commands, or login as root. You must now determine which device you want to edit. If your device already has a partition table and some partitions on it, "blkid", "mount", or similar commands might show you what you need to know. If not, try "fdisk -l /dev/<device>", "gdisk -l /dev/<device>", or "parted /dev/<device> print" will give you the geometry of a specific drive. Once you have determined what drive you want to edit, proceed to the following commands. Note: as above, this will erase all data on the selected drive; be careful!

  1. sudo gdisk /dev/<device>

This will prompt you regarding what you want to do with the drive. Follow the prompts to create a GPT partition table/label. You may then continue to follow the prompts to create one or more partitions.

See also