sh 通过飞轮VirtualBox图像调整本地大小

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 通过飞轮VirtualBox图像调整本地大小相关的知识,希望对你有一定的参考价值。

# Steps we will take:
# 1. Change Local (Docker Machine) image type (this will take a bit)
# 2. Resize image
# 3. Resize partion
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/

# IMPORTANT: Make sure Local is not running!
VM_NAME="local-by-flywheel"
NEW_DISK_SIZE=50000
LOCAL_DOCKER_MACHINE_PATH="/Applications/Local by Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine"

# Stop Docker Machine
$LOCAL_DOCKER_MACHINE_PATH stop $VM_NAME

# Change the size of the image.
# Convert the VMDK image to VDI (one that we can resize). This will take some time.
UUID=$(vboxmanage clonehd ~/.docker/machine/machines/$VM_NAME/disk.vmdk \
~/.docker/machine/machines/$VM_NAME/disk.vdi --format VDI --variant Standard \
| grep -o 'UUID.*' | cut -f2- -d: | xargs)
  
# Resize the image
vboxmanage modifyhd ~/.docker/machine/machines/$VM_NAME/disk.vdi --resize $NEW_DISK_SIZE

# Swap image
VBoxManage storageattach $VM_NAME --storagectl "SATA" --medium $UUID --port 1

# Install GParted on your boot2docker vm:
# - Download GParted ISO from http://gparted.sourceforge.net
# - Open VirtualBox
# - Go to: local-by-flywheel > Settings > Storage
# - Add an IDE controller
# - Add your downloaded GParted ISO as CD/DVD
# - (boot2docker itself also is an ISO, do NOT remove it)
# - Add your VDI to the SATA controller as Harddisk
# - Remove the VMDK partition
# Start GParted:
# - Boot your boot2docker vm (it should boot from the GParted ISO/CD)
# - Choose all defaults
# Resize the partition (in the GUI):
# - Right click > Resize on the boot2docker-data partition
# - Drag the slider to increase the partition/volume
# - Click Resize/Move
# - Click Apply > and one last time :) (this wont take long)
# - Quit and Shutdown
# Next remove GParted:
# - Go to: VirtualBox > boot2docker-vm > Settings > Storage
# - Remove the IDE controller (and thus the GParted ISO)

# Open Local and you should be good to go

以上是关于sh 通过飞轮VirtualBox图像调整本地大小的主要内容,如果未能解决你的问题,请参考以下文章

sh 通过飞轮VirtualBox图像调整本地大小

sh 通过飞轮数据库将sql文件导入Local

将本地目录中的本地图像包含并调整大小到 Xaringan (remark.js) 演示文稿中...(通过 Mac 上的 Rstudio 使用)

sh 使用imagemagick调整图像大小

sh 调整图像大小

sh 调整批量图像的大小