Skip to content

Instantly share code, notes, and snippets.

@rjzak
Created July 14, 2014 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjzak/92af0b4e5c6e0a7d2160 to your computer and use it in GitHub Desktop.
Save rjzak/92af0b4e5c6e0a7d2160 to your computer and use it in GitHub Desktop.
Make a ramdisk on Linux
#!/bin/bash
if [ $# -eq 2 ]
then
mkdir $1
mount -t tmpfs -o size=$2 tmpfs $1
else
echo "Proper use: $0 <RAMDISK_DIR> <RAMDISK_SIZE>"
echo "Example: $0 /mnt/ramdisk 4096m"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment