Raspberry Pi Cheap SSD Upgrade Guide

I’ve covered the benefits of taking your Raspberry Pi to a solid state drive (SSD) before extensively in this article but in a nutshell you get around a 280% increase in raw throughput and a 1000% increase in 4k random read/writes over a MicroSD card.

That’s fantastic but SSDs have traditionally been very expensive costing you as much as 4+ Raspberry Pis so it seemed silly to use a drive like that as Pi storage. Until now.

SSD now cheaper than Micro SD cards
SSD now cheaper than Micro SD cards

That’s right. Thanks to technologies such as 3D NAND flash solid state drives for consumers have now become cheaper than mid-high range MicroSD cards. With 10x the performance of MicroSD cards they are now a no-brainer upgrade for servers or IO intensive Raspberry Pi projects.

Why Choose SSD?

MicroSD cards were not designed to serve as living storage for operating systems. They are designed for devices such as cameras and smart phones that need to write and reliably store data. They’re very good at this and some cards have excellent throughput fast enough to even record 4K video.

But one thing they are not good at is 4k random writes and rewrites. These are small writes throughout a disk and consist of about 25% of all hard drive activity on a computer. Almost every action you take and even routine log file updates trigger these updates so they are very important for performance.

To show you the difference in performance I have developed a benchmark that anyone can run and uploads the results to the site. Click here to see benchmark results.

As you can see all of the top spots in the results are held by solid state drives. Further, solid state drives beat the fastest MicroSD cards by about 300%.

MicroSD performance varied wildly based on quality of the card. But even the very best and most expensive MicroSD cards got absolutely destroyed by even the cheapest solid state drives. This is because SSDs are so fast that they are limited by the speed of the Raspberry Pi’s USB 2.0 ports.

Solid state drives also have very large write caches. This lets your Raspberry Pi push data to the drive and start doing other things and let the drive itself figure out how to organize the data. Much of the throughput and other performance differences in the above chart are because of much better and faster read/write caching.

Which SSD to Buy?

The contenders for the RPI storage benchmarks
Several contenders for the RPI storage benchmarks

Since all models and types of solid state drives hit the Raspberry Pi’s USB 2.0 transfer speed limit you should buy the cheapest one that fits your needs!

If your Raspberry Pi is mostly stationary it’s easiest and cheapest to just use a normal 2.5″ SATA SSD with a USB adapter. Here’s my recommendation:

Kingston A400 SSD
Kingston A400 2.5″ SATA SSD

The Kingston A400 has been a great drive to use with the Pi for years. It’s reliable, widely available around the world, has low power requirements and performs very well. It’s also very affordable. This drive has been benchmarked over 1000 times at pibenchmarks.com and is the #1 most popular SSD among the Pi community!

Links: AliExpress*, Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

The Kingston A400 drive performs really well in the Raspberry Pi Storage Benchmarks. It’s a great drive and is cheaper than many mid-range MicroSD cards. Another popular choice is the Crucial BX500 which you can sometimes find in a very cheap 120GB version:

StarTech 2.5" SATA to USB 3.1 Adapter
StarTech 2.5″ SATA to USB 3.1 Adapter

The USB 3.1 variant of the StarTech 2.5″ SATA adapter works well with the Pi 4. The USB 3.0 variant doesn’t have firmware updates available and is not recommended.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

The 2.5″ SATA to USB adapter above allows us to connect a drive like this to our Pi using USB. There is no power adapter needed as 2.5″ SSDs using adapters are low power and are powered by the Pi through USB. Be careful with enclosures as they tend to take a bit more power (especially for NVMe, see “Power Requirements” section below).

Compact SSD Options

If you move your Pi around a lot or need something more compact there are a couple of options. These eliminate having any extra cables as they plug directly into the USB slot.

SanDisk Extreme Pro USB SSD
SanDisk Extreme Pro SSD

The SanDisk Extreme Pro USB SSD is a true solid state drive. This is different than a typical “flash drive” which uses extremely cheap memory and has very low random I/O performance/throughput compared to a real solid state drive. I’ve used both the USB 3.1 and USB 3.2 variants with the Pi successfully and they benchmark very well!

Links: AliExpress*, Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

There are some flash drives (a very small number) that are actually real solid state drives. The SanDisk Extreme Pro is the most popular one on Pi Benchmarks.

