Using an SSD with a Raspberry Pi

One of the Raspberry Pi’s big selling points is that you can install the operating system on an easily swappable SD card. But long term, a solid state drive (SSD) is probably better, and I’ve recently switched to one.

SD card limitations

The Raspberry Pi’s use of SD cards for storage does make sense. They can be easily swapped out, if you want to use different operating systems or load different configurations. And it means that they can be shipped without built-in storage, which keeps the cost down. Indeed, the Raspberry Pi Zero was given away free with a magazine when it launched in 2015.

But SD cards were mainly designed for storing images and videos from cameras, and not for running operating systems. SD cards do fail after a certain number of read and write cycles, and running an operating system on one is going to result in a lot of reading and writing. So whilst an SD card in a camera may last several years, in a Raspberry Pi, it could be a matter of months. This is especially true if you run software like Home Assistant.

And seeing as I do run Home Assistant on my Raspberry Pi, alongside a host of other server software, I decided that I would migrate everything to an SSD before something bad happened.

Choosing an SSD

I went for this basic 128 GB SSD by LQH Tech (sponsored link). It cost me less than £20 (well, actually it was bought with birthday money). It looks like a standard USB flash drive, but it houses an SSD instead. The two are different, and you should get both better performance and a longer life span out of an SSD compared to a flash drive or SD card. It simply plugs into one of the Raspberry Pi’s blue USB 3 ports.

There are other options. You can buy a HAT (Hardware Attached on Top) device which lets you connect a standard SSD inside a larger case, or a USB to SATA cable to connect a SATA SSD to one of your USB ports.

The LQH Tech SSD that I went for seems to work fine, although it does get quite hot when in use. Even so, it offers a noticeable performance improvement to Home Assistant.

Migrating from an SD card to an SSD

If you’re currently running Raspberry Pi OS on your SD card, then you could try the rpi-clone tool to copy the contents to an SSD. Then, once it’s done, all you should need to do is shut down your Raspberry Pi, take out the SD card and then turn it on again. If it’s worked, then your Raspberry Pi should happily boot from the SSD.

I run Debian on my Raspberry Pi. Now, rpi-clone may or may not work on Debian (Raspberry Pi OS is forked from Debian after all), and so I tried it. It didn’t work – the Raspberry Pi would not boot from the SSD.

Instead, I set the SSD up with a fresh Debian install (it helps that we’re a household with two Raspberry Pi computers), installed Home Assistant Supervised and then restored a backup from the installation on the SD card. Apart from requiring some minor configuration tweaks, mainly due to my existing external USB hard drive now being called ‘sdb’ rather than ‘sda’, this worked fine.

I made this migration a few weeks ago and haven’t had any issues. The SSD being rather warm is a concern, but it doesn’t seem to affect performance which is way better than on an SD card. And hopefully it’ll have a longer life too.

Enjoyed reading?

You can sign up to receive a weekly email with new blog posts - just pop your email in below. You can unsubscribe at any time.

3 thoughts on “Using an SSD with a Raspberry Pi”

  1. You’re using a flash drive which will fail much much sooner than an actual SSD. In my experience, flash drives fail just as fast as “A” (application) rated uSD cards.

Comments are closed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)