Increase Block Volume Size Online in OCI

Paresh Zawar
3 min readSep 14, 2020

How to increase Linux File System Online using parted

In this blog, we will discuss, how to increase the block volume size online and we will explore the steps how to increase the file system size on Linux. This will be the two step process, first we need to Increase the block volume size from Console and next we have to increase the partition on the Linux server using the parted utility.

Step A : Increase Block Volume Size from the Console

Login to the Console

Take the Block Volume Backup for safer side.

Once block volume backup completed, go to Block Volume and Click on Edit and Specify the New Size. This will take few seconds to provisioning, once it is done, you are good to go on Linux side.

Also remember to enable auto tune if not already as it will save you few bucks by converting the block volume performance to the Lower mode automatically if you are not attached block volume to any instance

Step B: Increase the file system size, using the parted utility

Run the lsblk to identify the partition to which block volume is attached. Example: /dev/sdf

If you face any problem understanding the below steps, you can also check the screenshot at the end of the document.

After identifying the correct partition, run the rescan command, as per below. Remember to replace the partition (/dev/sdf) with your respective partition.

sudo dd iflag=direct if=/dev/sdf of=/dev/null count=1

echo “1” | sudo tee /sys/class/block/`readlink /dev/sdf | cut -d’/’ -f 2`/device/rescan

Now call the parted utility.

parted /dev/sdf

When you run the parted, you may encounter the below message. You are then prompted to fix the error or ignore the error and continue with the current setting. Specify the option to fix the error.

Warning: Not all of the space available to <volume_id> appears to be used, 
you can fix the GPT to use all of the space (an extra volume_size blocks)
or continue with the current setting?

Now run the below commands, in parted utility.

(parted) unit s

(parted) print

(parted) rm <partition_number>

<partition_number> is the value from the Number column.

Now, enter the below command.

(parted) mkpart

At the Start? prompt, specify the value from the Start column. At the File system type? prompt, specify the value from the File system column. Specify 100% for the End? prompt.

Exit the parted utility.

(parted) quit

To verify that the root partition was extended, run the lsblk command.

After you extend the root partition you need to grow the file system.

Below is shown example for ext4 file system.

resize2fs /dev/sdf

Boom, you did it ! You can now check the df -h to confirm. If anything goes wrong, you will still have the backup of block volume and if all goes well remember to delete the block volume backup if not required.

--

--