You have to be extremely careful when looking for these as 99.9% of flash drives are NOT solid states. The SanDisk Extreme Pro is a true solid state. The cheaper SanDisk Extreme and Extreme Gos are not (needs to be the pro). If you are looking at a USB style drive and they don’t explicitly state it’s a solid state drive then it definitely isn’t!

Other SSD Options

There are many other types of SSDs and storage adapters you can use. For example, there is an older type of drive technology called mini-SATA or mSATA that can be found in a lot of old laptops or bought for very very cheap. I wrote an article on mSATA to USB 3.0 storage adapters here covering these.

There are also extensive M.2 NVME to USB 3.0 and M.2 SATA to USB 3.0 options available as well. You can build a M.2 SATA or M.2 NVME SSD but you need to be careful with which type of M.2 drive you have/buy. They can be B-key, M-key, or M+B keyed. By far the most common and cheap ones are SATA with a B or B+M key. The adapter I have is this one.* For a full overview of different available options check out my Raspberry Pi 4 USB Mass Storage Device Booting Guide where collectively as a community we’ve compiled the best list we can of working and nonworking adapters.

Power Requirements

Most types of adapters can be powered by the Pi itself. One notable exception is NVMe enclosures. Throughout the years we have had hundreds of comments from people who had no trouble powering 2.5″ SATA enclosures but couldn’t get a NVMe one to work at all without a powered USB hub.

Very large older 3.5″ SATA drives are known to require more power than the Pi can provide as well as some types of very high performance models that were designed to burn more power to get extra performance gains.

For solid state storage older models of solid state drives (SSDs) are also known to draw more power than their newer counterparts. If you have a drive that you think may fall into this category then definitely be on the lookout for power related issues and extra cautious about your power setup. High end “extreme” performance models also tend to draw more power (Samsung 970 NVMe drives* are some of the fastest in the world but also pretty power hungry for the Pi).

Insufficient Power Symptoms

Symptoms of a lack of power to the drive can include the system only booting sometimes (or not at all) or working for a while and then locking up. Just because the drive boots does not mean it is getting enough power.

Some commenters on previous articles have described this as working fine until there was a sudden spike in CPU usage while they tried to do several things at once (high CPU, accessing storage, activating various hardware all at once) and then they would get a lockup/crash.

This is because the Pi is teetering on the edge of not having enough power and that spike caused it to drop enough where the drive actually lost power (likely only for tiny fractions of a second). This is enough instability to easily cause a crash and worse if it happened to be in the middle of writing something important! Usually nothing will happen other than you’ll have to restart the Pi but because of the risk of data loss and eventually corrupting files. That being said, if you’re particularly unlucky you will have to fsck the drive or potentially even reimage it if fsck is unable to repair the damage!

The best answer is to test for stability. Do this by stressing out the Pi and make sure you are doing activities that stress the CPU and storage at the same time like browsing the web, etc. and if you can do that for a few hours/days without a lockup/crash then you have a stable power setup!

Powered USB Hub Solution

For NVMe enclosures and power hungry drives I personally use this Sabrent powered USB hub and have been recommending it here on the blog for a long time:

Sabrent Powered USB Hub
Sabrent Powered USB 3.0 Hub

The Sabrent powered USB hub delivers a whopping 2.5A of dedicated power for your USB attached devices. This is almost as much as the Pi adapter itself is rated for (3.0A). It will easily power the most thirsty of setups such as NVMe enclosures.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.uk*, Amazon.es*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*

Note: Make sure Amazon doesn’t try to take you to the non-powered version and that it’s the one with the AC adapter that plugs in to provide extra power

If this hub isn’t an option for you and you don’t have one already you can try with it then look in the reviews for people saying that it is working with Raspberry Pi. Some powered USB hubs will not play nice with the Pi so before buying one definitely check reviews and do some careful research about what to expect with the Raspberry Pi!

Oversized Power Adapter Solution

This solution will work for setups that are right on the border of having enough and not having enough power. An example would be if you can get a stable boot but are getting occasional lockups/freezes when the power dips just below the threshold it needs.

If you are using a powerful NVMe drive/enclosure combo like the ICY BOX with a high performance Samsung NVMe drive even with the extra 500 mA it will still not even boot. I have had these oversized adapters and they are great but for a very powerful drive/adapter combination you are going to need more than 500 mA.

