Ubuntu Ramdisk: An Easy Way

Posted in Quick Tips | 56 comments
Tags: , ,

ubuntu ram logoRamdisk 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.

Follow @Ubuntuka on Twitter!
RSSComments

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 am

Ramfs — 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 am

Ramfs — 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 am

Ramfs — 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 am

Ramfs — 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 am

Ramfs — 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 am

Ramfs — 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 am

Now 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 am

Hi, 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 pm

is possible to see clipboard content in rad disk ?

Pete

Posted on June 18, 2011 at 3:19 am

yes /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! :D

@Tuxmartin we heard you the first time :P but good idea none the less.

Calmarius

Posted on March 1, 2012 at 12:59 pm

The only problem that root access is needed to access the ram disk you created.

grass matting

Posted on March 7, 2014 at 7:06 am

Thanks for share great knowledge!

Calmarius

Posted on March 1, 2012 at 1:03 pm

Well, you can 'chmod 777' it.

Playground Mats

Posted on February 3, 2014 at 6:46 am

We provide you interlocking Interlocking Rubber Grass Mats to keep your children safe. These interlocking rubber grass mats are very convenient to use. You can install them very easily. It is well suited for places like play areas, decks, rock wall climbing. They can easily be maintained as their cleaning is very easy.

Jacinto Weishaar

Posted on February 19, 2013 at 5:57 am

Through 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

sealcredit.com

Posted on May 8, 2013 at 12:51 pm

Ubuntu 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!

Freebies

Posted on June 11, 2013 at 3:18 am

Such an outstanding operating system about Ubuntu! Basically i am using this system and one thing is that the major advantage of this operating system is without any antivirus software you can operate this system very nicely and also you can open any sort of file in this operating system which doesn't open in any other operating system as well. Thanks for the superb innovation.

hana

Posted on June 17, 2013 at 3:23 pm

such an informative post about ubuntuka is really useful

Minecraft Free Download

Posted on July 3, 2013 at 1:21 pm

Helpful info. Fortunate me I discovered your site unintentionally,
and I am shocked why this coincidence didn’t came about in advance! I bookmarked it.

michael

Posted on August 31, 2013 at 4:35 am

very useful thank you
and which file is ramdrive command kept ,for changing size of memory

black ops 2

Posted on October 15, 2013 at 2:08 pm

I seldom comment, but i did a few searching and wound up here Ubuntu Ramdisk:
An Easy Way – Ubuntuka. And I actually do have
some questions for you if it’s allright.
Is it only me or does it look as if like a few of these
comments look like left by brain dead folks? :-P And,
if you are posting at additional online social sites, I’d like to follow anything fresh you
have to post. Would you list of every one of all your
shared pages like your twitter feed, Facebook page or linkedin profile?

Barry

Posted on October 19, 2013 at 3:53 am

Ahaa, its nice discussion regarding this post here at this
website, I have read all that, so now me also commenting at this place.

Cosmetic surgery Illinois

Posted on October 24, 2013 at 8:37 pm

Hiya! I know this is kinda off topic but I’d figured I’d ask.

Would you be interested in exchanging links or maybe
guest authoring a blog post or vice-versa? My blog goes over a lot
of the same topics as yours and I think we could greatly benefit from each other.
If you are interested feel free to shoot me an email.
I look forward to hearing from you! Fantastic blog by the
way!

riot point Gratuit

Posted on October 25, 2013 at 11:29 am

My brother recommended I may like this web site.

He used to be entirely right. This post truly made my day.
You cann’t consider simply how so much time I had spent
for this information! Thanks!

http://jinju.tv/issue/8025

Posted on October 27, 2013 at 2:50 am

Its so frustrating to see the amount of writers and
supposed SEO masters who don’t know anything
Shared on Digg, someone will like it

gerber pocket knife review

Posted on December 1, 2013 at 3:32 pm

Buck knives as a company, has worked together with other
celebrated producers and still produces the best array of knives in the globe.
Each knife is manufactured by a different world-class Japanese knifemaker and the prices generally run from
$120 to $170. It allows your thumb nail to open the blade instantly.

bury club djs

Posted on December 4, 2013 at 8:02 am

I have seen your post about ramdish which is part of system memory which is very informative. I have learned from your post that ram memory is much faster than other forms of storages. Thants for providing such an exclusive information, waiting for more simmiler posts in future.

njoy electronic cigarettes ingredients

Posted on December 11, 2013 at 9:25 pm

Hey there! Someone in my Myspace group shared this site with
us so I came to check it out. I’m definitely enjoying the information.
I’m book-marking and will be tweeting this to my followers!
Wonderful blog and terrific style and design.

lung cancer spread to brain

Posted on December 13, 2013 at 1:15 pm

you’re truly a just right webmaster. The website loading pace is incredible.
It seems that you are doing any unique trick. Furthermore, The contents are masterpiece.
you have done a great task in this subject!

Homepage Optimierung Österreich

Posted on December 18, 2013 at 9:38 am

When someone writes an paragraph he/she retains the plan of a
user in his/her mind that how a user can know it. So that’s why this post is great.
Thanks!

rick

Posted on January 23, 2014 at 6:50 pm

This is awesome. I was having the same problem with Ubuntu OS. I couldn't figure it out for nothing….

