2022-08-31

Online resizing a partition on Ubuntu

Just to remember myself: How to a resize a file system at runtime on Ubuntu. In this example I want to increase the size of /dev/sda3 - my root partition on a virtual dev system.

  • Extend the "physical" disk, in my case in VMware vSphere
  • Then run then following commands as root
    • echo 1 > /sys/block/sda/device/rescan  # make sure the OS rescan the disc
    • growpart /dev/sda 3  # grow the partition on the disk
    • resize2fs /dev/sda3   # grow the file system on the partition