gparted ubuntu

GNOME Partition Editor (GParted) is a partition editor used to create, resize, move, format, and delete partitions and filesystems. It’s a GTK-based frontend to the GNU Parted tool. It’s also the standard method for graphically performing advanced disk management tasks on Ubuntu.

GParted On Ubuntu

GParted can be installed like any other package. While this is the quickest method to get GParted on Ubuntu, it’s not the recommended one.

sudo apt install gparted

This is because you need to unmount file systems to modify them. If you’re trying to modify non-boot partitions, this isn’t an issue. But if you need to modify the partition where Ubuntu is installed, you’ll need a live USB.

If you still have the live USB you used to install Ubuntu, you’re set. Simply boot from this USB and select the Try Ubuntu option. GParted comes preinstalled in this environment.

If you don’t have a USB like this, it’ll be faster to create a GParted Live USB instead. The process is the same as if you were creating a Ubuntu USB. Download the GParted ISO and use Rufus, Etcher, or a similar tool to create the live USB, and boot from it. 

Resize Partition with GParted

Note: We highly recommend backing all important data on the disk before using GParted or any other tool to modify partitions.

The most common use of GParted is for resizing partitions (shrinking, extending, mirroring, etc.). To do this, you’ll want to launch GParted and select the device from the top right. Unmount the partition if it’s currently mounted and proceed.

Shrink Partition

I’m using a 2 GB USB stick for demonstration here. As you can see, the entire drive currently consists of a single partition named /dev/sda1. First, let’s shrink it to create two more partitions.

Right-click the current partition and select Resize/Move.

Use the slider or numerically enter the size to create unallocated spaces before and after this block. If you’re dealing with a partition that contains boot files, be careful about moving the start sector though. This could cause your OS to fail to boot, so it’s best to operate to the right of the partition only.

After defining the new partitions, click on Resize/Move and press the Apply All Operations button.

Extend or Mirror Partition

Extending a partition is basically the opposite of what we did above. Right-click the partition to extend and select Resize/Move.

Use the slider or enter the new partition size. Then, click on Resize/Move again and apply the operations.

If you’re trying to clone a partition instead, right-click and select Copy. Then, paste it into an Unallocated block with enough free space.

Format a Partition

GParted is also commonly used for formatting drives on Linux. Right-click the partition and select Format to. Pick the appropriate file system format and press Apply.

Note that some of the options like exFAT or btrfs may be greyed out. You’ll need to install the relevant packages (e.g., exfat-utils) to access those options.

Create / Delete Partition

If you want to format a new device with a specific partition flavor, you can use the Create Partition Table option. This does mean that all data on the disk will be erased.

Now, right-click the unallocated space and select New.

Define the partition size, type, filesystem, and other values and press Add. Only allocate part of the space if you want to create multiple partitions. Then, click on Apply All Operations.

Deleting a partition is very simple too. Simply right-click, select Delete, and apply the operation.

Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.