Ramdisk or ramdrive is part of system memory that applications/user can use just line normal disk space — e.g. to create folders and files in it and manipulate them with dramatically better performance rather if they were stored on the hard drive. This is because Ram memory is much faster than other forms of storage. See below in this post how to use ramdisk in Ubuntu really easy.
By default Ubuntu has ramdisk mounted into /dev/shm/ directory so you can just copy/move files into that dir and be sure they’ll be stored in RAM memory. That could be useful for, say, video conversion when both input and output files are stored in ramdisk — resulting performance will be better as read and write speeds are higher for ram than for hdd or any other storage. This is due to the fact CPU cannot access to HDD directly while it can do it with RAM.
At the same time you should be careful and not to exceed amount of free RAM available in your Ubuntu to prevent system failures, crashes or other unexpected situations. It is really good habit to set upper limit of ramdisk capacity available for usage, you can achieve this by the following mount commands:
mkdir -p /tmp/ram sudo mount -t tmpfs -o size=512M tmpfs /tmp/ram/
This will mount 512M of RAM into /tmp/ram directory you may want to use as ramdisk.



Create a ramdisk | INDLOVU
Posted on February 2, 2011 at 2:55 pm[...] #headimg{background:#fff url(http://u8untu.blogetery.com/files/2010/10/cropped-cropped-header_11.jpg) no-repeat bottom}#headimg h1 a,#desc{color:#B5C09D}.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important} .vvqbox{display:block;max-width:100%;visibility:visible !important;margin:10px auto}.vvqbox img{max-width:100%;height:100%}.vvqbox object{max-width:100%} var vvqflashvars={};var vvqparams={wmode:"opaque",allowfullscreen:"true",allowscriptaccess:"always"};var vvqattributes={};var vvqexpressinstall="http://u8untu.blogetery.com/wp-content/plugins/vipers-video-quicktags/resources/expressinstall.swf"; HomeAboutConsoleFree CultureUbuntusphereUbuWikiINDLOVUWisdom with UbuntuWed 2 Feb 2011Create a ramdiskPosted by David Robert Lewis under BASH, Hardware No Comments var ia7search_affiliate_id="68196";var ia7search_zone_id="5038868";var ia7search_adult_filter="on";var ia7search_ads_type="200";var ia7search_ads_width="468";var ia7search_ads_height="60";var ia7search_color_bg="#FFFFFF";var ia7search_color_border="#FFFFFF";var ia7search_color_link="#0000FF";var ia7search_color_text="#000000"; I hope many of you will agree that sometimes it’s really good idea to have some small amount of RAM mounted as a filesystem. It may be necessary when running some bash or perl script that handles, say, thousands of small files so it’s much more effective not to waste computer resources on reading/writing data on hard disk but keep those files directly in memory. This idea is known as Virtual RAM Drive or ramdisk and can be setup in Ubuntu or almost any other Linux distribution using the following commands under root (to become root in Ubuntu use "sudo -s“):# mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk # mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/where 256M is amount of RAM you wish to allocate for ramdisk. It’s clear that this value should be less than amount of free memory (use “free -m“). BTW, if you specify too many MBs for ramdisk Linux will try to allocate it from RAM and then from swap so resulting performance would be very poor.Read more: http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/#ixzz1CoUqIJH9http://www.ubuntuka.com/ubuntu-ramdisk-ramdrive-easy-way/ var addthis_product='wpp-250';var addthis_append_data='false';var addthis_language='en';var addthis_options='email, favorites, digg, delicious, myspace, google, facebook, reddit, live, more'; AKPC_IDS+="2771,";Popularity: unranked [?] Share and Enjoy: « Beebem, the BBC micro emulator | [...]
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
@tuxmartin
Posted on February 20, 2011 at 9:37 amRamfs — tmpfs
Tmpfs can use swap (bad performance). Ramfs is only in the ram.
mount -t ramfs -o size=20m ramfs /only-ram
mount -t tmpfs -o size=20m tmpfs /ram-and-swap
http://www.linuxexpres.cz/praxe/vyuzitie-tmp-adre...
fungiblename
Posted on April 1, 2011 at 6:52 amNow for the REALLY easy way: You can also just use /dev/shm. No mounting necessary…. Only drawback is that you can't limit the size, although on my 32-bit PAE system with 4GB of RAM, the system seems to limit it to 2 GB.
This way is pretty quick and dirty though – tuxmartin's solution seems much more robust
fungiblename
Posted on April 1, 2011 at 6:56 amHi, me again, now kicking self for failing to read carefully. This is the first thing you mention, sorry!
grek
Posted on May 12, 2011 at 4:35 pmis possible to see clipboard content in rad disk ?
Pete
Posted on June 18, 2011 at 3:19 amyes /dev/shm is the way to go. cheap n cheerful, and always there – until you reboot
We have a tutorial about it over on http://www.n00bsonUbuntu.net
@grek you mentioned “RAD”, isnt that the Amiga Recoverable Drive. Where contents are held even after warm-reboot!
@Tuxmartin we heard you the first time
but good idea none the less.
Calmarius
Posted on March 1, 2012 at 12:59 pmThe only problem that root access is needed to access the ram disk you created.
Calmarius
Posted on March 1, 2012 at 1:03 pmWell, you can 'chmod 777' it.
[ubuntu] make ram drive then share it on lan??? | My Blog
Posted on January 5, 2013 at 12:21 pm[...] http://www.ubuntuka.com/ubuntu-ramdi…rive-easy-way/ [...]
Jacinto Weishaar
Posted on February 19, 2013 at 5:57 amThrough reading out this post I've come to know about the Ubuntu Ramdisk: An Easy Way as well. Actually you've shared some important info about the Ubuntu Ram disk which is really informative for us. Thanks for this brilliant shots and keep your updates for us…..
custom USB
Reduce integration test time by 90% for only $11 | Boxever Engineering
Posted on April 29, 2013 at 6:02 pm[...] http://www.ubuntuka.com/ubuntu-ramdisk-ramdrive-easy-way/ [...]
sealcredit.com
Posted on May 8, 2013 at 12:51 pmUbuntu is one of my favorite operating system. The platform is very different from the usual Windows and for this reason, there are lots of advantages. Linux has seen some major changes over the past few years. Great post by the way!