How to Extend Partitions to Fill Disks on Ubuntu

Disk size is the maximum space in which we can store our data for example we have a hard disk with the size of 500 GB, it means that we can store data up to 500 GB. Same case is when we install the operating system in a machine we assign some partition with the specific size let’s say we assign the size to the partition is 20 GB now we can save our data up to 20 GB when this space is full the operating system will generate the error either to delete the previous stored data in the disk or to extend the partition size.

In this tutorial we will learn how to extend the partition of the disk on Ubuntu to remove the error which is occurring because of the full disk and no free space.

How to extend partitions to fill disks on Ubuntu using gparted

We cannot modify the partition if it is in use. If we want to modify the partition either we use the Ubuntu live CD or bootable USB drive. We will here discuss the modification using gparted but as we know gparted is not included by default so we will follow the following procedure to extend the partition to fill disks on Ubuntu, we will first open the Ubuntu and check the already allocated space on the disk. For this purpose, we will open the terminal and update our repository:

$ sudo apt update

We can make changes with the disk management or with disk partitions using “gparted” application. To use it, first we have to install the package of gparted by the following command:

$ sudo apt install gparted

After the installation of the gparted package, we will open the gparted using:

$ sudo gparted

A dialogue box will open as shown in the figure, we will change the size of the “New Partition # 1 ”:

We will right click on the “New Partition #1” and click on the “Resize/Move”:

Another dialogue box opens with the size details of the disk or partitions:

For example, to extend the size of the partition we will change size by typing from 21919 to 41920 and also click on the “Resize/Move” button to confirm changes:

We can also change the size by scrolling the bar present in the top to the left or right:

How to extend partition to fill disk on Ubuntu on Virtual Machine (VirtualBox)

If you are using the Ubuntu on the VM (Virtual Machine) and you want to change the partition size of the Ubuntu then the procedure will be like first you will open the VM as:

Choose the Ubuntu or the operating system you are going to run on the VM:

Click on the “Settings” icon:

A popup dialogue box will open as:

Click on the “System”, a menu will be opened to assign the size to the partition by either typing the size or moving the cursor on the bar. Then finally click on the OK button in order to save the modifications.


Occasionally while working on the system we face memory full error. To avoid or tackle such errors we have options either to delete the data stored previously in the drive or to make space free or to extend the partition. In this tutorial we discussed how to rectify the error of memory space issue by extending the partition. We have discussed the two methods to extend or increase the partition; one is by the command line method in Ubuntu and the other is if you are using Ubuntu in the virtual machine. Hope this tutorial will help you to find out how to extend the partition to fill the disk on Ubuntu.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.