Raspberry pi, endless issues of corrupted data, any advice?
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Raspberry pi, endless issues of corrupted data, any advice?
Hello. I use a raspberry pi as a small server on my home network.
I primarily use it for testing out socket based client/server programming ideas. Along with its use for running weechat under tmux (acts as a 24/7 irc bouncer), and i also run nginx/php/mariadb for some hobbyist web development.
Now, this all works once i set it up, regardless of whether i've decided to run slackware, freebsd, or any other *nix type OS on the device.
My problem is, that once in a while, i experience a power surge or even a power cut at home which forces the device to lose power. I haven't had a raspberry pi computer running form more than 6 months because of this. Other times, the device might become unresponsive for whatever reason, meaning i have to pull the plug to reboot it.
Each time this happens, the entire raspberry pi installation becomes corrupt beyond repair, and means having to start over from scratch again at setting it all up. This becomes very tedious due to the slow speeds at disk writes, and hell for compiling anything.
Why is this such a problem? Is this because of the microsd disk? Why does it seem so fragile, that the device becomes completely corrupted so easily?
What power cable/transformer/amps are you using? I solved my undervolting problem by splicing two usb cables together. This also allowed me to switch from AC to a DC battery pack without rebooting.
Perhaps you could fix up a battery pack that kicks on when the amps get to low?
It's the SDcard. I run my pi's behind a small UPS, but you're better off using the SD as little as possible. Get the system onto USB if you can - they'll even boot from USB these dayss, but I haven't bothered.
What power cable/transformer/amps are you using? I solved my undervolting problem by splicing two usb cables together. This also allowed me to switch from AC to a DC battery pack without rebooting.
Perhaps you could fix up a battery pack that kicks on when the amps get to low?
Using whatever charger comes with the official raspberry pi, that's not the problem however. I mean power issues as in, random power cuts to the entire street, during a storm for example. As soon as the power goes, the pi basically corrupts everything. But it's not like this for any other storage device i have (NAS, desktop, etc).
I guess i will try setting it up next time onto a usb stick as syg00 suggested.
If you setup the Pi power supply with a UPS then any power problems should be handled by that device. I have UPS on most of my systems and never have lag or brownouts causing issues. Even when the power goes completely then you have the duration for the life of the UPS batteries to shut the Pi down safely.
SDcards are crap fragile - even behind a UPS they fail too regularly. If you allow things like the systemd journal on them they break. I had a class10 DOA so I couldn't even boot the thing - I keep an image of my pi3 on another system so I can reload it any time. Yesterdays tech IMHO.
Last edited by syg00; 03-15-2018 at 06:49 PM.
Reason: strike
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,491
Rep:
Yep, there has been a lot of trouble using microSD cards as the sole system. Suggest you boot a USB disk if you are using a 3B, else only use the microSD card to boot a system on an external device.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.