Best alternative for Raspberry sd card storage

Tags: #<Tag:0x00007faee531b578> #<Tag:0x00007faee531b258>

The stick is working now. I don’t know exactly what the problem was last time. I flashed the rpi image again to the ssd drive and booted with an sdcard with the bootcode.bin and timeout file as described here:

But now the rpi also boots without any sd card directly from the usb ssd.

I think I found out what solved the problem. It seams there was a firmware version difference between my PI’s. I did a firmware update as described here and now it works on both PI’s.

I got one yesterday. It was much easier than I thought to swap over to the SSD and remove the SD card entirely.
It was the smoothest upgrade/reinstall I have done.

Let’s see how long it lasts now!

Strange thing happen to me. I’m running my productive OH2 RPi2 at home since August 2016 now with the same SD Card. There’s no persistence on it - but all the logging (raspbian logging and OH2 logging) on the same SD Card since the beginning with no signs of a wear out yet (knock on wood). -> And I have constant logging from my >600 items in events.log. I’m flat out too lazy to change this. (the RPi3 is already here and functions as the Testing environment…).

But on my second OH2 RPi2 at my mountain cottage I’m running smoothely with an external SSD (cheap USB-housing and a old 64GB IBM/Lenovo SSD) without problems. As it’s also an RPi2 it’ll still boot from the SD, but /root and all other stuff is running on the USB-SSD.

I don’t have data/experience on USB-Sticks, but I guess as they’re using the same technique, they’ll also wear out like SDCards.

I also had sd card porble. For no I moved my setup to usb stick. If it will fail again in one year I will probably buy a ssd. But there is something I don’t understand about failing sd cards … The flash chips has at least 10000 write cycles, so for 16GB class 10 sd card (I had such card - Toshiba exceria) it would take half a year of full speed writing to the card to exceed the limit. And Openhabian does not write at full speed all the time … either those sd cards are very very poor at wear leveling or there must be something other that makes those sd cards fail.

btw: If you’re using openHABian, there’s an option to move /root on the USB-device within sudo openhabian-config:

By “not that long” I mean one to two years for a good quality SD card that is overprovisioned. For example, a high-quality SD card from a respected company that is 16G or 32G would last much much longer than a knockoff SD card that is 4G or 8G.

The wear happens on writes. There are only so many writes that each bit in the memory can perform. But the card does spread the writes across all the bits as evenly as possible so specific parts don’t wear out early while other parts remain never written to. So by over-provisioning the SD card you give it much more room to write to before it has to loop back around and write to the same bit again, giving you more time before the SD card wears out.

USB flash drives use the same technology, though again, the higher quality ones will probably last longer than the ultra cheap ones.

To me the big thing about Flash storage that makes it risky to use is not how long it lasts, it is that it fails silently. By the time you start to notice symptoms of a failing SD card or USB drive you have no idea how long it has been failing and therefore don’t really know how reliable your backups are or how far back you have to go to get to a guaranteed uncorrupted image.

So first of all the SD card doesn’t move files around to write level. Files that remain static (e.g. OS files) get written once and those bits get taken out of the calculation for wear leveling. So the 10000 writes would only apply to the amount of the storage that is left over.

Also, not all cards are all that smart about how they implement the wear leveling which can further cause some areas of memory to be written to more frequently and therefore wear out more quickly.

If you have a swap partition, that also needs to be taken into consideration for writes.

I do not know what it means when Toshiba says it supports 10000 write cycles. They can easily claim that number without any wear leveling at all which will kill the SD card super fast, or use a poor write leveling algorithm which will extend the life a little bit, or have a really good one and extend the life of the card a lot. Without better information about how/whether they wear level the number is all but meaningless.

Finally, one area of concern that can be falsely identified as a failing SD card is file system corruptions. When the RPi loses power without shutting down it is very easy for it to end up with a corrupted file system which can look a lot like a failing SD card.

1 Like

That’s one thing, you really have to keep in mind, especially with RPi3. They are power-hungry - and if you use an old power adapter (like I did), the Pi will fail (my MagicMirror Pi did this on me and I thought at first of a defective SD). So, be aware to always have it on a enough powersource!