Hughesnet

Posted on January 23, 2014 at 6:52 pm

Okay i think i'm confused here. Could someone go into greater about the ramdisk for Ubuntu???

electric cigarette making machines uk

Posted on February 3, 2014 at 6:34 pm

whoah this blog is great i love studying your posts. Stay up the good work!
You already know, many persons are hunting around for this information,
you can help them greatly.

lord of the rings blu ray extended edition amazon.co.uk lord of the rings blu ray pink floyd box set

Posted on February 8, 2014 at 6:28 am

Good day I am so delighted I found your blog, I really found you by accident, while I was looking on

Yahoo for something else, Nonetheless I am here now and would just like to say thank you for

a incredible post and a all round thrilling blog (I also love the

theme/design), I don’t have time to read through

it all at the moment but I have bookmarked it and also included your RSS feeds,

so when I have time I will be back to read a great deal more, Please

do keep up the great work.

Ovivotyli.Wordpress.Com

Posted on February 13, 2014 at 8:29 pm

I every time used to read article in news papers but now as I am a
user of net thus from now I am using net for articles, thanks to web.

Kira

Posted on March 6, 2014 at 4:02 pm

After going over a number of the blog posts on your site, I truly like your
technique of writing a blog. I saved it to my bookmark site list and will be checking back soon.
Please visit my website as well and tell me your opinion.

Pure Green Coffee Bean Extract,

Posted on March 7, 2014 at 5:49 pm

After going over a number of the blog posts on your blog, I truly
appreciate your way of writing a blog. I book-marked
it to my bookmark webpage list and will be checking back in
the near future. Please check out my web site too and let
me know your opinion.

African Mango

Posted on March 16, 2014 at 8:18 am

With havin so much content do you ever run into any problems
of plagorism or copyright violation? My blog has a lot of unique content I’ve either created myself or outsourced but it appears a lot of
it is popping it up all over the internet without my permission.

Do you know any methods to help reduce content from
being ripped off? I’d definitely appreciate it.

John Steve

Posted on March 18, 2014 at 3:43 pm

Although American Muslims make up approximately one percent of the U.S. population, most Americans can name several famous American Muslims. Names like Muhammad Ali, Malcolm X, Mos Def, Fareed Zakaria, Shaquille O’Neal, Lupe Fiasco, Dr. Oz and Rima Fakih are part of our popular consciousness. Important business figures like Farooq Kathwari (CEO of Ethan Allen), Malik M. Hasan (a pioneer in the field of HMOs), and Safi Qureshey (a leader in PC component manufacturing) are all American Muslims.

saffron for weight loss

Posted on March 23, 2014 at 9:48 am

Great post. I used to be checking continuously this blog and I’m inspired!
Extremely helpful info particularly the closing part
:) I deal with such information a lot. I was looking for this particular
information for a very long time. Thank you and good luck.

rochdale djs

Posted on March 24, 2014 at 11:49 am

Great post really like it a lot.Thanks for sharing.

sticker printing

Posted on March 25, 2014 at 8:08 am

I am pleased to read the post about system memory which is very interesting to read.Thanks for sharing the post.

bladder cancer

Posted on April 7, 2014 at 9:53 pm

Post writing is also a fun, if you know then you can write otherwise it is complicated
to write.

Dell i3647 1231BK Inspiron desktop

Posted on May 1, 2014 at 6:51 am

The Dell Inspiron Zino HD can be the center of your respective network and digital
media needs. While we’re on the screen and weight, it really is interesting to make note of that on screen depends not adequately support the weight in the screen, so if you gently shake internet connected computers screen in the future and
go. This allows for comfortable performance at best, and instead gives
off it a little sluggish at worst.

lice treatment home remedies

Posted on May 6, 2014 at 3:35 pm

There needs to be some type of follow-up treatment,
4-7 days later. of hair lice, you may want to rethink
whether you want to put those toxic chemicals on.
Lice thrive on the head and do not live more than about 48 hours when separated
from their host.

visit here

Posted on May 16, 2014 at 11:14 am

Great post really like it a lot.

does the carb nite solution really work

Posted on June 16, 2014 at 7:24 pm

I am a wordpress plugin programmer. We’ve designed a plugin which could gather web surfer’s email addresses to your database without the need for
their contact. I happen to be trying to choose beta test candidates and furthermore, as you’re gaining immense quantities of website traffic,
I am looking at your blog. Think you’re intrigued?

gym mats online

Posted on July 15, 2014 at 10:22 am

Many stores offer valuable discounts for newsletters in those days. They may offer future deals when you show a lot of curiosity about their store, therefore the savings can actually accumulate.

Delhi 9

Posted on July 27, 2014 at 11:49 am

Ramfs — 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

Leandra

Posted on August 12, 2014 at 12:29 pm

Thanks for sharing such a good thought, paragraph is nice, thats
why i have read it fully

Delhi Divas

Posted on August 17, 2014 at 6:24 pm

However, there are some drawbacks to this solution. All the files will be gone when you reboot your computer, so in fact it is suitable only for storing some temporary files – those which are generated during some process and are not useful later.
I will mount the ramdisk in my local directory. I use Ubuntu 11.10, my user name is 'szymon', and my home directory is '/home/szymon'.

Post a comment

Hello guest, care to post a comment?