CanaKit 3.5A Adapter
CanaKit 3.5A Power Adapter

The CanaKit 3.5A adapter has an extra half an amp (500 mA) of capacity to give some breathing room to your accessories. This is bigger than the official Pi power supply which provides 3.0A.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.sg*

It’s a lot less extra wires and one less AC plug though if you are right on the border and just need a little bit more. It will depend on your individual drive/adapter combo whether it’s enough or you will have to go full powered USB hub!

In previous articles readers have told me that this specific adapter can be hard to find outside of North America. I tried to link to as many regions as I could find it in but there should be something equivalent in your region (it just likely won’t be specifically designed for the Pi but will be a more generic USB-C charger).

Look for a USB-C power supply rated to supply around 3.5A. 3.0A or lower won’t do much good as that is almost certainly what you already are using. You can use a higher one (at your own risk). The largest one I’ve ever used is my Dell laptop’s 30W USB-C power adapter. It’s probably not a good idea to go too much bigger than this or to even use one this big over the long term (I didn’t, just for occasional testing and as a emergency backup) but USB-C does have some specification improvements related to power management that seem to provide some flexibility here.

Power Limits

The Pi can only pass through a limited amount of extra power. On the Pi 4 this is up to 1.2A of extra power for peripherals (combined) on top of the board’s 3.0A power rating. This is much more than the Pi 2 and some other previous models could do which was only around 0.5A. This also means that getting a power adapter bigger than about 4.2A of rated current is pointless because the Pi won’t allow any more power to flow through to the board to the peripherals through USB anyway even if it’s available.

I’m oversimplifying a little bit to illustrate the point but if you want the full technical details they are available here in the Raspberry Pi USB documentation. The important takeaway is that going much above 3.5-4.0A or so will not actually provide any more power to the Pi because of these limits. If you’ve hit this ceiling and it still isn’t enough you need to go powered USB hub.

I’ve also used ones that charge cell phones to power Pis before and these ones are the most likely to fall into a range close to what the Pi uses. Most of the ones I had around the house for phones were 2.5A (just barely not enough) or 3.0A so it was enough for a backup spare but not enough to provide extra power. Nevertheless, it’s definitely worth it to check what you already have around and see if there are USB-C chargers around to test with!

Note that a powered USB hub essentially bypasses these limits because the power for your peripherals such as your USB storage will come from the AC adapter connection to the powered USB hub instead of the Pi having to provide that power.

Powered USB Hub Troubleshooting

Most hubs including the Sabrent one above can feed back power into the Pi which can cause it to not boot when the power is connected. The reason for this is that the Pi is detecting power and is trying to power on using that source but the current provided isn’t enough for the Pi to actually boot.

The solution to this is to remove the USB hub’s connection from your Pi momentarily and then connect the power. Plug your USB hub back in quickly after reconnecting the Pi’s power (if you have native USB booting set up) and unless you really fumble with reconnecting it you will have it plugged in well before it tries to boot from the SSD!

If this trick doesn’t work then unfortunately you may have a powered USB hub that is not going to work with the Pi. It’s worth checking to see if there are any firmware updates available for your USB hub before you give up on it as some readers have let me know in the comments of previous articles that they were able to get some hubs working after a firmware upgrade!

Benchmarking / Testing Storage

If you’re getting poor performance or just want to verify everything is working correctly you may want to run my storage benchmark with:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

If you search for the model of your drive on Pi Benchmarks you can compare your score with others and make sure the drive is performing correctly!

Create Bootable Drive

Creating your bootable drive is also very easy. You simply image it the same way you would image a blank MicroSD.

I use Win32DiskImager and simply select the USB attached drive just like you would with a MicroSD card and write the image. It’s very easy!

Don’t forget to place an empty “ssh” file in the /boot directory if you want to connect via SSH.

Prevent High CPU Usage

There is an issue where using a solid state drive will cause kworker to consume around 1-10% of your CPU all of the time. This is due to the Pi polling constantly for a Micro SD card to be inserted.

There are two ways to fix this. One is to insert a blank Micro SD card in the Micro SD slot and leave it there all the time. The other is to add a line to your /boot/config.txt. Open up config.txt and add the following:

