SSD on a Raspberry Pi

As a part of building out the Cloud in a Box, I wanted some storage for Docker images, as well as data.

Based upon my previous experience, I believed that a SSD would be faster than a Micro SD, but I hadn’t tested it as yet. The challenge from Dieter Reuter (@Quintus23M), asking how I’d hooked up the SSD as well as whether it was faster than the Micro SD was a good motivator. I did find a couple of surprises along the way.

At some point I am thinking about building a sata to USB converter supporting multiple drives — theJM20337 is an inexpensive chip and appears to be what the converter is using.

1

2

3

4

5

6

+----++-----++-----+

||||||

|Pi|<--->|Hub|<--->|SSD|

||||||

+----++-----++-----+

The Pi, even when plugged into a 2 Amp power supply, didn’t have enough juice to run the drive. Consequently I needed a powered hub. I think it’s quite possible that another, more expensive case/circuit might not need to have a powered USB hub.

Devices

Device

Mount Point

Type

Notes

/dev/mmcblk0

/

MicroSD

Class 10, 16GB in Pi Micro SD slot

/dev/sdb

/data

SSD

240GB Sata 3 SSD

/dev/sda

/opt2

Spinning Disk

2.5″ 5400 RPM, 160GB

Testing

In order to make as accurate a test as possible, the buffers and cache are dumped prior to every run:

1

2

echo3|sudo tee/proc/sys/vm/drop_caches

Additionally, the data is sync‘d in order to ensure that the reads/writes are finished and measured as a part of the time elapsed in the test.

It’s important to test SD cards via USB 3.0 to prevent bottlenecks, since USB 2.0 tops out around 33 MB/s

This is the approximate speed being seen for the SSD and Spinning Disk. Since the Micro SD is half the speed of the others, I’ve probably reached the limit of the card — approximately 1.6 times the minimum speed for reads and the spec for writes.

There are UHS cards which are faster, however. One of these should be able to match or exceed the performance of the SSD or spinning disk. For instance, the Samsung EVO Micro SDXC claims, depending on the version, speeds up to48MB/s or 90MB/s.

Interestingly enough, the hdparm tests for cached reads has all three roughly within range of each other. The buffered tests, however, are similar to the Sequential Read test in the reported rates.

On writes, the spinning disk is slightly slower than the SSD. However, the SSD pulls a bit ahead on reads — ~1 MB/sec for buffered and then ~20 MB/sec on the cached reads.

At the end of the day, the SSD and Spinning Disk are faster than the Micro SD — however, this might be due to the Micro SD card I’m using.

The Raspberry Pi 3 shares the same SMSC LAN9514 chip as its predecessor, the Raspberry Pi 2, adding 10/100 Ethernet connectivity and four USB channels to the board. As before, the SMSC chip connects to the SoC via a single USB channel, acting as a USB-to-Ethernet adaptor and USB hub.

The major differences for the Pi 3 are the wireless & bluetooth as well as the upgraded processor.