Linux OS / Servers / Software

Best Way to Extend Partition on CentOS or Ubuntu

Share this post

Every system administrator has at least once experienced to need more space on the HDD or partition. This can be a big problem. In this article, I will explain how to simplify the resize partition by moving the space from a partition where there is enough space.

For example, we will take a CentOS that has 2 SSD HDDs running in a RAID and on which there are 240 GB of space that the system sees as one Logical Disk.

Disk Utillity - Linux
Disk Utillity – Linux

First check the df of all logical partitions with the space occupied by them.

Terminal Linux df Disk Status
Terminal – df command for disk partitions status

After that, it is necessary to decide which partition space will be taken and how much space we need to shrink.

For any partition work on the Linux OS platforms, there is a rule that each partition on which it is running must be unmounted so that it can be edited. In such a way, problems can arise, which is why we decided for different approach. The best and easiest solution is to run Linux Live OS ( CentOS, Ubuntu, Lubuntu, … ) from a USB or DVD because the HDD will be unused and will be able to make changes. The only condition that Live Linux must need it has a gparted or similar program to work with partitions.  I use Hiren’s BootCD PE x64 (v1.0.1) and run Parted Magic Linux edition for working with HDDs.

parted magic - partitioning tool
Parted Magic – Partitioning tool

After that, we run Partition Editor (GParted) and start moving space. Let’s mark the partition from which we take the space. By clicking Resize / Move, we release the space. After verifying the released space will appear as unallocated.

GParted - HDD Resize
GParted – HDD Resize

In the Linux OS platform, it is necessary to move the unallocated space to the partition on witch we add this unallocated space.

For example. if we remove space from partition number 1 and we want to transfer it to partition number 3. We must first join the created unallocated pace to partition number 2 then again resize it from partition number 2 and join to partition number 3.

After completing the resizing, you need to click on Apply, after which you will see a window like below.

GParted - HDD Resize - Apply
GParted – HDD Resize – Apply

Upon completion of the operation is successfully, restart the computer and after system get started your partition should have added space.

Related Stories