Index: add-disk.sh |
diff --git a/add-disk.sh b/add-disk.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..c69e606a6d2d387d8bd193b2703bbb5049b76e90 |
--- /dev/null |
+++ b/add-disk.sh |
@@ -0,0 +1,44 @@ |
+# const |
+VMS="$HOME/VirtualBox VMs" |
+DISK2="box-disk2.vdi" |
+DISK2_SIZE_GB=8 |
+ |
+# find paths |
+VM=`ls "$VMS" | grep libadblockplus-android-ci-vm` |
+VM_PATH="$VMS/$VM" |
+echo "Found VM in $VM_PATH" |
+ |
+DISK2_PATH="$VM_PATH/$DISK2" |
+if [ -f "$DISK2_PATH" ] |
+then |
+ echo "Disk already added, exiting" |
+ exit 0 |
+fi |
+ |
+# stop VM |
+echo "Stopping VM..." |
+vagrant halt |
+ |
+# create disk 2 |
+echo "Creating $DISK2 ..." |
+DISK2_SIZE_MB=$(( $DISK2_SIZE_GB * 1024 )) |
+ |
+VBoxManage createhd --filename "$DISK2_PATH" --size "$DISK2_SIZE_MB" || exit 1; |
+echo "Done" |
+ |
+# attach disk 2 to VN |
+echo "Attaching disk 2..." |
+VBoxManage storageattach "$VM" --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium "$DISK2_PATH" || exit 1; |
+echo "Done" |
+ |
+# vboxmanage list hdds |
+# vboxmanage closemedium disk <uuid> --delete |
+ |
+# start VM and mount disk 2 |
+echo "Starting VM..." |
+vagrant up |
+ |
+echo "Adding partition..." |
+vagrant ssh -- /vagrant/vagrant-mount-disk.sh |
+ |
+echo "Done" |