vagrant扩容
Posted maxilo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vagrant扩容相关的知识,希望对你有一定的参考价值。
参考:
https://gist.github.com/christopher-hopper/9755310
https://www.madcoder.cn/vagrant-box-resize.html
http://www.linuxidc.com/Linux/2012-07/66626.htm
步骤:
-
vagrant halt
-
cd ~/VirtualBox\ VMs/self_box
-
VBoxManage clonehd "box-disk1.vmdk" "clone-disk1.vdi" --format vdi
-
VBoxManage modifyhd "clone-disk1.vdi" --resize 20480 #20G
-
VBoxManage storageattach self_box --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium clone-disk1.vdi #不切换目录
-
vagrant up
-
fdisk /dev/sda
- 创建一个主分区 type为8e #这里为/dev/sda3
-
pvcreate /dev/sda3
-
vgextend vg_name /dev/sda3
#vgdisplay 查看vg_name
-
lvextend -l +100%FREE /dev/mapper/vg_logic_file #ls /dev/mapper/vg_name + tab 查看
vg_logic_file 通常为vg.*root
- issus
- Couldn‘t find device with uuid xxxxxxxxxxxxxxxxxxxxxxxxxxxx #vgreduce --removemissing vg_name
- issus
-
resize2fs /dev/mapper/
vg_logic_file
- issus
- Couldn‘t find valid filesystem superblock #xfs_growfs /dev/mapper/vg_logic_file
- Couldn‘t find valid filesystem superblock #xfs_growfs /dev/mapper/vg_logic_file
- issus
-
vagrant reload
- df -h
#初始大小真的好坑还是自己制作box为好
end
以上是关于vagrant扩容的主要内容,如果未能解决你的问题,请参考以下文章