Raspberry Pi boots off an NVMe SSD, natively!
This tiny little thing is a truly expandable raspberry pi able to be used in many ways. For example, there’s a project called cm4aes, which builds some super high, fidelity audio outputs straight into the raspberry pi, or take this board the mirko pc, which i just got in the mail from poland. One guy mirak saw the compute module 4 and decided he wanted to build a full mini pc with it. So he did he designed this pcb and had it manufactured then soldered all the components to make a full fledged mini pi pc with tons of neat features, including a built in high quality. Headphone amp i’ll talk more about this board in a future video. But what i wanted to highlight is this part right here in the middle of the board it’s the first time i’ve had a pie board with a full size m key slot and it’s really cool, because now i can put in any standard nvme ssd on the Pi, this storage is even faster than when you plug an nvme drive into a standard, pi 4 using a usb 3.0 adapter, because the storage connects straight to the pi’s pci express bus, anyways that’s, not what this video is about either in this video. I wanted to test a feature that’s, so new it’s still in beta, but soon it’ll be available standard on pios and that’s nvme booting. What does it take to get the pi to boot off an nvme drive like this 500 gig wd black ssd, and how much faster are tasks like booting and web browsing to test that i’m going to install the wd black ssd into the miraco pc’s m.
2 Utor? Then i’ll snap in a compute module 4 right where it belongs. I booted it up and made sure i could see the attached nvme drive using ls blk in the terminal. Sada, in the future, the compute modules should be able to boot from nvme drives right away out of the box, maybe requiring a tweak to the boot order if you have a compute module with emmc, but right now, since it’s in beta, i have to do a Few extra steps to get this to work. Prvi, i shut down the pi and connected it to my mac in usb boot mode. So i could update the pi’s bootloader to do that. I used the usb boot utility on github. I modified the boot order, so the nvme drive would be used before emmc or sd cards then ran the update, pi eeprom’s shell script in usb boot. Konačno, i ran the rpi boot command with an extra argument, dash d nvme, which makes sure the nvme boot loader is in place but, like i said all that stuff won’t be necessary once this feature is out of beta after that was done. I booted the pi back up and used the built in sd card copier utility to copy all the data from the emmc storage to my wd, black ssd make sure to check new partition uuids here this copy took some time, but once it was done there was One more step to ensure the pi would actually boot properly.
I had to mount the nvme drive and update the raspberry pi firmware to the latest version, using rpi dash update, specifying a root path and a boot path like you see on the screen, so it would update the firmware on the nvme drive once that was done. I shut down the pi, then booted back up and look the route and boot partitions are both mounted from the nvme drive, and you can also see the boot and route partitions on the internal emmc storage were mounted automatically as if they were external micro sd cards. At this point, i could reformat the emc storage. If i wanted, or if i pulled out the ssd, the pi would just revert back to booting off the emmc, but i didn’t want to do that. Instead, i wanted to benchmark this thing. My big question: how much faster is the pi with an nvme ssd, and i wanted to compare boot times and app launch times. Prvi, i wanted to compare it to a number of different boot options like the built in emmc storage, a fast micro sd card. U mom slučaju., na 64 gig sandisk extreme and the exact same ssd, but in a usb 3.0 to nvme adapter, like you’d use on a raspberry pi 4.. kao prvo, i should mention i made sure to disable bluetooth by adding the disable bt overlay to my boot config, and then i disabled, hci uart. I found the measured boot time was a lot longer on pi’s without built in bluetooth.
If i didn’t do that with that sorted here are the numbers. Boot up times are practically identical. Ja sam.. Not too surprised, Iako, the linux boot process has been fine tuned over the years and the things that take the longest are networking device and graphic system startup. None of which are affected by the boot volume speed next up, i wanted to test something i do once my pi is booted and actually quite a bit while using the pi open, an app do something in it and then quit. I built a nodejs script to open chromium load. Moja web stranica, then quit chromium there’s a link to a blog post with the script in it in the description, if you’re wondering, but you might wonder why i chose my website well, because it’s a very light and fast website that gives consistent benchmark results because i take Privacy seriously and don’t load any third party scripts or trackers. If you have your own website, you should consider doing the same thing and no i’m not going to segue into a sponsored segment for a vpn here, educate yourself on privacy don’t! Do what paid sponsors tell you to do anyways back to the test. Ovdje? Are the results and here’s where it gets more interesting? You can see the emmc is actually a bit faster than the micro sd card and that’s, because the compute module 4 actually has some optimizations for emmc that make it fairly fast, at least compared to even the fastest micro sd cards.
But the nvme drive is faster. Still it’s 44 percent faster than the micro sd card and 21 percent faster than emmc, and just because i know someone’s going to ask about it in the comments i also tested, the exact same nvme drive on the exact same pi in an external usb 3.0 to Nvme adapter to see what kind of overhead loss you get if you use nvme drives through an adapter on a regular pi, 4 model b and as a reminder, i ran all these tests three times and the numbers in each run were very close with less than Two percent standard deviation that’s pretty good for a complex benchmark like this and in this benchmark and many others i’ve seen the same thing about a 10 percent speed up by running the nvme drive native instead of through usb 3.0. Now these numbers are one thing, but would you really notice the difference using a pi day to day yeah you will i guarantee it and remember from my tofu board review. Nvme storage is actually more than 10 times faster when it comes to raw storage operations like file copies, and if you want a final reason. Why nvme on the pi is a good idea. The wd black i’m using should last much longer with many more write cycles than all, but the most expensive industrial micro sd cards, assuming you have a good power supply, and that brings me to the point of the mirko pc’s power input.
You might have noticed a couple low voltage warnings when i was running the benchmarks earlier. A fast new ssd like this one can use up to 10 watts and couple that, with the pi itself, consuming 10 watts at peak, and you need at least 20 watts of power to be safe. The miraco pc is designed with a 5 volt 3 amp power input and that can only provide 15 Watts. Zapravo, my fio benchmarks ran into errors a couple times, so i re ran them on the official. I o board, with a pci to m.2 adapter card. So i could provide 12 volts at 5 amps that’s over 60 watts of power, and this is why it’s incredibly important to use a good power supply with a raspberry pi, no matter what kind of storage you use it has to provide enough current and handle large Spikes, a lot of people might not realize it, but power supplies are often the reason for micro, sd card corruption. I’Ve never had corruption on any of the samsung or sandisk microsd cards. I use and i’ve been testing some of these cards since 2014.. Why is that? Because i make sure i use good power supplies with my pies and i try not to write, tons and tons of data to them like noisy log files, sorry for the rant bottom line. If you care about your data, use a good power supply, not the cheapest. One you have laying in your drawer so pies can boot off nvme ssds, To je, pretty cool and yeah.
A pie is going to bottleneck a fast ssd like the wd black. I have it’s as going over three gigabytes per second of sequential, read speed, but current generation pi’s will only get about 400 megabytes per second max, but they’re still super fast on the pi. The random i o is way faster on one of these than any other option for pi storage, and you can also get nvme ssds in way larger sizes, with much better performance than microsd cards, plus they’re much smaller than even 2.5 inch sata drives, and that brings Me to my current suggestion for the pi foundation. If there’s any way, a future pi 5 could include four lanes of pci express throughput and i don’t know maybe an m.2 slot under the board. That would make one heck of a single board computer. Until then i’ll be using boards like the miraco pc and the compute module 4. So i can get the fastest pi performance possible for my particularly pertinent projects until next time, i’m jeff gearling and my app just locked up. So i can’t do anything right now, because i take privacy, private privacy, privacy, privacy, privacy, with tons of neat features, including oh man. Every time i add words, it doesn’t make sense well that’s, because it’s a very light and fast website. No somebody texted me.