Resizing existing VM partition
Use vagrant-disksize plugin from https://github.com/sprotheroe/vagrant-disksize
Set required disk size
Inside Vagrantfile
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/xenial64'
config.disksize.size = '100GB'
endStart Vagrant
vagrant upor just reload it (if it's already up) with:
vagrant reloadEnter partitioning tool
sudo fdisk /dev/sda3- Press
pto check current partitions setup - Press
dto delete last partition - Press
nto create new partition - Press
tto adjust filesystem to match previous settings - Press
pand make sure that new setup looks similar to the base one (from step 1.) - Press
wto save settings
You are suppose to see that message:
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).Exit Vagrant
exit
exitRestart Vagrant
vagrant reloadEnter Vagrant
vagrant sshResize existing partition to span to new available space
sudo resize2fs /dev/sda3Hopefully it's working now and you have much more free space!