dtparam=sd_poll_once

This option will tell the Pi to only check for a Micro SD card once at bootup. This means if you want to access the card it needs to be in the Pi before it boots up.

I also wrote a complete guide on this very issue that is available here: Fix ~% CPU Usage When SSD Booting with Raspberry Pi

SSD With Raspberry Pi 4

The Raspberry Pi 4 did not originally support USB booting at launch unlike the previous Pi 3 models did. This is because they actually added a physical EEPROM firmware storage chip into the board. Due to this I previously published a workaround for how to set up USB booting using a SD card as a bootloader.

Fortunately the native support has finally been released for USB booting on the Pi 4. I cover how to upgrade to the new firmware and enable native USB booting extensively in my new Raspberry Pi 4 USB Booting Guide (recommended).

If you aren’t sure which SSD / storage adapter to get I have an extensive guide available here: Raspberry Pi 4 / 400 Storage Adapter Guide

SSD With Raspberry Pi 3

Once you have chosen your SSD it is time to configure the Raspberry Pi to boot off USB storage. Fortunately this is extremely simple. To enable booting from USB storage simply boot up your Raspberry Pi and run this command:

echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

Alternatively you can put your MicroSD into your computer and open /boot/config.txt and add the line:

 program_usb_boot_mode=1

Now reboot your Pi and USB boot support will be permanently enabled. This only needs to be done once per Raspberry Pi as the change is permanent.

You may now remove the Micro SD card altogether and plug in your external storage you prepared in the previous section. Power up the Pi and it will boot directly from the USB storage!

SSD with Raspberry Pi 1 / 2 / Zero W

The older Pi family and the Zero / Zero W also support USB booting with a small catch. You still need to have a Micro SD card inserted in the Pi with only one file on (bootcode.bin). This is because these Pis use the older
BCM2835 which is a Micro SD only bootloader.

The good news is that if we put a otherwise blank Micro SD card in there with this file the Pi can boot from USB storage just fine and take full advantage of the increased speed and storage size. Bootcode.bin basically provides the instructions to the Pi telling it how to boot from USB.

First you will format your Micro SD card as FAT32 . FAT32 is the partition type that the Pi bootloader can read and is the same format as the /boot/ partition on a fully imaged Pi card.

Next grab the latest bootcode.bin from the official Raspberry Pi repository at bootcode.bin in official Raspberry Pi GitHub Repository

Copy the bootcode.bin file onto your newly created and otherwise blank FAT32 imaged Micro SD card and then insert the Micro SD card back into the Raspberry Pi.

Now connect your USB storage back to the Pi and power it on. The Pi will boot directly from your USB storage device!

Conclusion

A solid state drive is the biggest upgrade you can give your Pi. When I am configuring my Minecraft Raspberry Pi servers the performance difference is night and day. They boot faster, respond faster and write/read much faster. It’s very difficult to go back to MicroSD after using one of these with your Pi.

I highly recommend running the benchmark for yourself to get an idea of how much performance you can gain!

Other Resources

If you’re looking for a guide on setting up SSD booting with your Pi check out my Pi 4 Native USB Mass Storage Device Booting Guide

If you want to find out the best storage adapters and SSDs for the Pi check out the Best Storage Adapters for the Raspberry Pi 4 / 400

For fixing storage adapters / improving performance with firmware updates: Fixing Storage Adapters for Raspberry Pi with Firmware Updates

If you have one of the new Raspberry Pi 400 kits *then don’t miss my Pi 400 Overclocking and SSD Setup Guide

Subscribe
Notify of
guest

98 Comments
Inline Feedbacks
View all comments
MidnightDad
MidnightDad
3 years ago

Great article. I bought the Sandisk flash drive you mentioned and flashed it with Home Assistant OS. I modified my Raspberry Pi 3B (not plus) to boot from USB, removed the SD card, and plugged the Sandisk into a USB port, but my Pi won’t boot. I get one green flash, but nothing after that. Any ideas?

Andrew
Andrew
3 years ago

Hi! I’m using the “Raspberry Pi Imager” to copy Raspbian onto my SSD… It should have 120 GB but after copying the image over the size is 16 GB — I tried expanding the file system but it doesn’t have any effect. Any ideas?

Best regards,
Andrew

Andrew
Andrew
3 years ago

