Sporadic SD rootfs corruption on reboots (no overclocking)


7 posts
by HenryG » Mon Oct 29, 2012 9:31 am
Hi, I have a rev.1 Raspberry Pi board I got on June. Since having it, I've been suffering from occasional corruption on the SD when booting/rebooting. At first I thought it was due to early software issues. But with latest updated Raspbian (as of 2012.10.12) I was still having corruption sometimes, so I decided to perform some systematic tests. I wrote a simple program that rebooted the Pi remotely using SSH every 90 seconds, and I found that after a number of reboots (between 3 and 50 in my tests), at last the rootfs always gets corrupted and the system doesn't boot anymore. Boot FAT partition seems to be unaffected.

To reboot the pi I used "sudo reboot". The memory split was 128/128, no overclock. The tests were performed with just the ethernet port and either hdmi or composite out connected, nothing in the usb ports. I tried with three different SD cards and several power supplies and when possible a short (1 m) cable. F3 resistance is 0.2-0.3 ohms, I also measured voltage between TP1 and TP2.

SD cards: Lexar 4 GB class 6, Lexar 8 GB class 4, old TakeMs 2 GB 60x speed.

Power supplies:

LG mobile charger 700 mA 5.1V with short cable, TP1-TP2: 4.82V
Nokia mobile charger 1200 mA 5.1V with non-removable longer cable, TP1-TP2: 4.72V
Apple Iphone charger 1000 mA 5V with short cable, TP1-TP2: 4.80V
Samsung tablet charget 2000 mA 5V with short cable, TP1-TP2: 4.70V

The stablest charger seems to be the LG one.

I was thinking to try with a differend brand SD card as last attempt, but beginning to believe my Pi was faulty, however recently I read that some people was having similar issues even with different boards (viewtopic.php?f=28&t=21204), so I don't know what to think. I also read about a guy with cold solder joints on the SD slot that fixed his Pi resoldering them, and other that fixed his overclocking corruption by soldering a ceramic capacitor to SD power... Any ideas or recommendations?

Thanks.
Posts: 28
Joined: Sat Sep 10, 2011 3:15 pm
by HenryG » Tue Oct 30, 2012 8:56 am
Has any of you experienced the same issues or you have no problems at all in regards to this issue?
Posts: 28
Joined: Sat Sep 10, 2011 3:15 pm
by ElectricGryphon » Mon Nov 05, 2012 1:20 am
Hi Henry,

Can you share your script for rebooting the pi every 90 seconds--is there a way to get it running on Win7? I'm having similar problems (albeit with moderate overclocking--so maybe not quite the same) and I would love to know if my pi is stable enough to last for more than 100 restarts without frying it's file system. As it stands, I get everything installed and figure out how to do something cool and then *poof* it's back to whenever I made my last backup. I'd say I have gone through this cycle a good 8 times at least. (Generally this happens right before I am about to show someone something snazzy that I have figured out how to do--perhaps my Pi has stage fright...)

I'm going to try one last time with an 8GB class 4 SD and no overclock. (Soooooo sloooooow) Fingers crossed.

-GC
Posts: 3
Joined: Sun Sep 30, 2012 7:20 pm
by Vindicator » Mon Nov 05, 2012 2:47 am
When you say reboot are you using any thing like reboot -f just a reboot command may not let it write back if it needs too.
I would suggest
Code: Select all
shutdown -r now

as the command and see if that improves your results as this command calls the system to perform a shutdown then a reboot.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.
User avatar
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
by HenryG » Mon Nov 05, 2012 8:33 am
ElectricGryphon wrote:Hi Henry,

Can you share your script for rebooting the pi every 90 seconds--is there a way to get it running on Win7?


Sure, I'm uploading the files I use. I wrote a small c program for the loop, it calls the 'cmds.bat' file, which calls the ssh client Putty with the appropiate parameters. You'll also need putty.exe in the same folder as the files. Take a look at the files and edit the ip address for your pi in 'setip.bat' file. Run 'loop.exe' for the reboot loop to begin. You can also change the linux reboot command at 'reboot.sh'. It works in Windows XP, I guess it will work also in Windows 7.

If you haven't used Putty previously, the first time it will warn you about a possible security issue, just ignore it and continue.
Attachments
reboot.zip
(1.55 KiB) Downloaded 74 times
Posts: 28
Joined: Sat Sep 10, 2011 3:15 pm
by HenryG » Mon Nov 05, 2012 8:38 am
Vindicator wrote:When you say reboot are you using any thing like reboot -f just a reboot command may not let it write back if it needs too.


Reboot seems to shutdown all processes and flush caches, etc. I'd say it calls shutdown but I would have to check it, thanks.
Posts: 28
Joined: Sat Sep 10, 2011 3:15 pm
by ElectricGryphon » Fri Nov 09, 2012 2:46 am
Thanks for the code, Henry. I'll try this out and see how it holds up.

So far, my pi has been running okay without any acceleration for about a week now. Perhaps my greed (a greed for speed) was getting the best of me.

-GC
Posts: 3
Joined: Sun Sep 30, 2012 7:20 pm