Expand a filesystem on Ubuntu / Linux without losing DATA

Expand a filesystem on Ubuntu or Linux after enlarging a VM disk, without losing data. Uses lsblk and resize2fs for online resizing.

Expand the drive attached to your VM

lsblk 

Output would be something like this

Find the disk you want to expand

use resize2fs

sudo resize2fs /dev/sda

Output would look something like this

Filesystem at /dev/sda is mounted on /mnt/volume-example; on-line resizing requirednold_desc_blocks = 25, new_desc_blocks = 32nThe filesystem on /dev/sda is now 131072000 (4k) blocks long.