Hello, it’s me again. I read a lot about how unreliable micro SD cards are if you use your RPi to selfhost some stuff. Now I wanted to ask if some of you might have recommendations for cheap but reliable external SSDs. I did some research on Amazon but there are some brands I never heard before (Intenso, SSK, Netac, etc.) and don’t know if they can be trusted.
Which Raspberry Pi do you have? There are some very reasonably priced M2 hats out there that you can boot from on the Pi 5, including the Raspberry Pi branded one.
But an M.2 is usually more expensive than a normal 2.5" SSD. Is it better to boot from a M.2 HAT than from USB?
M.2 would technically be the best performance available, but realistically I don’t think you’d notice the difference over a USB SSD. Maybe a few extra seconds on boot.
Okay and what about longevity of the drives? That should just depend on the number of writes, right?
I’m not sure what kind of money you want to spend? The M2 Hat is ~$14 USD and a 2242 NVME SSD can be had for ~$30-$40 USD since you don’t care as much about performance.
The USB to SATA adapter is going to run ~$10 USD and the SATA SSD drives are going to start ~$20 USD are go up from there depending on size, performance, etc.
If size of storage is an issue, the SATA SSD is probably the better route. I believe the NVME would be better performance since it utilizes the bus on the Pi more fully.
I would guess that for the money, most M2 drives and SATA SSD drives are going to be similar lifespans
Look for log2ram on a LLM.
Could you elaborate?
Log2ram is a service which keeps your log files in RAM, avoids the constant writes to disk and really helps with SDcard longevity. Probably helps with SSDs too.
You can just Google it and check out the github page, no need for LLM accuracy lottery
Thank you very much, this helped way more than the other comment!
what it’s log2ram
Log2Ram is a utility designed to extend the lifespan of storage devices, particularly SD cards in Raspberry Pi systems, by reducing write operations[1][4]. Here’s an overview:
How it works
Log2Ram redirects log files from being written directly to storage (/var/log) to being written to RAM instead[1]. It creates a mount point in RAM for /var/log, so all logs are written to temporary memory (tmpfs) rather than the physical disk[2].
Benefits
-
Extended storage life: By reducing write operations to SD cards or SSDs, Log2Ram helps prolong their lifespan[1][4].
-
Improved performance: Writing to RAM is faster than writing to disk, enhancing system responsiveness[4].
-
Transparency: Applications continue to write logs to /var/log as usual, unaware that it’s now in RAM[1].
Key features
- Configurable RAM allocation for logs (default 40M)[2]
- Daily synchronization of RAM logs to disk via a cron job[1]
- Synchronization on system shutdown to preserve logs[1]
- Optional use of rsync for synchronization[2]
- Compatibility with zram for space-efficient log storage[3]
While Log2Ram offers significant benefits, it’s important to note that logs may be lost in case of unexpected power loss or system crashes before synchronization occurs[3].
Citations: [1] How log2ram works. | The World’s Linux Journal https://linuxfun.org/en/2021/01/01/what-log2ram-does-en/ [2] Log2Ram https://nimno.net/dev/linux/log2ram/ [3] Extend The Lifespan of Your Raspberry Pi’s SD Card with log2ram https://ikarus.sg/extend-sd-card-lifespan-with-log2ram/ [4] Optimizing Performance with Raspberry Pi Log2Ram https://fleetstack.io/blog/raspberry-pi-log2ram-guide [5] Using Log2RAM on the Raspberry Pi - Pi My Life Up https://pimylifeup.com/raspberry-pi-log2ram/ [6] How To Write Log Files In RAM Using Log2ram In Linux - OSTechNix https://ostechnix.com/how-to-write-log-files-in-ram-using-log2ram-in-linux/ [7] Extend your Pi’s SD Card Life with Log2Ram! - YouTube https://www.youtube.com/watch?v=MrRGa7kAhQo [8] How to extend the lifespan of memory cards on the Raspberry Pi with Log2Ram https://www.geekbitzone.com/posts/2020/log2ram/log2ram-raspberry-pi/
-
I’m using a couple of cheap Kingston A400 for my setup (120 and 480 GB) and they work just fine. One thing I noticed is that the 120 GB one’s health went down to 92%, from 100%, in “just” one year (smart parameter). But that’s implies a lifetime of more that 12 years, so I’m not excessively concerned.
EDIT: of course, just after writing this comment the smaller SSD began to behave strangely (errors in dmesg).
Are you using SATA to USB adapters? If yes, which one work well?
You can go with something like this if you want a clean solution.
I use a drive dock station for my backup drives, and I have a few of these for one-offs too.
Yeah, I use something like this, a no-brand enclosure.
I have a couple of no-brand SATA-USB enclosers with some jmicron chipset. Can’t remember the exact chipset right now, as my RPi is not working ATM (see edit).
Is there a one-line command to check my SSD? I have a headless setup. When I’ve tried on the past there was more results coming back than I knew what to do with.
sudo smartctl -a /dev/sdX should do the job
Thank you, that worked!
YW 😄