{"id":968,"date":"2024-07-27T15:19:27","date_gmt":"2024-07-27T19:19:27","guid":{"rendered":"https:\/\/paynecentral.com\/tompayne\/2024\/07\/27\/minecraft-raspberry-pi-5\/"},"modified":"2024-07-27T18:28:41","modified_gmt":"2024-07-27T22:28:41","slug":"minecraft-raspberry-pi-5","status":"publish","type":"post","link":"https:\/\/paynecentral.com\/tompayne\/2024\/07\/27\/minecraft-raspberry-pi-5\/","title":{"rendered":"Minecraft: Raspberry Pi 5"},"content":{"rendered":"\n<p>I decided to upgrade my Minecraft server to a Raspberry Pi 5 to see if I can get better performance, especially when creating new \u201cchunks\u201d (new terrain).&nbsp;<\/p>\n\n\n\n<p>Originally, I was just going to swap over the USB3 SSD but after some reading, it appears I can get better drive speed with the new PCI interface to an NVME drive. There is a convenient \u201cbase\u201d from Pimoroni the attaches the drive under the main RPi motherboard. This is much cleaner that having the USB drive hanging off the Raspberry Pi.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1-1024x768.jpg\" alt=\"\" class=\"wp-image-967\" srcset=\"https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1-1024x768.jpg 1024w, https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1-300x225.jpg 300w, https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1-768x576.jpg 768w, https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1-1536x1152.jpg 1536w, https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1.jpg 2000w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">NVME drive is under the RPi5<\/figcaption><\/figure>\n\n\n\n<p>Now I will have two operational servers and can do some performance comparisons.<\/p>\n\n\n\n<p>I need to figure out how to make the Pi boot from the NVME. It is supposed to work. (My immediate concern is \u201cdoes the NVME board I bought work?\u201d)<\/p>\n\n\n\n<p>I used the Raspberry Pi Image creator to temporarily install the OS on an SD card. Once it booted, I was able to confirm the NVME drive was recognized with &#8220;lsblk&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tompayne@rpi5:~ $ lsblk\nNAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nmmcblk0     179:0    0  29.8G  0 disk \n\u251c\u2500mmcblk0p1 179:1    0   512M  0 part \/boot\/firmware\n\u2514\u2500mmcblk0p2 179:2    0  29.3G  0 part \/\nnvme0n1     259:0    0 238.5G  0 disk <\/code><\/pre>\n\n\n\n<p>The drive shows up here as &#8220;nvme0n1&#8221;<\/p>\n\n\n\n<p>To check the performance, I installed and used &#8220;hdparm&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tompayne@rpi5:~ $ sudo hdparm -t --direct \/dev\/nvme0n1\n\/dev\/nvme0n1:\n Timing O_DIRECT disk reads: 1174 MB in  3.00 seconds = 390.94 MB\/sec<\/code><\/pre>\n\n\n\n<p>The drive\/chip I bought (Inland TN320 256GB SSD) claims to support 2000 MB\/sec read and 1500 MB\/sec right. I am thinking the system id defaulting to PCI Gen 2 speeds. In the videos I have found, it says to tweak the \/boot\/config.txt file changing dtparam=pciex1_gen=3 but in my version of the OS, the confix.txt file has been moved to \/boot\/firmware\/config.txt and does not include any reference to the dtparam setting.<\/p>\n\n\n\n<p>Based on uname and \/etc\/os-release, I am running: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>System:<\/strong> 64-bit (<code>aarch64<\/code> in <code>uname<\/code>)<\/li>\n\n\n\n<li><strong>Kernel version:<\/strong> 6.6 (specifically <code>6.6.31<\/code> in <code>uname<\/code>)<\/li>\n\n\n\n<li><strong>Debian version:<\/strong> 12 (bookworm)<\/li>\n\n\n\n<li>Release date: July 4, 2024<\/li>\n<\/ul>\n\n\n\n<p>It appears this is now in the Advance section of raspi-config. After changing to PCI Gen 3, I am getting faster performance:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tompayne@rpi5:~ $ sudo hdparm -t --direct \/dev\/nvme0n1\n\/dev\/nvme0n1:\n Timing O_DIRECT disk reads: 2282 MB in  3.00 seconds = 760.51 MB\/sec<\/code><\/pre>\n\n\n\n<p>To copy the OS from the SD Card to the NVME, I will use rpi-clone base on the suggestion of <a href=\"https:\/\/www.jeffgeerling.com\/blog\/2023\/nvme-ssd-boot-raspberry-pi-5\">Jeff Geerling<\/a>. First I need to install git (<code>sudo apt install git<\/code>) , because Jeff suggests using a fork.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install rpi-clone.\ngit clone https:\/\/github.com\/geerlingguy\/rpi-clone.git\ncd rpi-clone\nsudo cp rpi-clone rpi-clone-setup \/usr\/local\/sbin\n\n# Clone to the NVMe drive (usually nvme0n1, but check with `lsblk`).\nsudo rpi-clone nvme0n1<\/code><\/pre>\n\n\n\n<p>The first time I tried the rpi-clone, it failed. ChatGTP suggested I try manually formatting the drive first:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkfs.vfat -F 32 \/dev\/nvme0n1p1\nsudo mkfs.ext4 \/dev\/nvme0n1p2<\/code><\/pre>\n\n\n\n<p>I re-executed the rpi-clone and it appeared to work.<\/p>\n\n\n\n<p>The boot order is now part of raspi-config as well. After changing the setting, I pulled out the SD Card and cycled power and the RPi5 booted up successfully from the NVME drive. Yeah!<\/p>\n\n\n\n<p>Next I need to set up James A Chamber&#8217;s <a href=\"https:\/\/jamesachambers.com\/minecraft-java-bedrock-server-together-geyser-floodgate\/\">Docker Container<\/a>, but first you need to install docker. I thought it was as simple as &#8220;sudo apt install docker&#8221;, but that didn&#8217;t work. I forgot I followed the instructions from my other go-to site, <a href=\"https:\/\/pimylifeup.com\/raspberry-pi-docker\/\">Pi My Life Up<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided to upgrade my Minecraft server to a Raspberry Pi 5 to see if I can get better performance, especially when creating new \u201cchunks\u201d (new terrain).&nbsp; Originally, I was just going to swap over the USB3 SSD but after some reading, it appears I can get better drive speed with the new PCI interface [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":967,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,12],"tags":[],"class_list":["post-968","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-network","category-minecraft"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/paynecentral.com\/tompayne\/wp-content\/uploads\/sites\/2\/2024\/07\/img_6471-2-1.jpg","_links":{"self":[{"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/posts\/968"}],"collection":[{"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/comments?post=968"}],"version-history":[{"count":2,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/posts\/968\/revisions"}],"predecessor-version":[{"id":972,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/posts\/968\/revisions\/972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/media\/967"}],"wp:attachment":[{"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/media?parent=968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/categories?post=968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paynecentral.com\/tompayne\/wp-json\/wp\/v2\/tags?post=968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}