13 ms·
Upgrade Raspberry Pi 4 with a NVMe boot drive
- mschuster91 6y agoI'd be interested if one of the various hacks for PCIe (https://hackaday.com/2019/07/10/giving-the-pi-4-pci-express/ https://hackaday.com/2019/07/10/giving-the-pi-4-pci-express/) to plug it in natively would work and, if yes, at what speed.
- adriancr 6y agocurios what the power draw is and if I need a powered USB hub for this.
- rektide 6y agoAuthor may have gotten lucky in their Western Digital Blue SN550 selection. It's a fairly low power drive. WD has been making their own controllers, & they have a history of being fairly power friendly. This is a very new drive too. This review[1] shows it using 2.62 watts during a large file copy and on-idling at 0.96 watts. The best drive shown is a Crucial MX500, using 2.32 watts during cpy and 0.52 watts at on-idle. There will be some additional power consumption from the usb adapter too but i'd expect no more than 0.2 watts. [1] https://www.tomshardware.com/reviews/wd-blue-sn550-m2-nvme-ssd-review-best-dramless-ssd-yet/3 https://www.tomshardware.com/reviews/wd-blue-sn550-m2-nvme-s...
- rwmj 6y agoThis is just plugging in NVMe over the USB 3 port? I was expecting this to be soldering something to PCIe lanes coming out of the SoC. Is this going to be any better than using an SSD with UAS which is what I'm doing already? (https://rwmj.wordpress.com/2020/09/24/raspberry-pi-4-running-fedora-32/ https://rwmj.wordpress.com/2020/09/24/raspberry-pi-4-running...)
- rektide 6y agoI am looking forward to a future where PCIe devices might be connected too. I would really appreciate it if someone other than Intel would kindly please start doing Thunderbolt. Now that USB4 is official, adding PCIe connectivity would be a very good perk for these next generation systems. So far though no one has registered interest. Please can someone other than Intel & Apple prioritize better connectivity? AMD? MediaTek? Qualcomm? Anyone? There's two modest perks to NVMe over SATA. First, the drives tend to be faster. For large reads/writes, this probably wont help, as you'll be bus limited to USB3 speeds. But for smaller reads & writes, the NVMe drive can maybe probably do more iops, and you may see wins & better latency on workloads. NVMe also has a bunch of under the hood improvements. There's a quite in depth comparison of the two[1]. Larger queues, multiple queues, less round trips to issue commands, better completion model. I am very much unsure of how many of these advantages are exposed & would carry over when the host-to-device connection is still UAS based, which is what adapters like the one in this article still feature, same as if it were SATA. But some of these wins will help latency & iops again vs a SATA drive. [1] https://sata-io.org/system/files/member-downloads/NVMe%20and%20AHCI_%20_long_.pdf https://sata-io.org/system/files/member-downloads/NVMe%20and...
- an_opabinia 6y agoMany AMD enthusiast motherboards ship with Thunderbolt. It's a straightforward technology to implement and I believe it is now royalty free. The only implementations are Intel's though and I'm sure they're expensive. Expansion is a complicated business model. Apple doesn't even ship headphone ports. The AirPods are smash hit, not least because when you sell a $1,100 device a $100 accessory suddenly seems really well priced. PCs are similarly pretty high ticket items, that market supports a situation where spending $100 on custom internal PSU cabling is not that bad. The Raspberry Pi is tough. Accessories cost more than 2x the device. It's a model that doesn't really make sense. You could say that people are buying these accessories, but really its greatest limiting factor is that it's too cheap, it's hard to psychologically deliver on the big ticket item + accessories shopping cart for it.
- nominated1 6y agoThese sorts of posts come up often and I cringe every time I see dongle attached storage. An unnecessary additional failure point seems counterproductive. I have a Raspberry Pi and I use an SD card because what I’m using it for doesn’t require anything more. If you need fast storage I believe you should buy an appropriate device and maybe petition the Foundation to add it in a future model. Right tool for the job and all that.
- timthorn 6y ago> An unnecessary additional failure point seems counterproductive One of the leading reasons for using USB attached storage on the Pi is to avoid SD card corruption issues.
- mmastrac 6y agoFWIW I have not had any SD corruption issues after 1) using name-branded cards and 2) ensuring that I feed each Pi w/5.2V. In the end I bought a commercial 5V power supply, tweaked it up 5% and wired directly to the 5V pins on the Pi.
- magicalhippo 6y agoI'm running several Pi's from SD card, some for years, and the only issue I had was with one that randomly crashed. Measured the resistance of the "USB charging cable" I had used for it and found it was 1 Ohm! So when the Pi peaked at 1A current draw, the cable dropped 1V. Swapped it out for something proper (<0.1 Ohm), and haven't had issues since.
- mmastrac 6y agoSame here. I even went as far as finding barrel-jack to USB connectors so I could wire thicker-gauge cables to the Pi. In the end I gave up on trying to find low-ohm cables and just wired directly to the power supply. It's surprising how many cables just plain suck.
- 6y ago
- lifty 6y agoDoes anyone know any board that is similar to RPi 4, with 8GB of RAM or more and a SATA port or an nvme slot? ARM would be great.
- othercharles 6y agoGenerally speaking you can choose either power efficiency or a wide bus, but rarely both. If you want a crappy underpowered m.2 slot, probably Intel Atom is the cheapest route. High performance ARM with m.2 PCI, not sure, but guessing if it's around it probably isn't cheap
- lifty 6y agoYeah, that makes sense. I wouldn't expect the same price point as an RPi and would love a higher performance CPU, but I think they are not out there at the moment. Wouldn't mind having something like 8 graviton2 cores and an nvme slot :)
- throwaway894345 6y agoLet's say one has a friend who doesn't know what "a wide bus" refers to... What would be a good way of explaining it to said friend?
- othercharles 6y agoA single PCIe lane can draw 0.5 A, 4x rises to 2 A. Separately, (random top Google result cutpaste): Architectural-level power optimization can target different system components such as CPU, caches, main memory,and buses [5, 6, 22, 4]. Power spent in off-chip buses can be a significant portion of the overall power budget. As an example, the core power consumption of Intel Celeron at 266MHz is 16W, while its off-chip bus (for a standard configuration) operating at 133 MHz consumes 3.3W [12, 13]. The contribution of off-chip bus power consumption to the overall power budget increases even more for embedded systems with low-power processor cores and memories, making off-chip buses a potential candidate for power optimization. Figure 1 shows the power consumption due to off-chip data bus for several embedded benchmark codes as a percentage of the overall power consumption (which includes processor data path, caches, buses, TLB, register file, instruction issue logic, clock, and off-chip memory) for an embedded processor. From this figure, we see that the off-chip data bus consumes between 9.8% and 23.2% of the total power consumed by the system depending on the benchmark being run. So, reducing the power consumption of the off-chip data bus would reduce the overall power consumption of the system to a considerable extent
- kzrdude 6y agoOne needs to login to read. I'm sorry, medium is not a very charitable blog host, and will cost the blog a large part of its audience with these new rules, unfortunately.
- OneLeggedCat 6y agoTrue, but this IS Hacker News, and most of us in here can easily get around this particular one .
- tutfbhuf 6y agoYes, but it's pretty annoying nonetheless. https://outline.com/aS4yWR https://outline.com/aS4yWR
- lxe 6y agoI'm getting pretty irritated that the Web is inundated with Medium. It used to be just a nice blog host, and now I don't even know what it is. Glad Substack is picking up steam.
- sp332 6y agoYou know Substack has paid subscriptions too, right?
- anderspitman 6y agoHow is substack today different from Medium a few years ago? More importantly, what's different about their incentives that will prevent them from becoming what Medium is today?
- EricE 6y agoYup - second time today I am also required to log in. No thanks.
- pmiller2 6y agohttps://archive.is/xPB0B https://archive.is/xPB0B
- melvyn2 6y agoThis part is strange: "NVMe drive — an M.2 SSD looks almost identical, but has two notches instead of one. Generally an SSD will perform to the tune of hundreds of MB/s instead of thousands." First, both are SSDs, so I don't know what he is trying to compare. Both use M.2, but different keys from the sounds of it (the "notches"). M.2 drives can be either SATA or NVME, but it is harder to come across a SATA M.2 drive than an NVME drive these days, so I'm having trouble seeing the point.
- onli 6y agoThere are some M.2 SATA SSDs around that get regularly confused with NVMe SSDs. He for sure wanted to warn against SATA SSDs. Though for the Pi a SATA SSD would be fast enough.
- charwalker 6y agoAnd likely even a Pi4 couldn't take full advantage of an NVME drive except in specific workloads or setups. I'd use a SATA M.2 if needed to save 40% of the cost on the same size SSD. Or just a random thumb drive I have around. The Pi4 compute unit has a PCIe x1 slot, I think, and that could better put an NVME drive to use. But at that cost, for the drive and Pi, I don't see it being widely used outside of hobby or home use. I'm excited about this and how the official Pi4 firmware now supports USB boot. Maybe if you used the Pi to run a NAS and wanted the NVME drive as accelerated cache (it can do H.265, 4kp60 decode, and H.264)? But can a Pi even process an NVME drives bandwidth via it's CPU/etc or Gigabit Ethernet/USB 3.0/GPIO add on? Edit: This guide is basically 1. Put SSD in adapter and 2. Set up USB boot then clone SD card to SSD. How is this article not just a forum post like the dozens of others that provide the same information and process?
- wtallis 6y ago> I'd use a SATA M.2 if needed to save 40% of the cost on the same size SSD. Or just a random thumb drive I have around. There are now lots of low-end M.2 NVMe SSDs on the market, and M.2 SATA SSDs are becoming uncommon. So there's no price remaining price advantage for M.2 SATA over M.2 NVMe—certainly not 40%—and it is not uncommon to find M.2 NVMe sale prices that are better than any M.2 SATA SSD price, since the more popular NVMe SSDs get better and more frequent discounts than the niche M.2 SATA SSDs. And the M.2 SSDs on the market with the lowest absolute cost (rather than per GB) are usually the Intel Optane Memory 16GB NVMe SSDs that were intended for use as cache devices, but have enough capacity for lots of embedded Linux use cases while also outperforming SATA SSDs of any capacity.
- xuhu 6y ago> Go to ... GPU Memory and change it from 16MB to 64MB ... should be "64MB to 16MB".
- dheera 6y agoHonestly I'd get rid of the USB and use the Pi 4 compute module with NVMe next year. USB connectors suck balls, one bump or connector dangling over the edge of your desk that gets hit by a hip and you have a device reenumeration, no idea what havoc that would have on the kernel that's running off it. USB is evil. Never use it for anything mission critical.
- justin66 6y ago> one bump or connector dangling over the edge of your desk that gets hit by a hip and you have a device reenumeration It’s fun to think about the horrors which might result with similar mistreatment of old school external SCSI hardware. USB is fine; use quality cables and don’t run your computer in a disco if you can help it.
- dheera 6y agoUSB cables are some of the worst designed crap I have ever seen in the history of computing. When you plug the cable in, it doesn't make a firm, snug fit, and jiggles around in place. If you press down on it it can even torque the connector right off the PCB. I often have to design 3D printed housing to go around the USB plug housing to hold and lock the plug snugly in place, because the designers of both the USB ports and plugs are incompetent at designing something industrial grade that locks down firmly. SCSI cables were fine, their ports were secured to the housing and they had nice screw locks so the cables wouldn't go anywhere. Any cantilever forces were absorbed by metal casing, not PCB. Super reliable.
- justin66 6y ago> jiggles around in place I don't want to defend USB too heavily (as you say, it is certainly not "industrial grade," but I don't know what the equivalent of something simple and very strong like a Hubbell twist-lock connector would be in data transfer terms, and that's something to contemplate) but this really shouldn't happen with any halfway decent cables or hardware. It doesn't apply to the Raspberry Pi 4 in my experience, or any of my laptops or PCs. Phones and micro-USB are, of course, a special case and uniquely horrible. > SCSI cables were fine Except when they weren't, and then you'd have to spend fifty bucks (whatever that equals in 2020 dollars) to test and see if the cable was what was failing you, or the termination, or the jumper settings...
- nottorp 6y ago... with a usb boot drive. He just happens to use an USB to NVME adapter but don't expect real NVMe speeds.
- protoman3000 6y agoAnother neat trick is to use the 8GB Raspberry Pi 4 and load the whole OS into the RAM at boot time. This makes booting take much longer but after that the system runs very fast and responsive. Of course eventually the logs will eat everything to you have to write back to USB or SD from time to time.
- ur-whale 6y agohttps://archive.is/xPB0B https://archive.is/xPB0B
- FpUser 6y agoOne step in this description is not really needed. One can do diskdup from SD card to SSD right from inside the same Pi booted originally for SD card.
- kup0 6y agoThe USB is limiting this so much there is no need to go with NVME over SATA, IMHO. I see the USB3 result for the "M.2 SSD" (I assume the author means SATA?) being ~30/MB but almost surely something is going wrong there. That is not a normal result for any mid-to-high level SATA SSD. Plenty of SATA M.2 SSDs can easily hit the same speeds the NVME drive is hitting (specifically when on USB3). NVME might give you some additional random r/w performance, however. It seems like overkill to use NVME on USB 3.0 when SATA can saturate that bus just as easily. SATA M.2 drives will also run cooler. Some NVME USB controllers are notoriously hot-running
- emidln 6y agoPower consumption would be my guess for why one would choose NVME over SATA in this application.
- kup0 6y agoHrm, maybe over USB it's different because of the performance limitations, but my understanding was that SATA was lower power draw. Though maybe I'm wrong and/or potentially this differs on a per-drive/per-controller basis.
- wtallis 6y agoIt very much depends on the particular drive, with both controller and NAND choice affecting power draw and efficiency. On a performance per Watt basis, most M.2 NVMe SSDs are much more efficient than M.2 SATA SSDs. The most efficient M.2 NVMe SSDs are also at least competitive with M.2 SATA SSDs in terms of absolute power consumption, despite outperforming the SATA SSDs by at least a factor of 2-3x. Power consumption from a M.2 NVMe SSD will also drop slightly when only one or two of its four PCIe lanes are used, which is the case when the drive is behind a USB to NVMe bridge. For example, comparing a SK hynix NVMe drive against of dozens of other M.2 NVMe and 2.5" SATA drives: https://images.anandtech.com/doci/16012/rr-all.png https://images.anandtech.com/doci/16012/rr-all.png Unfortunately, I don't think there are any M.2 SATA results in there, and those are often a little bit more efficient than their 2.5" counterparts (running off 3.3V rather than 5V, but stepping it down to at least one or two lower voltages on the drive in either case).
- snthd 6y agoRelated: "Raspberry Pi USB Boot - UASP, TRIM, and performance" - https://www.jeffgeerling.com/blog/2020/raspberry-pi-usb-boot-uasp-trim-and-performance https://www.jeffgeerling.com/blog/2020/raspberry-pi-usb-boot...
- johnchristopher 6y agoDepending on what you want to do you can get good results using tmpfs ram disk in combination with a non volatile USB plugged storage. Eg: I convert some RTSP stream from a pi zero to HLS on a pi4 by ffmpegging the RTSP stream to HLS files in the RAM disk. I use bindfs to make this mountpoint available as a www-data folder in /home/pi/ssd/web/hls (which is actually on an USB plugged SSD) for HTML viewing in the browser. Motion triggers events, those events can be recorded from the RTSP stream or the ramdisk (holding HLS files) to the attached SSD. The HLS conversion adds a 30 second buffer so any triggers on the RTSP stream has an hls capture starting 30 seconds before the event and the SD card is never touched and I could use a spinning disk, it wouldn't be a bottleneck (but I am somehow more confident the SSD will be more stable power wise).
- geerlingguy 6y agoJust wanted to note that you DO get a large (measurable) performance increase using NVMe natively via the Pi's PCIe bus vs. through a USB 3.0 adapter; see my notes in my Compute Module 4 review: https://www.jeffgeerling.com/blog/2020/raspberry-pi-compute-module-4-review https://www.jeffgeerling.com/blog/2020/raspberry-pi-compute-... I should probably dedicate a post and video to NVMe support, but basically you get double the random IO numbers if using NVMe vs NVMe-via-USB3. You can't boot off internal NVMe though, at least not natively with no microSD card or eMMC volume.
- FullyFunctional 6y agoThanks for the write up. That was enlightening. PCIe is a really nice "bus" all things considered. At DSSD we liked it so much that we ran it directly to clients, over custom cables & connectors.
- brirec 6y agoWhat sort of distance are we talking? What sort of devices? Running a PCIe lane to a client seems a little odd to me, but I figure I’m missing context
- FullyFunctional 6y agoUp to 2 m over copper, longer over active optical. Why? Because of insanely low latency and very high bandwidth (PCIe gen 3 x4 in 2010!). No kernel involvement, app direct to storage. Way ahead of the time.
- alexellisuk 6y agoLooking forward to getting my hands on one :-) Next time you speak to the RPi folks, feel free to name-drop. Getting into the "RPi alpha tester club" would be very helpful for writing tutorials like this.
- djsumdog 6y agoDoes nvme actually mean anything here over m.2/sata? Is the Pi able to really use all that bandwidth? Also, plugging in the NVME over USB3 makes them show up as /dev/sdx devices (not /dev/nvme0x)? Is USB3 still allowing a PCI bus lane connection? I thought you needed a thunderbolt connect for that.
- smcleod 6y agoI wouldn't suggest using hdparm for benchmarking, have a look at fio, it's easy to use and revised very detailed and accurate information - https://smcleod.net/tech/2016/04/29/benchmarking-io/ https://smcleod.net/tech/2016/04/29/benchmarking-io/