{"id":465707,"date":"2010-03-24T08:08:04","date_gmt":"2010-03-24T12:08:04","guid":{"rendered":"http:\/\/www.linuxscrew.com\/?p=988"},"modified":"2010-03-24T08:08:04","modified_gmt":"2010-03-24T12:08:04","slug":"fastest-way-to-create-ramdisk-in-ubuntulinux","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/465707","title":{"rendered":"Fastest way to create ramdisk in Ubuntu\/Linux"},"content":{"rendered":"<p>I hope many of you will agree that sometimes it&#8217;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&#8217;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 <a href=\"http:\/\/en.wikipedia.org\/wiki\/RAM_disk\">Virtual RAM Drive<\/a> or <strong>ramdisk<\/strong> and can be setup in <strong>Ubuntu<\/strong> or almost any other <strong>Linux<\/strong> distribution using the following commands under root (to become root in Ubuntu use <code>\"<strong>sudo -s<\/strong><\/code>&#8220;):<\/p>\n<p># <strong>mkdir \/tmp\/ramdisk; chmod 777 \/tmp\/ramdisk<\/strong><br \/>\n# <strong>mount -t tmpfs -o size=256M tmpfs \/tmp\/ramdisk\/<\/strong><\/p>\n<p>where 256M is amount of RAM you wish to allocate for ramdisk. It&#8217;s clear that this value should be <strong>less than amount of free memory<\/strong> (use &#8220;<code>free -m<\/code>&#8220;). 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.<\/p>\n<div class=\"feedflare\">\n<a href=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?a=0OOyprx0fPQ:UeDxctGSKhw:yIl2AUoC8zA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?d=yIl2AUoC8zA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?a=0OOyprx0fPQ:UeDxctGSKhw:7Q72WNTAKBA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?d=7Q72WNTAKBA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?a=0OOyprx0fPQ:UeDxctGSKhw:V_sGLiPBpWU\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?i=0OOyprx0fPQ:UeDxctGSKhw:V_sGLiPBpWU\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?a=0OOyprx0fPQ:UeDxctGSKhw:gIN9vFwOqvQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?i=0OOyprx0fPQ:UeDxctGSKhw:gIN9vFwOqvQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?a=0OOyprx0fPQ:UeDxctGSKhw:dnMXMwOfBR0\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/linuxscrew?d=dnMXMwOfBR0\" border=\"0\"><\/img><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/linuxscrew\/~4\/0OOyprx0fPQ\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I hope many of you will agree that sometimes it&#8217;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&#8217;s much more effective not to waste computer resources on reading\/writing data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-465707","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/465707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=465707"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/465707\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=465707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=465707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=465707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}