Linux Disk Expansion Guide
Increasing the disk size in your VM settings (VMware/VirtualBox) is only half the battle. The OS won’t automatically use that extra space until you manually update the partition table and the filesystem.
Here is a quick guide on how I expanded my /dev/sda2
partition from 30GB to 40GB without losing any data.
The Problem
After increasing the virtual disk to 40GB, running lsblk
showed that the physical disk (sda) was 40GB, but the
primary partition (sda2) was still stuck at 30GB.
1
2
3# Output snippet
sda 8:0 0 40G 0 disk
└─sda2 8:2 0 30G 0 part /
