In this article, we cover how to resize a partition in Linux distribution (i.e. Ubuntu and AlmaLinux). Though there are numerous tools that can help us achieve the desired outcome. One particular tool we like and are extremely comfortable with is GParted (or, GNOME Partition Editor).
Here, libparted is used to manage device partitions.
It is worth mentioning here that, there is a risk of losing data during the process. So, it is better to take a backup before we go ahead.
First, we have to install the relevant packages. Installation steps are covered next.
Note: Following operations require Administrative rights. In case you don’t have one then we advise you to contact your System Administrator for assistance.
Install GParted in Ubuntu
Open a terminal and issue the following commands:
sudo apt update sudo apt install gparted
The package is available through the standard Ubuntu repository.
Install GParted in AlmaLinux
The package GParted is a part of the EPEL Repository. Therefore, if it’s not there then install it first:
# dnf install epel-release
Thereafter, to install GParted:
# dnf install gparted
How to resize a partition in Linux
Launch GParted from our systems’ main menu. It would prompt us to enter Administrator’s password. Select your device, you would find it top-right.
Just under the Menu bar, you would see the created partitions on your device. Here are the steps that you need to follow:
- Select the partition you wish to resize,
- Right-click on it,
- Select Resize/Move,
- Enter New Size (in MiB) or drag the horizontal bar to change the partition size on either side,
- Click the button Resize,
- Lastly, Go to Edit in the Menu bar and Apply All Operations.
- It may take a while to complete the process.
We would like to add here that, it won’t be that straightforward for everyone. We may have to resize other partitions first before we can make changes to the desired partitions. Apart from that, not all partitions shown in GParted can be resized through this method. Such partitions are system-critical partitions and making changes to them can render our system unusable.
In conclusion, we have covered here how to resize a partition in Linux through GParted.