Required Information
- DietPi version |
10.0
- Architecture |
aarch64
- SBC model |
Raspberry Pi Zero 2 W
- Power supply used | Ugreen USB Charger 17W
- SD card used | Netac 32GB A1 uSD
Hi All, I’m trying to use my Raspberry Pi Zero 2 W as a Pihole server but after some weeks (2-3 weeks in general) the OS gets corrupted and I need to format the SD card with a fresh install of DietPi.
Initially I would leave the RPi running all the time without reboot but that resulted in corruption faster then with a daily reboot.
What I tried to do to prevent this from happening is to do a daily reboot with fsck check running at the start (enabled it tune2fs) to check for possible corruption but it wasn’t able to recover.
I’m trying to understand whether my SD card is just too cheap to be used for OS workloads and I should by for a new one, or if it is damaged and should be replaced or something else is the culprit.
I doubt the charger since it has plenty of room for powering a RPi Zero 2 W (or maybe I’m wrong?).
Now I’m wondering if I should try make the rootfs R/O but I’m not sure it can prevent corruption if the SD is that bad.
Thanks to anybody that can help clarify my doubts.
This usually leads to other problems, as services then no longer start properly. That would certainly not be a solution.
If I were you, I would try a high-quality SD card. Cheap or old SD cards can cause this kind of error.
I’ve found some guides on how to do it but if the problem comes from the reliability of the SD card it won’t make much of a difference I suppose.
I’ll try with a better sd card.
Thank you
Moving the rootfs (/ partition) to external USB…they are usually alot more resilient than SD cards…I do believe dietpi has that built in to be able to boot from SD and run the OS from external USB/NVME drive
I’ll consider it if a better SD card doesn’t solve it. I would prefere a more compact solution. Thanks anyway 
The RPI Zero 2 W supports USB mass storage boot out of the box. Means you can boot of a USB drive without a SD card needed https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-3b-zero-2-w
At least on Raspberry Pi, there is a eMMC module available that can be used via SD card slot
Here is your solution:
and:
I just found this on AliExpress:
EMMC to TF Card Module BGA153 BGA169 to for Micro SD Card MMC Card USB 3.0 Card Reader HS400 Is Required PCB Module
I use the RasPiKey on some of my RPI. keep in mind they are working in RPi only.
Is F2FS really better in this aspect? All mmc-based block devices have mandatory wear leveling, which is done unbeknownst to the operating system (as far as I understand). And F2FS has benchmark scores consistently worse than Linux alternatives. F2FS seems to be a relic from an era when flash memory devices did not have proper standards, and the fact that it’s still presented as such is beyond me. I’d stick to ext4 or maybe xfs, and leave the rest to the memory card. And yes, get a high endurance one.
Read again post, i send solution for you. And don’t forget to disable swap file. Things have been working for me for over three years (I had the same problem as you at the time) success.