1. Home
  2. Linux

How to resize hard drive partitions on Linux

Do you have a hard drive partition on your Linux PC that you’d like to make bigger or smaller in size? Unsure about how to resize hard drive partitions on Linux? Follow along with this guide and soon you’ll know how to use the Gparted partition editor to resize hard drive partitions on Linux!

Resize a non-OS related partition with Gparted

You may have a hard drive partition on your Linux PC that isn’t in use by an operating system that you want to resize. Thankfully, non-OS related partitions don’t need to be accessed via Live disk. Since no operating system is using this partition, it can be resized directly on your current operating system with the Gparted application.

Resizing hard drive partitions on Linux can be done through the command-line and graphical tools. All of the different hard drive management tools available for Linux work quite well. However, in this guide, we’ll be focusing on the Gparted application, as it’s the easiest to understand for beginner Linux users.

Before we go over how to resize non-OS related partitions, you must install the Gparted app on your Linux system. To start the installation, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, follow the installation commands that match the OS you currently use.

Ubuntu

Ubuntu users can install the Gparted app directly from the primary Ubuntu software repository with the following Apt installation command.

sudo apt install gparted

Debian

Gparted is in the “Debian Main” software repository for all versions of Debian Linux. To install it, use the Apt-get command below.

sudo apt-get install gparted

Arch Linux

For Arch Linux, the Gparted app is in the “Extra” software repository. To install it on your Arch system, ensure the “Extra” repo is enabled. Then, use the Pacman command below.

sudo pacman -S gparted

Fedora

Gparted is available to Fedora users in the primary Fedora repo. To install it, use the following Dnf command.

sudo dnf install gparted

OpenSUSE

On OpenSUSE Linux, you’ll find the Gparted application in the “Oss all” repo. To install it, use the Zypper command below.

sudo zypper install gparted

Once the Gparted application is installed on your Linux PC, press Alt + F2 to open up the quick-launcher, then, run the command below to open the newly installed application.

gparted

Or

pkexec gparted

With the partition editor open, look for the drive that holds the partition you’d like to resize, by selecting it in the drop-down menu at the top-right section of the screen.

Let Gparted load the hard drive. After the app is done loading up the drive, find the specific partition you need to re-size, and right-click on it with the mouse to open up the right-click menu.

Choose the “resize” option in the right-click menu, and the “Resize/Move” partition will appear. From here, use the graphical resizer to drag the partition to make it bigger or smaller. Alternatively, find “New size (MiB)” and multiply it by 1024 to get it to exactly the right size. For example, to resize a 10 GB partition to 5 GB, you’d do:

1024 x 5 = 5120

When you’re satisfied with the new size of the hard drive partition, click the “Resize/Move” button, followed by the check-mark button at the top to apply the changes.

Resize your OS partitions with Gparted

Needing to resize a partition on your Linux hard drive that contains your current Linux operating system? If so, you must download the Gparted live disk, as it isn’t possible to resize partitions currently in use.

To get your hands on the Gparted live disk, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, use the wget download tool to grab the latest live image of Gparted.

wget https://downloads.sourceforge.net/gparted/gparted-live-1.0.0-3-amd64.iso

When the download for the Gparted live ISO file is complete, plug in a USB flash drive into the USB port and use the Etcher imaging tool to create a bootable live disk.

After making your Gparted bootable live disk, reboot the computer and load up the BIOS settings. Look through the BIOS settings and configure it to load from the Gparted live USB.

Once the Gparted live session is loaded up from your USB, let it load up. When it does, do the following operations outlined in the list below.

  • For “Configuring console-data” select don’t touch keymap.
  • For language, enter a number from the list above. Or, press Enter to go with the default that the OS detected.
  • For “Which mode do you prefer” type in “startx” and press the Enter key.

Soon after writing in “startx” in the shell on screen, a graphical environment will appear, along with the Gparted partitioning tool. Using the tool, click the drop-down menu at the top right, and select the drive you’d like to work with.

Once you’ve selected the hard drive you want to work with, locate the hard drive partition which you’d like to re-size, and right-click on it. Then, look through the right-click menu, find “Resize/Move” and click it to open up the partition “Resize/Move” menu.

Inside of the “Resize/Move” menu, use the graphical tool to drag your hard drive partition to make it smaller or larger. Alternatively, click on “New size (MiB)” and multiply the number 1024 by the number of GB to resize it to an exact size.

When you’re happy with the new size of the partition, click the checkmark button at the top of the app to apply the changes.

Reboot when done working with the Gparted live disk. Upon logging back into your OS, the partition should be resized to the size you specified!

Leave a comment