Ask any Raspberry Pi tinkerer about their must-have SBC accessory, and you’ll hear microSD cards show up in the conversation more than a couple of times. Unlike their SSD and HDD counterparts, microSD cards are fairly inexpensive – to the point where you can dedicate multiple cards to separate distributions and swap between them without breaking the bank.
In fact, I have at least a dozen microSD cards scattered around my home lab, housing everything from moOde Audio and Lakka to Kali Linux and good ol’ Raspberry Pi OS. But I’ve started to drift away from these inexpensive storage devices recently and have started relying on USB and NVMe SSDs for more hardcore projects.
I tried using my Raspberry Pi as a laptop
With the right hardware and OS, even a Raspberry Pi can serve as solid daily driver
What’s wrong with using microSD cards on an RPi?
They’re terrible for heavy write operations
Despite their highly-versatile nature, microSD cards are nowhere near as durable as SSDs or HDDs. Sure, you won’t notice any issues if you run the occasional project on your Raspberry Pi. But everything changes once you move into hardcore experiments involving too many write cycles.
Of course, you could be one of the luckier folks who've had their microSD cards intact even after consistently using them to build projects with your Raspberry Pi. But having broken at least five microSD cards over the last two years – two of which were used solely for Home Assistant, one for a Frigate setup, and another two in a makeshift NAS – I can confirm that they’re far from ideal for projects involving excessive write operations.
While they’re not as economical as their pint-sized rivals, I’ve started using dedicated SSDs for these projects. An external SSD (or even an internal drive hooked up to an enclosure, for that matter) connected to a USB 3.0 port is my preferred boot drive, but if you’re using the Raspberry Pi 5, you also have the option to attach an NVMe drive to the SBC via a dedicated HAT.
Setting up USB/NVMe boot on the Raspberry Pi
The Raspberry Pi Imager makes this process a cakewalk
Unlike the average PC, the Raspberry Pi doesn’t ship with a tweakable BIOS menu, and it's pre-configured to boot from the microSD card. As such, you’ll have to manually switch the boot media from the SD card to the external storage drive.
Luckily, the official Raspberry Pi Imager lets you do so without dealing with numerous config files. If you’ve got a spare microSD card, you can flash it with an image that modifies the bootloader settings, allowing your Raspberry Pi to check the USB or NVMe ports for a bootable drive.
After selecting the Raspberry Pi board, you’ll want to press the Choose OS button inside the Imager utility. Then, you’ll want to scroll down to the Misc Utility Images section, which contains the Bootloader tweaks. Within this tab, you'll find the NVMe/USB Boot option. Once you’ve flashed the microSD card with these settings, you can plug it into the Raspberry Pi. Within a minute, the freshly-configured card will have worked its magic, and you’ll be free to plug in an external drive loaded with your favorite OS.
What if you can’t ditch microSD cards?
Log2ram is your best friend
Although an SSD is the perfect boot drive for the Raspberry Pi, it’s still a hefty investment for a mere SBC. If not for my data-hoarding antics forcing me to buy more drives than I’d need, even I would be hesitant to purchase new SSDs just for a DIY project or two.
Thankfully, there are a couple of ways you can reduce the wear on your microSD card. The first one is Log2ram, a utility that writes the disk logs to the RAM before syncing them with the microSD card periodically. To do so, simply open the terminal app and execute these commands:
-
sudo echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ bookworm main" | sudo tee /etc/apt/sources.list.d/azlux.list
-
sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg
-
sudo apt update && sudo apt install log2ram -y
If you’ve followed all the steps correctly, Log2ram will spring into action the next time you reboot your Raspberry Pi. For folks who want even more control over their Log2ram’s operations, you can run the nano /etc/log2ram.conf command and edit the SIZE and PATH_DISK parameters inside the config file.
The only caveat with Log2ram is that if you're into Home Assistant, you'll need the utility deployed on top of Raspberry Pi OS. Had I written this article a few years ago, I would've mentioned the recorder integration. Sadly, it no longer supports writing to memory, and configuring a database on a separate device is such a pain that it's honestly better to go for an ultra-cheap SSD instead.
I regret working on these 4 Raspberry Pi projects
The Raspberry Pi family lies at the heart of many DIY projects, some more unsuccessful than others
