GNOME Partition Editor (GParted) is a powerful cross-platform application that allows you to create, resize and delete partitions on your Linux system while preserving the partition contents. The file formats it supports include btrfs, ext2, ext3, ext4, fat16, fat32, hfs+, linux-swap, lvm volumes, ntfs and xfs. Here I will show you how to create and resize partitions with GParted.
Before proceeding, please make a backup of all your essential documents if you plan to test them on your primary disk. Disrupting the partition makes it insecure and potentially corrupts all data on the drive. The safest way to try GParted is to take a spare USB stick or create an additional disk to mount to the Virtual Machine.
Here I demonstrate GParted on a Linux system with an additional 10 GB disk attached to it. This may happen if you install new storage on your system or use a live demo of your chosen Linux distro to partition the disk before installation.
Installing GParted is very simple. This is a mainstay tool that must be in the repository of your distro of choice.
- Use the command below to install on Ubuntu.
sudo apt install gparted
- Use the command below to install on Fedora/CentOS.
sudo dnf install gparted
- Or use the command below to install on Arch
sudo pacman -Sy gparted
Using GParted Live Disk
There is also an option to boot into the running GParted app without installing it on a specific distro. This can be great if you use the feature to save your data, as you can save a special GParted USB stick to save your data in case something goes wrong.
To do that, go to the GParted LiveCD download page and click Download. Then, select the appropriate version for your system. For most systems you boot from, you can choose the latest version with the name amd64, because that's the architecture that will run on your laptop or desktop. From there, flash it to USB using BalenaEtcher. And now you have a dedicated USB to manage partitions before installation and save data if something goes wrong.
Creating Partitions with GParted
Since you start with a blank disk, you must first create some partitions. Suppose you are formatting a disk on an entirely new system and installing Windows and Linux on this system. Since this is an empty disk, you have to create a partition table first. For modern disks, you should create a GPT partition table.
To do that, click Device - Create Partition Table. Click the drop-down menu, select gpt, and click Apply.
Now that we have the partition table, we can go ahead and create some partitions. In this situation, I want to install Windows on the first partition and Linux on the second partition. So, to create our first NTFS partition, click Partition - New. That will bring up the partition menu.
To split a 10 GB GPT disk in half, you can give this partition 5100 MB and leave another 5139 MB for the second partition.
From there, you can give it a name. Click File system - ntfs.
Click Add, and you are now done with the Windows partition.
Now, you can repeat the same process, only taking up the remaining drive space for your Linux partition. You can choose whichever file system you want. I decided on the ext4 standard this time.
You will notice that there are several different items on the bottom menu. That's because GParted doesn't write your changes to disk until you request it. This is a great way to think about different partitioning schemes and layouts for your disk without changing anything. To make the changes permanent, click the green checkmark, then click Apply. Wait for the changes to be written to disk, and you're good to go.
Resizing Partitions with GParted
Now, let's say we want to change our partition at some point. Maybe our Linux installation needs more space, and there is room to shrink the Windows partition. To do so, you can click on the partition you want to resize, click Partition - Resize/Move. Then, select your new partition size in MB. Then click Resize/Move to complete the action.
Next, click the second partition and click Partition - Resize/Move/. You can set the new size according to the maximum MB allowed. I maximized the partition size for demonstration purposes. You will get a scary message about moving your /boot partition or Windows C: drive. In this case, it won't happen, so it should be fine. See my quick guide to Linux partitioning to learn more about the /boot partition and partitioning scheme.
Now that you know how to create and resize partitions with GParted. That's it for this tutorial. I hope it's useful for you. Don't forget to leave your comments below to share your experiences in following this tutorial. Thank you.