I'm working on a 64-bit CentOS 7 VM on my Windows 10 host, and I have a dynamically-allocated VHD that is giving me problems.
At first, the VHD's maximum size was set to 16GB, functionally about 14.4 usable. While working on a project I realized that I would need much more space, so I used VBoxManage to increase the maximum to 100GB. Then I used GParted to expand the sda2 partition so that it took up the extra space.
So VirtualBox recognizes that the VHD can go up to 100GB and sda2 takes up most of that space. The actual size of the VHD right now is still 14.4GB. However when I fill up all of this space on the guest OS (by writing a long seq into a file), the drive not does automatically expand.
A couple of things to note:
The first time I tried to fill up the space, when I restarted the VM after filling it up, the VHD file on my host did increase by about 1GB, however it won't expand any more now.
There seems to be a discrepancy between the devices my guest OS reports and what partitions GParted reports. CentOS lists /dev/sda1 and /dev/mapper/centos-root, which is a link to /dev/dm-0, while GParted lists /dev/sda1 and /dev/sda2. Could this be causing the issue, or is this normal? If it is normal, any ideas as to why VirtualBox won't expand the VHD?