The Pi is fantastic for getting a taste of self-hosting / home automation as it's so cheap but by no means should it be relied on.
I moved our Home Assistant install to a docker container on basic PC and it's been rock solid after several SD cards were eaten by the Pi. Though I still have DNS (via PiHole) running on a Pi and that's starting to act up.
Only time I've found Pis reliable is when they either don't write much or are running a read-only disk most of the time. We've a network audio player using piCorePlayer[1] on a Pi running for years and never had an issue, it's running tiny core linux and only makes the disk r/w when you're upgrading or changing settings.
I'm tempted to move my MQTT server to a Pi using tiny core as that'd keep messaging up while I'm rebooting or doing some other task on my single server. Something like http://akeil.net/posts/mosquitto-mqtt-on-tinycore.html
Edit: - sorry, nevermind, I should have read the rest of the comments, there is a link below this comment (at time of writing)
Make sure you use the right adapter, I got an enclosure at first that wasn’t on the list, and it ended up not working. I switched to the recommended StarTech 2.5″ and everything worked.
The long-term solution for this (if you're up for it) is to PXE boot from your fileserver, so you don't need a SD card at all.
I have PiHole running myself, my original plan was to use a Pi but the last thing I wanted for that thing to die and my internet stop working. An easy enough fix, but a frustrating one.
Mine is also running on the my media server. Which... is fun. When I reboot it I have to start things VM's in a certain order or things get really unhappy.
I agree that a warning like that should be in place, I am surprised though that a new card worked for you. I have a drawer of Pi's that I never managed to salvage.
I've also got it doing DHCP so every device gets a <hostname>.<network>.uk domain, plus it handles some static records as well. Means it's not just a quick swapout, need to find and migrate the custom stuff I've done to it. Most of this should be in a git repo but unsure if all of it is.
The joys of overcomplicating home networking!
Jeff Geerling (who's active on HN) has actually gotten SATA working [2] through the Compute Module 4 and the Compute Module 4 IO Board [3].
If you go his route you could potentially set up a Pi with more durable storage. Although, if you watch Jeff's video its a PITA getting SATA working as he had to recompile the kernel with SATA support. Also its pretty hard to get the Compute Module 4 and the IO board at the moment.
[1]: https://www.raspberrypi.com/products/compute-module-4-io-boa...
My "server Pi" is >3yo old, only turns off when the power fails, and doesn't do a lot with its SD card but the OS, but has never had an issue.
What kind of power are you using? I've got these on little 2.5a wall warts; the "server" has a scrounged 20 year old PSU pulled from a Cisco 2500 router running it and some other stuff. No UPS tho and we get power outages and weirdness as usual for a rural area.
This can cause the Pi to shut down, and SD cards are not happy losing power while writing AFAIK.
I've had multiple Pi's run for years off the same SD card without issue. My Home Assistant install has a 3GB database with updates every few seconds due to some chatty Z-Wave modules. Been running just fine since 2018.
I also had a few with issues, and all of them were down to cables with too high resistance. Some were sold as charging cables, yet were rubbish.
I got a USB cable tester from AliExpress, alternatively buy some known good ones.
For SD cards, make sure they're class A1 or A2.
(if people were using a checksumming filesystem like ZFS, this of course would be immediately apparent when it was occurring!)
Samsung sells "high endurance" SD cards - I would strongly recommend these for RPi usage, and they are also very useful for dash cams since those are always continuously writing as well. Sandisk sells high-endurance cards as well but frankly Samsung is a cut above the rest of the SD card market - my SD card failures have essentially gone away since I stopped buying other brands. I think I have had one SD card failure since then and it wasn't related to write endurance, just didn't use it for a couple years and it was dead when I tried it again.
But yes, in general, power quality is a massive problem for RPis, and people don't really consider it because it's one of those "it works 99.9% of the time" situations. It's like a race condition that you only rarely ever hit, it looks correct and people will die on the hill of "it's worked perfectly fine for months now, the power can't be a problem" and then you hit a weak flash cell when the CPU is heavily loaded and the voltage is starting to droop and it happens to be a critical file rather than just some log or a chunk in an audiovisual file somewhere, and then you notice it.
I'd say >95% of all Pi failures come down to either power problems or SD card wearout. They're certainly not otherwise flawless, it's a janky cheapass SOC in general, but that is the overwhelming cause of Pi system failures.
If you can swing it, network booting from a fileserver is a much more reliable option in the long run. I haven't really experimented with it, and performance will probably be worse, but it gets the SD card out of the equation entirely, which mitigates both of these problems. You're not writing to flash, so brownout doesn't matter in terms of the potential for failed writes, and you aren't writing to a physical SD card so there's no wear.
vcgencmd get_throttled
You're looking for a 0x0 result (not now and never under-volted nor throttled). The result is a bitfield. A script to turn them into human-readable format is here but I just look at the bits: https://gist.github.com/aallan/0b03f5dcc65756dde6045c6e96c26...The broadcom chips they use are complete garbage. I was hopeful I could use the watchdog timer to make a pi more reliable (by restarting it when it inevitably crashed). Guess what? The internal watchdog timer doesn't f*cking work! You'll notice that every project using pi hardware that needs a WDT uses an external one.
Total junk! I don't use them for anything anymore, and I used to have like 6 automating various things.
I'm looking to get back into it with some Pi4s for a few things - but I'm planning to PXE boot this time around to try and sidestep the SD card/power problems. Basically just stuff like LibreElec to free up some of my J5005 NUCs for actual stuff.
One thing though - I don’t think any of my pi’s run x windows, I think they’re all console mode. I get the feeling that they do fewer writes in general this way, but I don’t really know. Anecdotally, I had a pi that ran x that I was experimenting with, and after a couple of months found it locked up/dead to the network. A reboot brought it back fine, but I unplugged it a few days after that and haven’t been using it.
When you have an image that you're happy with, back it up. Using a USB<->SD card reader on a linux machine, run gparted to slim the image down to the minimum, then run something like this
sudo dd if=/dev/sda of=my-pi-v1.img bs=1M count=7000 status=progress
Where `/dev/sda` is the sd card and `7000 `is the number of MB the pi disk takes after you gparted it down to the minimum size.Next, flash the image on a new disk and make sure it works with the pi.
> I can't get it to boot even off of a new sd card.
Best guess: power adapter problems. Either the power adapter itself is dead or it misbehaved, killing the Pi.
I would think if you want to take it up a step, you could look at something like an Intel NUC.
I have tried to do this multiple times, with multiple models of Pi and every time after 6ish months it just seems to completely stop working. I can't get it to boot even off of a new sd card.
Am I doing something wrong or does the hardware really not want to be run consistently in this manner?
I have since decided to just run some home automation VM's on my media server which has worked flawlessly (minus networking being weird sometimes).