|
Post by rogers1313 on Jan 11, 2019 12:37:16 GMT -8
I am working through all the issues I am finding as I do this project. And yes I am having fun working through them.
I am experiencing a high rate of SD card corruption while trying to configure the Grover Weather PI system. My understanding is the not all SD cards are created equal. One site I went suggested using SanDisk Extreme microBSD cards. These cards use "wear leveling" which sounds like they will not continuously write in the same location of the card each time.
There is always the military SD or industrial level card, but they cost 100's of dollars. I think that is out.
First question: What is the best card to purchase with the lowest cost in mind?
There are some sites out there that offer ideas on what can be changed in the Raspberry operating systems configuration files.
Second question: Can you help me with a list of suggested configuration changes that will help the reliability of the storage device?
My goal is to have the most reliable system possible before I deploy this to the outside world.
Thanks again, Roger
|
|
|
Post by SDL on Jan 13, 2019 11:33:37 GMT -8
|
|
|
Post by rogers1313 on Jan 13, 2019 13:40:26 GMT -8
Thanks for that input. The Ultra and the extreme by Sandisk must both be using wear leveling. It is very hard to verify that spec from the vendors for some reason.
|
|
|
Post by lbendlin on Jan 16, 2019 10:18:33 GMT -8
I would recommend Class 10 cards, if only for the better writing speed.
I have about a dozen Raspberry Pis doing all kinds of different things. On each of them I have a script that runs weekly (each Pi at a different day and time) and that dumps the entire SD card image onto a NAS. So in the (rare) case of a SD card corruption all I need to do is reflash that saved image (to a new card if I want) and the affected Pi is back in business in no time, with little to no data loss.
Here is the script I use (which also includes a connectivity check to make sure I can reach the NAS, a backup of the crontab, and a rsync script for just the /home/pi folder)
#!/bin/bash
sudo mount -a
sudo mount -a
if [ -f /home/pi/nas/backup/ok ]; then
bash -c "crontab -l > /home/pi/nas/backup/$HOSTNAME/crontab"
bash -c "rsync -rv --exclude='nas' /home/pi/* /home/pi/nas/backup/$HOSTNAME"
if [ "$1" == full ]; then
sudo bash -c "dd if=/dev/mmcblk0 bs=1M of=/home/pi/nas/backup/$HOSTNAME.img"
sudo reboot
fi
fi
|
|
|
Post by rogers1313 on Jan 16, 2019 12:48:08 GMT -8
That script would be helpful. The other thing that I am reading is that log files maybe written to the same spot on the SD Card. Eventually, the SD card wears out and then may result in a unrecoverable system crash. Is there a good solution to help prevent or lessen the impact of this problem? Your script above is great for rolling back if necessary. I was also trying to come up with some prevention ideas too.
|
|
|
Post by lbendlin on Jan 16, 2019 16:17:01 GMT -8
you can set log file paths to point to /dev/shm (RAM, basically) if you don't expect to need them.
|
|