Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script to make RAM Disk' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script to make RAM Disk
Authored by: nicholfd on Jan 27, '06 05:59:36AM

Below is a script to make a 128MB RAM disk. You can easily change SizeInMB to change the size. It will appear on your desktop as "RAMDisk". The name can be changed by changing VolumeName in the script.

Copy the code below, and save it as text (I called it "mkramdisk".) Then make it executable with 'chmod 755 mkramdisk', typed in a terminal. You can execute the script with './mkramdisk', to create and mount the RAM Disk. It will be mounted in /Volumes/RAMDisk (or /Volumes/YourName, if you changed the name). When you eject the RAM Disk, log out, or reboot, the RAM Disk and its contents are removed.

Someone else may want to give instructions for making the script clickable from the GUI.......


#!/bin/bash
VolumeName="RAMDisk"
SizeInMB=128
NumSectors=$((2*1024*SizeInMB))
DeviceName=`hdid -nomount ram://$NumSectors`
echo $DeviceName
diskutil eraseVolume HFS+ RAMDisk $DeviceName


[ # ]
Script to make RAM Disk
Authored by: klatt on Jan 28, '06 12:37:00PM
If you change
SizeInMB=128
to
SizeInMB=$1
you can enter the size in MB of the RAM disk you wish to create at the command line instead of having to change the script each time. Running it to create a 300 MB disk would be:
ramdisk.sh 300
So the changed script would be:
#!/bin/bash
VolumeName="RAMDisk"
SizeInMB=$1
NumSectors=$((2*1024*SizeInMB))
DeviceName=`hdid -nomount ram://$NumSectors`
echo $DeviceName
diskutil eraseVolume HFS+ RAMDisk $DeviceName


[ # ]
Script to make RAM Disk
Authored by: chenyj on Feb 09, '06 11:20:29PM

Should consider using Gigabytes' i-RAM or Real Ram Disk's Hybrid Ram Disk at www.realramdisk.com



[ # ]