I write about little things in web dev that I learned or tried.

Oracle Cloud Infrastructure - Resize & Extend Boot Volume Size

7 Jul 2024

I’m using Oracle Cloud Infra (OCI)‘s generous free tier to deploy Coolify and I had a separate VM for my Python/Django stuff from some time back. Though I really liked the feeling of apt update / apt upgrade, it made sense to manage everything within Coolify.

A few container images and a lot of caching later, I started running out of space though. It was time to resize my boot volume to make it larger. Oracle gives up to 200GB storage space in the free tier, so I was well within the limits to extend the current one.

The Problem - I’m using Ubuntu, not Oracle Linux

Maybe it’s a skill issue, but it took me way too long to sort it out. This should’ve been a 5 min thing but it took me too long to install OCI CLI, trying growfs etc.

Oracle’s docs were all about Oracle Linux. I tried Googling and every blog post (which looked like everyone just copied from one another) just repeated this Oracle Linux setup.

Oracle and every blog suggested to use OCI Utilities’ oci-growfs. But in reality OCI Utilities and oci-growfs aren’t available for Ubuntu/Debian, at least not typically. So this person might be right but it’s definitely a workaround, not Oracle’s guidance.

The Easier Process for Ubuntu

  1. Edit the boot volume size from the OCI user

  2. Paste into your CLI the command that OCI gives you after a successful edit, like

$ 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
  1. Do lsblk to see the partition number/name
$ lsblk
  1. Use growpart on the partition. For me it was
$ sudo growpart /dev/sda 1
  1. One last thing is to resize the filesystem, otherwise the system info for / will still show the old size.
$ sudo resize2fs /dev/sda 1
  1. That’s all, the OCI Utils thing made it 10x longer than needed. 😔
Tags: CoolifyOracleOCIUbuntu
Copyright © 2024 Zixian Chen. All rights reserved.