joachimpr
Posts: 11
Joined: Mon Nov 10, 2014 9:32 am

Raspberry Pi sd card issues

Wed Feb 03, 2016 9:24 am

Hi all,

I hope this is the right thread.

I am currently working on a project that is so close to complete that I can smell it. The project is a Photobooth based on a Raspberry Pi with a pi camera. The software was developed in python.

However, during the making of this project we had great issues with sd cards going wonky and, I guess, becoming corrupted. Currently it is not strange just to cut the power to the raspberry pi which caused major issues as I have read all over the internet. We decided it would be a good idea to make the sd card read only and transfer all the writeable folder such as the home directory to an external 1TB disk. We did this expecting never to see the issue again, however, now after a while the sd card seems to be giving problems again not being entirely corrupted but sometimes failing to boot and freezing now and then.

I am not excluding the fact that in some instances the power could have been cut while the pi was in dev mode and the sd card mounted as rw.

A little about the set up:

I have a pi with a camera board attached and an external HDD connected via usb. Partitions have been created on the disk and the python application saves files to this hdd (photos and so on) and reads from the hdd as well. All the application code files are also on the hdd. We also have a webserver running on the pi and a mysql server hosting a mysql database as well as a cups server which sends jobs to the printer.

Because of the hdd, I moved all the directories to the disk like the home directory and made the sd card read only.

My questions are thus:

1. Is it enough to make the sd card read only to eliminate the cold power off issues. Ie, if the sd card is read only, will this be 100% preventative to the sd card from going corrupt when power is cut from the pi given the power is cut in read only mode?
2. Does this guide offer more protection against corruption and offer better stability than purely making the sd card read only? I could be wrong but It seems here that this guide allows you to boot from hdd? viewtopic.php?f=29&t=44177
3. Are there any proven specs, classes or brands on sd cards that prove to be the most reliable? I have read all over the internet and everyone suggests something different.
4. Should I consider a battery power circuit with power cut detection and auto shutdown? I would like to prevent this if possible as it will cost more money.

If it is 100% guaranteed that the sd card will not go corrupt due to power cut when the card is in read only mode, then that should be fine as I will be the only one that operates it with the sd card in rw mode. When it is in the field, it will always be read only and the agent will CUT the power. I can guarantee it. I just need to make sure that I shut it down correctly when in rw mode.

I thank you for any advice or comments as I am at my witts end with this and I really want to get this project out in the field but it seems that everywhere I turn, and as soon as I come close, something happens that prevents me from doing so. Im pulling my hair out and this is testing my patience.

Thanks
J

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Raspberry Pi sd card issues

Wed Feb 03, 2016 8:20 pm

Just "reading between the lines"... how are you making the SD card read only? The lock tab on the SD card does not work with the Pi, as it is not "wired up".

You need to mount the card read only. What does the output of "mount" show?

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Raspberry Pi sd card issues

Wed Feb 03, 2016 9:09 pm

Also, make sure that you have a stable and clean 5V reaching the Pi. Sub-par PSUs and/or spindly USB cables are frequently to blame.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: Raspberry Pi sd card issues

Wed Feb 03, 2016 9:28 pm

As your proposed setup already includes an hdd you should definitely move root there as per your linked forum post.

rln
Posts: 176
Joined: Wed Apr 09, 2014 1:43 pm
Location: Sweden
Contact: Website

Re: Raspberry Pi sd card issues

Wed Feb 03, 2016 9:39 pm

First of all, nothing is 100% when it comes to software... However, going one step beyond read only would be to never accessing the SD card at all. This is how my Nard SDK works. The OS run from a RAM disk, so the SD card is only used during bootup and then never touched again.
http://www.arbetsmyra.dyndns.org/nard/
Author of the robust Nard distro http://www.nard.se

joachimpr
Posts: 11
Joined: Mon Nov 10, 2014 9:32 am

Re: Raspberry Pi sd card issues

Thu Feb 04, 2016 3:52 am

Wow thanks for the great replieI think root is on the disk already but I will definately check that and I will be sure to check out Nard.

Is there any way that I can tes the supply on the other side of the cable? IOW where on the pi can i take a multimeter reading?

Thanks
J

Return to “Advanced users”