That’s what I did. I booted the Pi (headless), ssh’d on to it and ran sudo raspi-config to expand the file system. Here’s the output:

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): Disk /dev/mmcblk0: 14.9 GiB, 16021192704 bytes, 31291392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x04adee26

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 31291391 30758912 14.7G 83 Linux

Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-31291391, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-31291391, default 31291391):
Created a new partition 2 of type 'Linux' and of size 14.7 GiB.
Partition #2 contains a ext4 signature.

Command (m for help):
Disk /dev/mmcblk0: 14.9 GiB, 16021192704 bytes, 31291392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x04adee26

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 31291391 30758912 14.7G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

And here’s the output of “df -h” after rebooting:
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 1.3G 13G 9% /
devtmpfs 184M 0 184M 0% /dev
tmpfs 216M 0 216M 0% /dev/shm
tmpfs 216M 3.1M 213M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 216M 0 216M 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 47M 206M 19% /boot
tmpfs 44M 0 44M 0% /run/user/1000

…. it looks like there are only 16 BG, right?

Best regards,
Andrew

Andrew
Andrew
3 years ago

Hi!
Here’s the output from resize2fs /dev/mmcblk0p2:
resize2fs 1.44.5 (15-Dec-2018)
The filesystem is already 3822976 (4k) blocks long. Nothing to do!

fsck /dev/mmcblk0p1 yielded:
fsck from util-linux 2.33.1
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
Perform changes ? (y/n) y
/dev/mmcblk0p1: 355 files, 94645/516190 clusters

fsck /dev/mmcblk0p2 yielded:
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/mmcblk0p2 is mounted.
e2fsck: Cannot continue, aborting.

I’m using the rpi-imager and I’ve rewritten the standard Raspbian image to my 128GB SSD multiple times… I’m stumped.

Andrew
Andrew
3 years ago
Reply to  Andrew

SORRY! I take it all back. I still had an SD card plugged into the Pi :-/ … I feel silly now. I was sure that it was a brand new, ‘virgin’ Pi, but obviously, I did pop an SD card in there. Here’s the result of df -h:
Filesystem Size Used Avail Use% Mounted on
/dev/root 110G 3.0G 103G 3% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.5M 1.9G 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 253M 47M 206M 19% /boot
tmpfs 383M 0 383M 0% /run/user/1000

Sorry again.

David Mooney
David Mooney
3 years ago

I cannot get a Seagate Barracuda 1TB SSD to be recognised by the Pi 4
– I can for reference, get a generic 1tb mechanical drive to work however.
Any ideas?

Andrew
Andrew
3 years ago

Hi and thanks for the great article above.
I just wanted to share a bit of information.
The suggested tweak
dtoverlay=sdtweak,poll_once
didn’t work for my Pi4B, the green LED kept on blinking. What worked well is:
dtparam=sd_poll_once

Also, I am using Pinn OS to multiboot a number of different Linux distributions and even Android (!) from an M.2 SSD. Works like a charm!

Hunysucka
Hunysucka
3 years ago

Just want to say thanks. Your work is tremendously helpful and interesting. I have benefited greatly from it.

Jim "JR"
Jim "JR"
3 years ago

For those who want a very small and portable SSD option, Seagate has released a line of extremely small, USB-3 compatible, SSD external drives; the “Seagate One Touch SSD” and “Seagate Expansion SSD” in a 500 Gig and 1T version.

They are about the size of two flash-drives side-by-side; sufficiently small that the micro-USB-3 connector has to be on the side instead of the end, and they’re actually *SMALLER* than the Raspberry Pi itself! (The picture on the box for the One Touch SSD shows the external device being dwarfed by a pair of eyeglasses.)

As of October 15th or so, ElDorado (In Moscow Russia), had the 500G version for the equivalent of about $80 – $100 USD. The 1T version goes for the equivalent of about $120 USD. I have no idea what they go for elsewhere, (USA, other parts of Europe, etc.) I have tried to submit speed reports, but they keep dissapearing. I have rated them on the Pi-4 at sores around 7300 – 7500 using Jim Chamber’s benchmark.

YeetBoi
YeetBoi
4 years ago

my pi B+ with samsung 860 1tb ssd goes into overvoltage when my crontab tries to run a program. any solutions ?