Yeas, so I should substract the ammount of used space from 16GB. But still I think it should last longer :slight_smile: I have suspicion that even if I use 64GB sd card it will not make sd card live longer - and don’t want to spend money to check that :smiley:

IS this device usable as an alternative?

Transcend 64GB SATA III 6Gb/s SSD370S 2.5” SSD TS64GSSD370S

This is a SATA III interface SSD. It’ll work, if you put it in a SATA->USB housing like this one:
be sure, your Pi is powered by a 2.5A power source!

Can anybody tell me, if I need to format the ssd before i can use it. I also read something about partitioning…

I have a ssd in a case out of the box and want to migrate my openhab to it…

Can anybody help me?

I have been using cheap Chinese 16gb SSD as boot drives for my Pis for a while now and they all worked straight out of the box. Just flash them with raspian, Openhabian or your image of choice with something like etcher and plug them in your Pi (3B+) with a sata to usb adapter and your good to go.

Thank you!

I bought this case: Inateck Festplattengehäuse 2 5 Zoll USB 3.0, Externes HDD Gehäuse für 7 mm/ 9,5 mm 2,5" SATA HDD und SSD, Unterstützt UASP, Werkzeuglos (FE2013)
And this ssd: Intenso High Performance interne SSD 120GB (6,3 cm (2,5 Zoll), SATA III, 520 MB/Sekunden) schwarz

Do i still need a sd card in the raspi?
I have an openhabianpi running on a sd on a Raspberry pi. My feeling is, the sd is failing slowly. It is running since 1.5 years almost.

I could set up the ssd with another pi i got here, but i do not want to buy another sd card.

It is a clean new setup on a new pi and ssd vs my old pi and the maybe corrupted sd migrating by a backup to the ssd.

Can you theoretically set up all devices (hue, mqtt, xiaomi, zwave) on a second openhabian system parallely? Or are they, when they got paired with my first setup only usable with this one? I could then setup the clean pi with ssd from scratch with having my old system running temporarily till its all setup again.

Whats your advice?

Depends on which RPi you are running on. If it’s an RPi 3 then no, it can boot straight from the external drive. If it’s any other version of the RPi then no, you still need the SD card to boot.

It depends on the technology. MQTT is not problem. Hue with a Hue Hub is probably no problem. But zwave devices are paired with the physical Zwave controller and that can only be used on one machine at a time.

I got a raspberry pi 3 b i think. Actually i have two. One with my current openhab instance on sd and the new one will be on ssd. I just flashed the ssd with etcher.

So i will plug it in the pi now and it will do its magic? How do i boot from the usb drive?

My fear is, that once its all up, that it conflicts with my current openhab instance openhabianpi:8080 is used to access my current one, how can I cange that with the new pi? Iniatially it will have the same port i guess… am I right?

the ssd does not power up on the new pi. It lights up on the old one though…
do i maybe have to do an installation via an sd card first on the new pi and then activate the ssd? I am confused.

Hmm, on a pi 3b+ I didn’t use an SD card at all. I burned the image with edger plugged the ssd into the pi and it booted after a second or two. I would only plug in the ssd for booting as I had problems when some other usb accessories were plugged in. Which Pi version do you have?

Just had a read again here:
The booting from ssd straight out of the box only works for the newer plus models. If your Pi is the original 3 it’s still possible but you need to follow their instructions over there to prepare the pi for usb booting.

Hi Johannes,

thanks for the manual. Here is what i did so far. Openhabian is not up and running yet by the way.

I copied noobs on a sd card, put it in my pi 3b and followed the instructions for instaling rasbpian on the sd card. I did that, and then i followed the instructions to get it booted by the ssd (where i have the openhabian image on). I shut the pi down, took the sd card out, and powered off and on the pi. Then i kept pressing th power button on my ssd (i think that i have to do that sucks, should have picked an aways on case), and the ssd now lights up. So I hope now, that i made it boot from the ssd since its now powered up what wasnt working before. I will wait now a couple hours (?) if openhabian does the magic. We will see in the morning…

Not directly an answer to your question, but what worked for me as an economical solution to avoid the use of micro sd cards is using a tinkerboard s with on-board emcc memory. I run openhabian on top of armbian and my openhab system benifits a lot from the larger memory and the faster processor. Board fits in the same raspberry 3 housing and my crashes due to low memory are history.

1 Like