Showing posts with label ramdisk. Show all posts
Showing posts with label ramdisk. Show all posts

Tuesday, January 22, 2013

RamDisk in OSX Mountain Lion


RamDisks have been used on Macs since the early mac classic days. A RamDisk is in essence a virtual disk using your available RAM. It will be faster than any HDD or SSD.

If you have a lot of RAM on your mac, you can easily make a RAMDisk in the terminal.

Here is how you make a RAMDisk:

 diskutil erasevolume HFS+ “ramdisk” `hdiutil attach -nomount ram://xxxx’ 



Replace xxxx by the number of megabytes (MB’s) * 2048. For example, if you want a 8GB ramdisk, use 8192*2048 = 16777216. You can use whatever name you want for the mounted volume in double quotes.

Copies are insanely fast. Typical benchmarks tools like Black Magic cannot even run.





There are plenty of good use for ramdisks - scratch, working on projects like database with lots of I/O. Ramdisks are great at being source drives for testing the write speeds when benchmarking drives.



Monday, May 28, 2012

Ramdisk vs SSD on Ubuntu

With the advent of fast SSDs capable of reading/writing 200-500 Mb a second, is there a need for ramdisks? I decided to try it out in Ubuntu 12.04.

If you are wondering what a ramdisk is, it is simply using your physical RAM memory as a temporary storage drive. Instead of writing to disk, you are writing files to memory.

And the results of my testing?

Well, I'll let these pictures speak for themselves:

1st. Ramdisk. Average read 1.2Gb/s. As in Gigabytes per second. An entire full DVD movie worth of data would take less than 5 seconds to copy.


2nd,Corsair F120 Sandforce based SSD. Read speed bench at 234 Mb/s which is no slouch and faster than any platter drive. The same DVD would take roughly 22 seconds.


Compared to a standard platter HDD drive, a DVD would take 81 seconds at 60Mb/sec. A 10Mb/sec USB stick would take 486 seconds or 8 minutes to copy.

I tried a Virtual Box VDI image in ramdisk and an ubuntu 10.10 image loaded in less than 6 seconds.

Here is how you make a ramdisk:

 mkdir -p /tmp/ramdisk 
 sudo mount -t tmpfs -o size=1024M tmpfs /tmp/ramdisk 


Or, you can simply copy files to /dev/shm/ but you risk saturating all your available ram. By using tmpfs, you can set a limit. In my example, my ramdisk is 1GB.

It should be noted that ramdisks are not persistent. They will need to be recreated upon reboot. You lose the data in ramdisk when your power down.

I am currently exploring options for a real-time ffmpeg transcoding system that will write and read quite a bit to disk. I also have another use case scenario with imagemagick/ghostscript writing large temp files of PDFs. A ramdisk may be the way to go.

There is another interesting use of ramdisk. To run a completely private and secure micro servers like tor-ramdisk to evade police authority. Data would simply disappear upon a power down. If the authority seized your equipment, all the data would simply vanish and make it harder for forensic analysis.

Now, I just need a laptop with 32GB of RAM.


Subscribe to: Comments (Atom)

AltStyle によって変換されたページ (->オリジナル) /