Used VBoxManage modifyhd --resize, actual size did not change

Solution 1:

There are a few misconceptions in your train of thought, probably caused by multiple layers of abstraction.

Resizing virtual disk doesn't necessarily cause the disk file to grow.

By default, virtual disks are sparse, ie. disk files don't actually occupy space that isn't occupied on the virtual disk. That's why growing the virtual disk doesn't affect file size at all - it just changes a number that indicates disk's size.

Resizing virtual disk doesn't change its contents in any way.

And the first layer of abstraction in disk's contents is the partition table. The command that resizes HD doesn't care about it. It treats disk as a series of bytes and doesn't even know what partition table is.

After resizing the disk, you have to find a tool that understands partition tables and resize appropriate partitions.

resize2fs doesn't resize partitions.

There's one more layer of abstraction - a filesystem (FS) that resides on a partition. For all reasonable applications its size should match partition's size, but it can be smaller as well. Extra space will be wasted, though, because you can't store files outside of FS.

What resize2fs does is it adjusts filesystem's size. When ran without any extra arguments, it adjusts FS size to use entire device it resides on.

resize2fs doesn't know what partitions are, too. As I said, it operates on devices, ie. sequences of bytes of known length. Partition is a device, but so is a hard disk. resize2fs doesn't care. It only works with filesystems, not partitions.

Steps to increase disk space available for VM

  1. Grow the virtual hard disk.
  2. Grow appropriate partitions.
  3. Adjust filesystem sizes.

You did #1 and attempted #3, but forgot #2, so #3 didn't do anything. #2 can be done with fdisk (for MBR partitioning scheme) or `gdisk (for GPT partitioning scheme). If you can use tools with graphical interface, I'd strongly recommend using GParted, which works with both partitioning schemes and will do #2 and #3 simultaneously.