vagrant plugin install vagrant-disksize
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.disksize.size = '80GB'
...
You'd better run vagrant halt && vagrant up
rather than vagrant reload
vagrant halt && vagrant up
The new disk space is usually in /dev/sda
. Thus, partition it as /dev/sda3
.
You can refer to this blog Partitioning, Formatting, and Mounting a Hard Drive in Linux Ubuntu 18.04
about how to partitioning and formatting.
Some important tips about mounting including:
- Do not mount
/dev/sda3
on the/vagrant
, which is usually shared with the local OS. Otherwise, we cannot connect to the VM byvagrant ssh
directly. - A recommended mount point is
/mnt/data