{"id":699427,"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.com\/index\/699427","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":288,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4821],"tags":[],"class_list":["post-699427","post","type-post","status-publish","format-standard","hentry","category-news"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9NivD-2VX5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/posts\/699427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/users\/288"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/comments?post=699427"}],"version-history":[{"count":0,"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/posts\/699427\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/media?parent=699427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/categories?post=699427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.com\/index\/wp-json\/wp\/v2\/tags?post=699427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}