AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Hardening SD card against power failure?

Wed Apr 12, 2017 7:59 pm

Hi, not sure if this is the right area in the forum to post so please let me know if you think there is a better place I should be asking.

I've been playing with raspberry pi for the past couple of years and over the years i've lost a couple of sd cards due to what I think has been by pulling the power. A couple of cards that wouldn't boot as has become corupted and a couple that have become read only, and i was wondering if there was a way to make it a bit more resiliant?

I have an application in mind where i want to use the raspberry pi with a screen with the browser set up in kiosk mode where i am not confident that i will be able to control how they are switched on and off, in practice they are going to be just switched on and off as and when needed (i.e. switched on at begining of the day and switched off at the end of the day). The raspberry pi will be absolutly brilliant at this, but i am a little bit concerned about the SD cards becoming corupt.

Any thoughts suggestions of anyone that has been able to solve this? I was wondering if the issue is about whether the power gets cut whilst the card is being written or read to? and was wondering if i can load enough up into the ram and so the SD card is only used during the boot up time. As mentioned all its going to be doing is running a browser accessing a simple web site in kiosk mode so not sure if this is possible and would solve or at least limit the problem?

Many thanks

Alex

User avatar
mikronauts
Posts: 2732
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Hardening SD card against power failure?

Wed Apr 12, 2017 8:12 pm

- get one of the many UPS hats
- have a background daemon "shutdown now -h" when it detects power loss
AforAlex wrote:Hi, not sure if this is the right area in the forum to post so please let me know if you think there is a better place I should be asking.

I've been playing with raspberry pi for the past couple of years and over the years i've lost a couple of sd cards due to what I think has been by pulling the power. A couple of cards that wouldn't boot as has become corupted and a couple that have become read only, and i was wondering if there was a way to make it a bit more resiliant?

I have an application in mind where i want to use the raspberry pi with a screen with the browser set up in kiosk mode where i am not confident that i will be able to control how they are switched on and off, in practice they are going to be just switched on and off as and when needed (i.e. switched on at begining of the day and switched off at the end of the day). The raspberry pi will be absolutly brilliant at this, but i am a little bit concerned about the SD cards becoming corupt.

Any thoughts suggestions of anyone that has been able to solve this? I was wondering if the issue is about whether the power gets cut whilst the card is being written or read to? and was wondering if i can load enough up into the ram and so the SD card is only used during the boot up time. As mentioned all its going to be doing is running a browser accessing a simple web site in kiosk mode so not sure if this is possible and would solve or at least limit the problem?

Many thanks

Alex
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Re: Hardening SD card against power failure?

Wed Apr 12, 2017 8:53 pm

Many thanks for the advice, i shall have a look at see whats out there.

I don't suppose you have any experience with one that you have used and works well and also cheap? (No worries if not, don't expect this forum to be WHICH, but thought it worth asking in case you do have experience)

Thanks again

Alex

User avatar
mikronauts
Posts: 2732
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Hardening SD card against power failure?

Thu Apr 13, 2017 12:03 am

You are most welcome.

Sorry, no experience with those HAT's.

Some USB powerbanks also allow powering devices while being charged, but they may reboot the Pi on power loss / power return - you will have to test the ones that are available to you.
AforAlex wrote:Many thanks for the advice, i shall have a look at see whats out there.

I don't suppose you have any experience with one that you have used and works well and also cheap? (No worries if not, don't expect this forum to be WHICH, but thought it worth asking in case you do have experience)

Thanks again

Alex
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “Troubleshooting”