-
-
Save bitboxx/5f10b648755781c21dcd4b23f35635ab to your computer and use it in GitHub Desktop.
Create Ramdisk on Mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MOUNT_PATH=~/tmp/RamDiskCache | |
mkdir -p ${MOUNT_PATH} | |
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB | |
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://8388608` | |
echo "Ramdisk device: ${DISK}" | |
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" ${DISK} | |
sudo /usr/sbin/diskutil mount -mountPoint ${MOUNT_PATH} ${DISK} | |
/usr/bin/chflags hidden ${MOUNT_PATH} #Hide RamDisk directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment