From 6ff5a09ead5603c5f94c832b8a49acffe8382187 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Sun, 16 Sep 2018 03:05:33 -0700 Subject: [PATCH] add ramdisk setup script --- bin/setup-osx-ramdisk | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/setup-osx-ramdisk diff --git a/bin/setup-osx-ramdisk b/bin/setup-osx-ramdisk new file mode 100755 index 0000000..6c63119 --- /dev/null +++ b/bin/setup-osx-ramdisk @@ -0,0 +1,12 @@ +#!/bin/bash +# from https://schof.org/2014/01/10/putting-my-virtualbox-vagrant-virtual-machines-on-a-ramdisk +# Set up RAM disk for VirtualBox Images +SIZE_IN_GB=14 +SIZE_IN_SECTORS=`echo "$SIZE_IN_GB*1024^3/512" | bc` +if [ -d /Volumes/RAMDISK ]; then + echo "RAMDISK for VirtualBox images already exists. Doing nothing." +else + echo "Ramdisk does not exist." + echo "Creating ramdisk." + diskutil erasevolume HFS+ "RAMDISK" `hdiutil attach -nomount ram://$SIZE_IN_SECTORS` +fi