You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
481B

  1. #!/bin/bash
  2. # from https://schof.org/2014/01/10/putting-my-virtualbox-vagrant-virtual-machines-on-a-ramdisk
  3. # Set up RAM disk for VirtualBox Images
  4. SIZE_IN_GB=14
  5. SIZE_IN_SECTORS=`echo "$SIZE_IN_GB*1024^3/512" | bc`
  6. if [ -d /Volumes/RAMDISK ]; then
  7. echo "RAMDISK for VirtualBox images already exists. Doing nothing."
  8. else
  9. echo "Ramdisk does not exist."
  10. echo "Creating ramdisk."
  11. diskutil erasevolume HFS+ "RAMDISK" `hdiutil attach -nomount ram://$SIZE_IN_SECTORS`
  12. fi