Booting a Pi 400 from an SSD is an easy upgrade from the standard SD card. It can give your Pi additional storage capacity, improved reliability as well as massively increased read/write performance. With the price of SSDs dropping to pocket-money prices you can perform this upgrade for less than $40 (£30).
I have been running my Pi 400 from a SanDisk Ultra 128GB Class 10 A1 microSD card. That had been working fine but I decided to give an SSD a try to see how easy it would be. The short answer is that is really easy and only took me 5-10 minutes to swap from the SD card to the new SSD. It resulted in an approximate x10 increase in drive performance.
The Pi 3 and Pi 4 can boot from USB devices and this includes an SSD plugged in via an adapter cable. For my upgrade I purchased a Crucial BX500 240GB SSD (SATA interface) and a SATA-USB adapter cable. The drive cost $34 (£25) and the cable cost $6 (£4.50) including postage. This worked out as the same price as buying a decent 256GB SD card.
There are a lot of different SDD models out there to choose from but there isn’t much point buying a premium model for general tasks. The BX500 isn’t the best drive out there but is fine for using with the Pi.
To start with my Pi 400 was running fine with the SanDisk card loaded with a recent Raspberry Pi OS image. I updated it using:
sudo apt update sudo apt upgrade
Then I checked the firmware was up to date and would support booting from an SSD:
This gave me the output:
BCM2711 detected VL805 firmware in bootloader EEPROM BOOTLOADER: up-to-date CURRENT: Thu 3 Sep 12:11:43 UTC 2020 (1599135103) LATEST: Thu 3 Sep 12:11:43 UTC 2020 (1599135103) FW DIR: /lib/firmware/raspberrypi/bootloader/critical VL805: up-to-date CURRENT: 000138a1 LATEST: 000138a1
The important bits to note are the two “up-to-date” messages and the CURRENT/LATEST numbers both matching.
Benchmark Pi 400 SD Card Performance
To ensure I could easily compare the performance before and after the upgrade I ran the “Raspberry Pi Diagnostics utility”. This is available from the main menu under “Accessories”. Simply click “Run Tests” and wait for it to finish. Then clicking “Show Logs” will give you the technical information.
Here is the log using my SanDisk card:
Raspberry Pi Diagnostics - version 0.6 Tue Dec 22 16:16:51 2020 Test : SD Card Speed Test Run 1 prepare-file;0;0;29231;57 seq-write;0;0;26099;50 rand-4k-write;0;0;3143;785 rand-4k-read;9647;2411;0;0 Sequential write speed 26099 KB/sec (target 10000) - PASS Random write speed 785 IOPS (target 500) - PASS Random read speed 2411 IOPS (target 1500) - PASS Test PASS
These are good results and are to be expected given the SanDisk’s Class 10 rating. More information about SD card speed ratings is available from the SD Association’s site.
Copy SD Card to SSD
The SSD was plugged into the Pi 400 using one of the USB 3.0 ports (the ones with the blue plastic) using the adapter cable.
Using the menu I ran the “SD Card Copier” utility under “Accessories”.
Then selected my SD card under “Copy From Device” and my SSD under “Copy To Device”.
In my case “SC128” was the 128GB SanDisk card. The Crucial 240GB SSD was the “CT240BX5 00SSD1”.
WARNING: Make sure you copy the SD Card to the new SSD!
When I was ready I clicked “Start”. The process took a few minutes and when finished it stated the copy had finished.
Using the menu I told the Pi to shutdown. Once shutdown I removed the power cable and removed the SD card.
Boot From SSD
This was the moment of truth. With the SD card removed and the SSD plugged into a USB-3.0 port I inserted the power cable.
The lights on the SATA-USB adapter blinked and the Pi 400 booted to the Raspberry Pi OS desktop.
Benchmark Pi 400 SSD
With the system now running from the SSD I re-ran the diagnostics utility to get some numbers:
Raspberry Pi Diagnostics - version 0.6
Tue Dec 22 16:21:45 2020
Test : SD Card Speed Test
Sequential write speed 306242 KB/sec (target 10000) - PASS
Random write speed 15968 IOPS (target 500) - PASS
Random read speed 15326 IOPS (target 1500) - PASS
The sequential write speed had increased from 26MB/s to 306MB/s. The Random write speed increased from 785 to 15968. The Random read speed increased from 2411 to 15326.
There is a lot of debate when it comes to measuring performance of flash memory devices. For my purposes this simple approach is good enough and counts as a massive improvement over the SD card.
Check for UASP Compatibility
USB Attached SCSI Protocol (UASP) is a technology used by SSDs to improve read/write performance and lower CPU utilisation. Most new drives and adapters will support it. To check if my drive was using UASP I ran the following command:
This gave me the output:
The important bit is “Class=Mass Storage, Driver=uas”. This shows that my drive is using UASP.
Check Pi 400 SSD Partitions Using GParted
To double-check what partitions I now had on the new SSD I installed GParted:
sudo apt install gparted
Once installed I ran it from the command line using:
which gave me something like this:
This shows the 250MB FAT32 “boot” partition and an EXT4 ~240GB partition. At this point I realised I didn’t need to resize anything to take advantage of the extra space.
SSD Size 128GB or 256GB?
I really don’t need 100GB+ of space on my Pi 400 so why did I choose a 240GB over a 128GB device? There were two reasons:
- The price difference was only a few pounds so I figured in a few years I would rather be left with a larger drive for possible use in other projects.
- Flash memory devices wear out over time. The larger the device the lower the wear on that device for a given volume of data transfer. So better to have the larger drive even if you don’t need that capacity. For the BX500 the 240GB device has an endurance of 80TB. That’s the equivalent of writing 40GB per day for 5 years. Plenty for me!
Power and Enclosures
My SSD runs fine using an Official USB-C power supply. If your SSD is more power hungry or your power supply isn’t suitable you may need an external power source for the SSD. This is one reason I’m happy with the Crucial BX500 as it is a nice neat solution that doesn’t require an enclosure or additional power.
SSD Upgrade on a Pi 3 or Pi 4
This approach to upgrading from an SD Cad to SSD should work for the Pi 3 and Pi 4. Just make sure you are using a recent Raspberry Pi OS image.
A Note on TRIM Support
TRIM is another mechanism that SSDs can used to improve performance. It is explained in more details on the Crucial site. Enabling it is a long drawn-out process and I’m not going to cover it here. If you do want to enable TRIM on your Pi then checkout Jeff Geerling’s “Enabling TRIM on an external SSD on a Raspberry Pi” article. For my purposes I am going to ignore TRIM and leave my SSD running as it is.
Buy an SDD and Adapter Cable
Here are some links to the items I used:
Some of the product links on this page are affiliate links. I receive a small commission based on purchases made via these links. The price you pay is the same.