How to extend a boot volume in OCI linux instance

por | 20 marzo, 2023

Sometimes if you have created a new instance and the initial 50GB is not enough, you can extend the disk and the partition. The disk is extended very easy, using the OCI console:

1- Select the Boot/Block volume you want to extend:

2- Press Edit :

From the Intial Volume Size write the needed size:

3 — Save Changes and go to the OS and extend the partition.

  1. Run the applicable rescan commands. Learn More Copy the output from the console and run it on the instance.

sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1
echo “1” | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevda | cut -d’/’ -f 2`/device/rescan

2. Extend the partition manually. Learn More

4 — Run lsblk command to get the device names:

lsblk

run

sudo /usr/libexec/oci-growfs

If everything is ok you will get:

Run lsblk again and see that the partition was resized:

Congratulations on extending a boot volume in OCI.