{"id":2127,"date":"2018-08-25T15:45:27","date_gmt":"2018-08-25T15:45:27","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2127"},"modified":"2018-08-25T15:46:40","modified_gmt":"2018-08-25T15:46:40","slug":"start-minecraft-server-on-ram-disk-linux","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/start-minecraft-server-on-ram-disk-linux\/","title":{"rendered":"Start Minecraft server on RAM disk Linux"},"content":{"rendered":"<p>Create tmpfs ramdisk.\u00a0 Note if your Linux user is something other than steve you&#8217;ll need to change where appropriate.<\/p>\n<pre>mkdir \/home\/steve\/mcdisk<\/pre>\n<p>In etc\/fstab add the following<\/p>\n<pre>tmpfs \/home\/steve\/mcdisk tmpfs defaults,size=4096m 0 0<\/pre>\n<p>This creates a 4GB ram disk at \/home\/steve\/mcdisk<\/p>\n<p>To mount it you can either reboot, or run<\/p>\n<pre>mount -a<\/pre>\n<p>Copy your current Minecraft directory to the ram disk<\/p>\n<pre>cp -R \/home\/steve\/Current_MC_Server\/ \/home\/steve\/mcdisk<\/pre>\n<p>Create a Bash script in &#8220;\/home\/steve&#8221; named &#8220;ramdisk_save.sh&#8221;<\/p>\n<p>Paste the following in.\u00a0 You may need to install rsync if you do not have it installed<\/p>\n<pre>!\/bin\/bash\r\n\r\nRAMDISK=\"\/home\/steve\/mcram\/\"\r\nMCDIR=\"\/home\/steve\/1.13\"\r\n\r\nrsync -r -t $RAMDISK\/ $MCDIR\/\r\nrsync -r -t $MCSTORE\/ $MCPATH\/<\/pre>\n<p>Now add the script to crontab<\/p>\n<pre>crontab -e<\/pre>\n<p>and<\/p>\n<pre> *\/5 * * * * \/home\/steve\/ramdisk_save.sh<\/pre>\n<p>This will now run every 5 minutes and sync any changes on the ram disk to the original directory.<\/p>\n<p>Start the Minecraft server<\/p>\n<pre>java -Xmx3072M -Xms3072M -jar server.jar nogui<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create tmpfs ramdisk.\u00a0 Note if your Linux user is something other than steve you&#8217;ll need to change where appropriate. mkdir \/home\/steve\/mcdisk In etc\/fstab add the following tmpfs \/home\/steve\/mcdisk tmpfs defaults,size=4096m 0 0 This creates a 4GB ram disk at \/home\/steve\/mcdisk &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/start-minecraft-server-on-ram-disk-linux\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,3,118],"tags":[7,512,281,514,500,513],"class_list":["post-2127","post","type-post","status-publish","format-standard","hentry","category-centos-linux","category-linux","category-minecraft","tag-linux-2","tag-mc","tag-minecraft","tag-ramdisk","tag-server","tag-tmpfs"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2127"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2127\/revisions"}],"predecessor-version":[{"id":2129,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2127\/revisions\/2129"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}