{"id":119,"date":"2008-12-30T13:56:00","date_gmt":"2008-12-30T03:56:00","guid":{"rendered":"https:\/\/www.serenux.com\/?p=119"},"modified":"2021-01-14T14:02:36","modified_gmt":"2021-01-14T04:02:36","slug":"howto-utilise-the-ram-disk","status":"publish","type":"post","link":"https:\/\/www.serenux.com\/index.php\/2008\/12\/30\/howto-utilise-the-ram-disk\/","title":{"rendered":"HowTo: Utilise the RAM disk"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Those of you who are Amiga veterans from the 80\u2019s and early 90\u2019s will be familiar with the oh-so-useful RAM: disk. A virtual device that treated your unused system RAM as a disk device that you could extract temporary files to and make a general mess of without worrying about cleaning it up later, because when you rebooted, the content of the RAM disk would be cleared. The amount of data you could put in it was simply limited to how much physical RAM you had. The RAM disk was always 100% full because it was dynamic in nature. If you had 10MB of data in there, then the RAM disk consumed 10MB of system RAM. If you only had 2MB of data in there, then it only consumed 2MB of system RAM \u2013 the RAM disk never impacted on the rest of system memory in a prejudiced fashion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Microsoft DOS and Windows have tried to replicate this feature with limited success, and the RAM disk was always a fixed size and pre-allocated from the rest of the system as well, which made it somewhat useless. If you had a 512MB RAM system and allocated 50MB for the RAM disk, then you only had 462MB left for the rest of the system, and this also meant that you could not put more than 50MB of data into the RAM disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu Linux (and pretty much every other distro) has its own RAM disk feature as well and is just as flexible as the Amiga\u2019s RAM disk in its use. Here\u2019s a guide on how to use it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using a RAM disk in Ubuntu is simplicity itself \u2013 it\u2019s already setup for you!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The RAM disk is located at \/dev\/shm on your system. Anything placed in this directory is in the RAM disk and will be lost when you reboot the system. The RAM disk is already utilised for temporary files from PulseAudio, so if you list the content of the RAM disk in a terminal with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ ls \/dev\/shm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You might get one or more temporary files that look similar to \u201cpulse-shm-2343031262\u2033.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s make the RAM disk more accessible \u2013 how about an icon for it on the Gnome desktop?<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Start by doing a single right-mouse-click\u00a0 anywhere on the Gnome desktop. A menu appears.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122654im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/createnewlaunchermenu.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Choose \u201cCreate Launcher\u201d from this menu. A \u201cCreate Launcher\u201d window will appear.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122657im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/createnewlauncherblank.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Change the \u201cType\u201d option from\u00a0<em>Application<\/em>\u00a0to\u00a0<em>Location<\/em>.<br><\/li><li>In the \u201cName\u201d field, type in\u00a0<em>My RAM disk<\/em>\u00a0(or whatever you prefer).<br><\/li><li>In the \u201cLocation\u201d field, type in\u00a0<em>file:\/\/\/dev\/shm\/<br><\/em><\/li><li>And finally in the \u201cComment\u201d field, type in a suitable description such as\u00a0<em>\u201cAccesses the RAM disk for temporary data\u201d<\/em>.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122704im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/createramdisklauncher.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>Click OK and a new icon will appear on the desktop entitled \u201cMy RAM disk\u201d.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122708im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/desktopramdisklauncher.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\"><li>When you double-click on it, a Nautilus window will open showing the content of the RAM disk.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122711im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/ramdisknautiluswindow.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Try copying some data to the RAM disk now and then reboot your PC. When you re-open the RAM disk, you will find the data you copied is now gone because it was never physically saved to your hard-drive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Great stuff, but that Launcher icon looks a bit boring. Let\u2019s give it some meaning. On my system, I use an icon of a male sheep, or (you guessed it) a Ram! Male sheep = Ram = RAM disk, geddit? Oh never mind\u2026 You can use this visual gag yourself by replacing the icon of the launcher with an image file.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>First up, download the sheep icon from\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/web.archive.org\/web\/20160315122630\/http:\/\/www.serenux.com\/~hyrax\/pics\/misc\/icons\/RamSheep.png\" target=\"_blank\">here<\/a>\u00a0and place it somewhere appropriate on your system where it can be re-retrieved from, eg:\u00a0<em>\/home\/jbloggs\/Pictures\/RamSheep.png<\/em>\u00a0because it needs to be reloaded as your Launcher icon whenever you reboot. Leave this Nautilus window showing pictures folder open as we\u2019ll need it to drag and drop from later.<br><\/li><li>Now do a single-right-click of your RAM disk icon on your desktop and choose \u201cProperties\u201d from the menu. A new window appears.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122713im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/ramdisklauncherproperties.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>The properties window shows the current icon for your Launcher.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122715im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/ramdiskproperties.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Now drag the sheep icon from where you downloaded it to on top of the default icon of the launcher and release the mouse button to drop it. This will replace it with the picture of the sheep.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122719im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/draganddropsheepicon.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Click\u00a0<em>close<\/em>\u00a0to close the Properties window.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122722im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/newsheepiconforramdisk.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>If the icon is too small for you, you can make it bigger by resizing it. Do a single-right-click on the\u00a0 icon and choose \u201cStretch icon\u201d from the menu. Four anchors will appear on the icon for you to pull on.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122725im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/stretchramdiskicon.jpg\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Grab one of the anchors with your mouse and drag it until the icon is at the desired size.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122727im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2008\/12\/stretchingramdiskicon.jpg\" alt=\"\"\/><figcaption>It&#8217;s a RAM Disk, geddit?<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Click anywhere outside of the icon to set the icon size and remove the anchors.<br><\/li><li>You\u2019re done!<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Those of you who are Amiga veterans from the 80\u2019s and early 90\u2019s will be familiar with the oh-so-useful RAM: disk. A virtual device that treated your unused system RAM as a disk device that you could extract temporary files to and make a general mess of without worrying about cleaning it up later, because [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":1,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}