Online Resize Ubuntu/Debian Disk
Start by installing cloud-utils. This contains the growpart tool.
html
sudo apt-get install -y cloud-utils%20(1)%20(1).Ci3zBu39.png)
The root partition is 32 GB but the device itself is 64GB. I intend to resize the root partition (/dev/sda2)
Run growpart
html
sudo growpart /dev/sda 2The first parameter is the device you want to resize, and the second is the partition. Below is the output:
html
devin@postgres-replica:~$ sudo growpart /dev/sda 2
CHANGED: partition=2 start=4096 old: size=67102720 end=67106816 new: size=134213599 end=134217695And then:
html
sudo resize2fs /dev/sda2%20(1).CKTkspr3.png)
%20(1).CzrR8Xob.png)
Success