AlexGoodyear
Posts: 5
Joined: Mon Feb 18, 2013 2:19 pm
Location: Oxford
Contact: Website

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 6:18 pm

We use tower PC cases with good quality PC power supplies to contain and power the Raspberry Pi clusters that control our video walls. The nine screen system contains 10 Raspberry Pi's mounted in the drive bays, 2 eight port Ethernet switches (5 volt), 3 fans (12 volt) and a power distibution board that I designed to replace a normal motherboard and keep the PSU sense line happy and connect the front panel switches and LEDs. I will be putting information about the design on our website www.piwall.co.uk in the next couple of weeks.

Alex.
Lamyrus wrote:Has anybody ever converted and used an old internal PSU (Power supply unit) from a desktop computer? It has all kind of voltages like:
  • 12V <- not to be used, or for a car display / external harddisk?
    5V <- like to be used.
    3.3V <- can be used for GPIO?
And isn't it stable? (Normally computers like a steady flow of even electrons.) Does anybody know how much energy such a PSU it self is consuming? Altogether it can be a cheap solution for powering the pi and its peripherals. Maybe even ruling out corruption of sd-cards.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1186
Joined: Sat Sep 10, 2011 11:43 am

Re: Prevent SD-Card Corruption

Sun Jul 14, 2013 8:26 am

Have you tried updating using rpi-update recently, I fixed a problem with SDCard corruption that was evident on specific SDCards. Might be worth another try now and see if you can still see the same problem (this is important because I need to know whether there are any new problems)

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

MrEngman
Posts: 3562
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Prevent SD-Card Corruption

Sun Jul 14, 2013 10:44 am

I've not seen SD card corruption but have got DMA errors

Code: Select all

[ 5932.614979] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 4, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
After some investigation they first seemed to appear with #488 but I didn't notice any problem until updating to #496, after having been using #494 for a while, and the Pi started to behave strangely prompting me to check dmesg. The DMA errors appeared much, much more frequently. Networking in particular seemed to get rather erratic with text output to the screen via SSH getting rather jittery with delays here and there and random and excesive delays when executing commands that used networking.

Apparently jdb is working on the DMA issue but why it appeared to get much worse with the SD card timeout update appears odd.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1186
Joined: Sat Sep 10, 2011 11:43 am

Re: Prevent SD-Card Corruption

Sun Jul 14, 2013 11:08 am

They are two different problems which are being attacked at the same time by Raspberry Pi (jdb and gsh)

Look out for the fixes in GitHub

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

Lawbayly
Posts: 3
Joined: Fri Jul 19, 2013 3:47 am

Re: Prevent SD-Card Corruption

Fri Jul 19, 2013 3:57 am

Has this 3 second wait issue been solved for both armel and armhf or just armhf?

Also is a apt-get update then apt-get upgrade enough to get this updated kernel or do I need to run rpi-update also?

I've had a large number of Kingston Class 4 4GB cards die on me and it's usually to the point that it corrupts both boot and root partitions, aborts the kernel and the card cannot be formatted (even a zero fill with dd fails with media errors).

The error that usually occurs is:-

Code: Select all

[2261610.918901] mmc0: resetting ongoing cmd 25DMA before 4096/4096 [2]/[5] complete
[2261610.921167] mmcblk0: error -84 transferring data, sector 1724024, nr 40, cmd response 0x900, card status 0x4000d00
[2261610.921543] end_request: I/O error, dev mmcblk0, sector 1724024
[2261610.921573] end_request: I/O error, dev mmcblk0, sector 1724032
[2261610.921593] end_request: I/O error, dev mmcblk0, sector 1724040
[2261610.921609] end_request: I/O error, dev mmcblk0, sector 1724048
[2261610.921624] end_request: I/O error, dev mmcblk0, sector 1724056
[2261610.921782] Aborting journal on device mmcblk0p2-8.
[2261611.021850] EXT4-fs error (device mmcblk0p2): ext4_journal_start_sb:349: Detected aborted journal
[2261611.037044] EXT4-fs (mmcblk0p2): Remounting filesystem read-only
[2348243.108601] EXT4-fs (mmcblk0p2): error count: 2
[2348243.108633] EXT4-fs (mmcblk0p2): initial error at 1373966995: ext4_journal_start_sb:349
[2348243.108653] EXT4-fs (mmcblk0p2): last error at 1373966995: ext4_journal_start_sb:349
[2434754.889324] EXT4-fs (mmcblk0p2): error count: 2
[2434754.889357] EXT4-fs (mmcblk0p2): initial error at 1373966995: ext4_journal_start_sb:349
[2434754.889377] EXT4-fs (mmcblk0p2): last error at 1373966995: ext4_journal_start_sb:349
I'll have my fingers crossed this kernel mmc driver update fixes this.

Thanks,

Lawrence

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1186
Joined: Sat Sep 10, 2011 11:43 am

Re: Prevent SD-Card Corruption

Fri Jul 19, 2013 8:54 am

You need rpi-update to get the latest kernel... It is the same kernel for hf and sf (there is no FP in the kernel)

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

jockun
Posts: 1
Joined: Mon Jul 22, 2013 1:11 pm

Re: Prevent SD-Card Corruption

Mon Jul 22, 2013 1:19 pm

I also discovered SD Card corruption. I will try this as I was overclocking my RPi... Hopefully it solves the issue. I'm using raspbmc overclocking by default to 800 MHz running smoothly till I start playing with all those clock values.

User avatar
Lamyrus
Posts: 3
Joined: Fri Jul 12, 2013 11:49 am

Re: Prevent SD-Card Corruption

Mon Jul 22, 2013 8:29 pm

That sounds like I have to make sure that the PSU sense line needs more power take off then one raspberry pi. Where do I find this PSU sense lead? It should be on the 24pin header going to the motherboard? (I converted blindly an old PSU from a dell and hooked it up to a lacie nas server as that power converter broke down and it works like a charm. the lacie nas has two 3.5" 500gb drives and an arm board to be powered...)
AlexGoodyear
We use tower PC cases with good quality PC power supplies to contain and power the Raspberry Pi clusters that control our video walls. The nine screen system contains 10 Raspberry Pi's mounted in the drive bays, 2 eight port Ethernet switches (5 volt), 3 fans (12 volt) and a power distibution board that I designed to replace a normal motherboard and keep the PSU sense line happy and connect the front panel switches and LEDs. I will be putting information about the design on our website http://www.piwall.co.uk in the next couple of weeks.
Alex.
I have been taking a piece off my  π. Now it's behaving like a raspberry π. ;-)

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1687
Joined: Thu Jul 11, 2013 2:37 pm

Re: Prevent SD-Card Corruption

Mon Jul 22, 2013 9:24 pm

Lamyrus wrote:That sounds like I have to make sure that the PSU sense line needs more power take off then one raspberry pi. Where do I find this PSU sense lead? It should be on the 24pin header going to the motherboard? (I converted blindly an old PSU from a dell and hooked it up to a lacie nas server as that power converter broke down and it works like a charm. the lacie nas has two 3.5" 500gb drives and an arm board to be powered...)
[Public safety message: long ramble ahead]

In the dark ages of computing, ATX power supplies would provide 3.3/5/12V to the motherboard, along with some vestigial -12V and -5v (obsoleted in the current spec, was for hardware UARTs). The problem that many of the designers faced was that each motherboard would have different loading profiles for 3.3/5/12V which necessitated that they put a bit of robustness into the design.

Given that there were a specified number of connections via the ATX plug to the board, the voltage line that was typically most susceptible to skew was 3.3V. If a heavy current was drawn from 3.3V by a motherboard (typical of early 2000s models), the line could droop due to the I²R losses in the wire between the power supply and the motherboard. To compensate for this, the feedback circuit would have a separate "sense" lead running from the power supply to the ATX connector. Some would even have sense leads for both 3.3V and 0V.

Internally, the sense lead provides a more dominant feedback signal compared to local voltage sensing - the external voltage is given priority. You could "probably" remove the sense lead and the PSU will work fine, but I'd test this with a dummy load before plugging it into electronics.

Anecdotally, I had an Asus A7N8X with a very very heavily overclocked AMD Athlon that managed to melt the +5V pins in the ATX plug. The CPU core voltage was derived from 5V. Hilarity ensued when smoke literally started pouring out of my first PC while gaming :D
Rockets are loud.
https://astro-pi.org

Narf03
Posts: 243
Joined: Mon Jun 11, 2012 3:44 pm
Location: Malaysia

Re: Prevent SD-Card Corruption

Sat Jul 27, 2013 6:58 pm

Hi, did anybody tried the recent rpi-update and still face sd corrupt issue? Please do share, thank you.

ThexDLolNoob
Posts: 3
Joined: Thu Dec 13, 2012 3:14 pm

Re: Prevent SD-Card Corruption

Sun Aug 04, 2013 6:39 pm

I got the latest image and everything up to date, and my RPi's Transcend 16 GB class 10 microSDHC card got corrupted today as I was installing Python 3.3.2 with pyenv through SSH. I've heavily overclocked though, I'll have to decrease the CPU clock to 1000MHz and try again. Could the high sdram frequency have anything to do with this?

Relative parts of config.txt:
arm_freq=1080
core_freq=500
sdram_freq=600
over_voltage=6
gpu_mem=16

User avatar
RaTTuS
Posts: 9486
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Prevent SD-Card Corruption

Mon Aug 05, 2013 7:58 am

ThexDLolNoob wrote:I got the latest image and everything up to date, and my RPi's Transcend 16 GB class 10 microSDHC card got corrupted today as I was installing Python 3.3.2 with pyenv through SSH. I've heavily overclocked though, I'll have to decrease the CPU clock to 1000MHz and try again. Could the high sdram frequency have anything to do with this?

Relative parts of config.txt:
arm_freq=1080
core_freq=500
sdram_freq=600
over_voltage=6
gpu_mem=16
any overclocking can have issues - try with O/C , also what TP1 / TP2 Voltage are you getting
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

ThexDLolNoob
Posts: 3
Joined: Thu Dec 13, 2012 3:14 pm

Re: Prevent SD-Card Corruption

Mon Aug 05, 2013 1:47 pm

RaTTuS wrote:
ThexDLolNoob wrote:I got the latest image and everything up to date, and my RPi's Transcend 16 GB class 10 microSDHC card got corrupted today as I was installing Python 3.3.2 with pyenv through SSH. I've heavily overclocked though, I'll have to decrease the CPU clock to 1000MHz and try again. Could the high sdram frequency have anything to do with this?

Relative parts of config.txt:
arm_freq=1080
core_freq=500
sdram_freq=600
over_voltage=6
gpu_mem=16
any overclocking can have issues - try with O/C , also what TP1 / TP2 Voltage are you getting
I'm a total electronics noob, if you mean the actual voltage my Raspberry Pi is getting, I haven't measured it. My power supply says gives 5V. Also I decided going with the medium OC preset.

molton
Posts: 8
Joined: Thu Jan 03, 2013 4:09 am

Re: Prevent SD-Card Corruption

Thu Aug 15, 2013 11:00 am

Have you tried updating using rpi-update recently, I fixed a problem with SDCard corruption that was evident on specific SDCards. Might be worth another try now and see if you can still see the same problem (this is important because I need to know whether there are any new problems)
That makes sence, sometimes it drives me nuts how a certain computer / OS won't read an SD card because of some minor difference in the way that particualr manufacturer does things. I though SD cards were more standard, but they are kind of not. That is why you see these 100-in-1 card readers that read 90 different types of SD cards.

I had the Raspbian build from around July of last year and had no problems with my Transcend SD-HC Class 6 SD card, I developed a piece of software on it and had no problems after many restarts. Now with the new Raspbian, every time I restart the Pi, it fails to ever boot again.

beruic
Posts: 28
Joined: Sun Jan 29, 2012 1:37 pm

Re: Prevent SD-Card Corruption

Mon Sep 02, 2013 11:55 am

I use a pi as a headless server. today I got tired of not being able to find a file, so I did a:

Code: Select all

sudo fint / -name 'the_file_name'
The pi became unresponsive quickly (I guess immediately) after, and the file system is broken.

It's a freshly installed Raspbian (from NOOBS), with only postgresql and adminer installed.
The SD card is a Transcend 16GB class 10.

lenkf
Posts: 19
Joined: Wed Jul 10, 2013 10:02 pm
Location: S.California

Re: Prevent SD-Card Corruption

Mon Sep 02, 2013 7:16 pm

Maybe a little late to the party on this one.

After doing a normal shutdown, and the system says its halted, there are a few extra moments when the green led flashes 10 times on my pi rev2 512MB. I suspect there's disk activity going on even after the system says its halted. If one removes power during these last moments of the flashing green led, it might be possible to corrupt the memory card.

If one uses a power strip, and uses the on/off button to remove power from the pi during the 10 green led flashes (as I have done), one can end up with corrupt flash card.

Franxois
Posts: 13
Joined: Fri Apr 27, 2012 9:33 am

Re: Prevent SD-Card Corruption

Wed Oct 02, 2013 10:26 am

I use Raspberry in my business. They are used to datalogging, running java, mysql and apache.
I spend few days to made raspbian as litle as possible and read-only for /boot, /etc except /var. Woried than sd card may be an issue. I buy sandisk card rather than trascent who seem to be less good.

After 6 months 24/7 with a reboot every 3 days, 1 raspberry get corrupt of 5.

Even the raspberry I use to developped just crashed. The errors arrived few days ago, when I remount the system in read-write to install oracle's jdk. I tried to run fsck few days ago but the corruption get back.
I upgrade debian frequetly and even use raspi-update fex days ago.

For me, the sdcard is broken and I should better replace it.

Sdcard corruption is an issue. I'm surprise no one there think of read only system. My experience show than the number of writes is not the problem. The fsck shows problem with file in read-only partitions...

Should I try others plateform with on board filesystem, like arduino yun on beagle bone ? On board memory is it more reliable than sdcard ?

RoKoInfo
Posts: 1
Joined: Sat Sep 28, 2013 1:42 pm

Re: Prevent SD-Card Corruption

Thu Oct 03, 2013 11:33 am

@ Franxois, @ lenkf: I can confirm your findings.

I run two RPi/Raspians with RO file system (following the howto in the Debian Wiki and a post here). Additionally, I enforce an e2fsck with each partition and boot, and a kernel panic on an unclean partition. However, I was still suffering from SD-card corruptions. On the other side, I am not aware of a corruption during normal operation of the RPis.

As a consequence, I installed a small script on a test system, which made a reboot 30s after boot. The statistics is poor, however, the two tests led to 16 and 19 reboots, before an unclean partition showed up - imho, a pretty poor number of reboots. Both cases broke the RO root partition.

For the moment, I switched the strategy to "avoiding reboots", using only halts for backing up the system. My statistics here is even worse, exactly one, but without failures.

Furthermore, since I do not know whether there happens something strange during the removal of the USB power, I started to remove the card before removing the USB power line - against the recommendations, I know. To any HW specialists here: Does this make sense?

To any Debian specialists: Is there an - easy - way to declare the system as halted after some 30s of waiting = reboot 30 s later?

lenkf
Posts: 19
Joined: Wed Jul 10, 2013 10:02 pm
Location: S.California

Re: Prevent SD-Card Corruption

Wed Oct 09, 2013 9:41 pm

Just catching up with my posts. An interesting thing was mentioned was running the pi "ro", read only. As I have begun regularly backing up my images, I move the little mechanical slide on the sd card to "lock" (read only) to make sure my use of Win32DiskImage.exe (on win7 pc) doesn't accidentally overwrite the sd. After doing the backup, I have accidentally reinserted the sd, in lock mode, back into the rpi. The rpi seemed to run ok but shortly later there were problems. I haven't done this stupid mistake enough times to actually sort all that out. And, I haven't taken the time to actually experiment with such a situation. Maybe such a user mistake was never "tested" by the rpi developers so some bad stuff may happen to us beginners and can cause sd corruption :) Just thought I'd throw that into the fray of sd corruption.

Fred

FM81
Posts: 494
Joined: Wed Apr 17, 2013 4:33 pm

Re: Prevent SD-Card Corruption

Thu Oct 10, 2013 7:13 am

The hardware-lock from the SD-card IS NOT CONNECTED on the RasPi-board ... :)
It doesn't matter if you close it or not (by using the card in RasPi).

To make a read-only system you have to go other ways ...

MfG, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

antong
Posts: 1
Joined: Wed Nov 13, 2013 1:17 pm

Re: Prevent SD-Card Corruption

Wed Nov 13, 2013 1:28 pm

Hello!

I get corruptions a lot. This actually makes the RPI impossible to use for long time services (burglar alarms, web camera and so on). I been running a lot of open-wrt routers before the RPI booting from USB and SD cards and never had this issue. Usually the boot partition still works but not partition containing the installation.

Has anyone experimented with using different filesystems ext3 ext4?
Is there something that open-wrt uses that the RPI doesn't?

Best regards

Anton

User avatar
DougieLawson
Posts: 29714
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Prevent SD-Card Corruption

Wed Nov 13, 2013 4:52 pm

RaTTuS wrote:Just to stick my ore in here
I've currently have 4 RPi's
one :-

Code: Select all

uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1    71 days, 22:59:51 | Linux 3.6.11+             Tue Mar 12 08:37:44 2013
 
Nice stats, can you share the script or program that generates that stuff?

I've got lico-update.sh running in my crontab which updates http://linuxcounter.net/user/543606.html but your stats look really nice.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
RaTTuS
Posts: 9486
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Prevent SD-Card Corruption

Wed Nov 13, 2013 5:15 pm

DougieLawson wrote:
RaTTuS wrote:Just to stick my ore in here
I've currently have 4 RPi's
one :-

Code: Select all

uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1    71 days, 22:59:51 | Linux 3.6.11+             Tue Mar 12 08:37:44 2013
 
Nice stats, can you share the script or program that generates that stuff?

I've got lico-update.sh running in my crontab which updates http://linuxcounter.net/user/543606.html but your stats look really nice.
way off topic but ...
sudo apt-get install uptimed
uprecords
will give outputs like

Code: Select all

 uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1    32 days, 04:47:10 | Linux 3.6.11+             Fri Oct  4 09:56:22 2013
     2    12 days, 20:38:16 | Linux 3.6.11+             Thu Sep 12 13:00:59 2013
     3     8 days, 23:31:40 | Linux 3.6.11+             Wed Sep 25 10:02:33 2013
->   4     6 days, 00:26:48 | Linux 3.10.18+            Thu Nov  7 16:46:26 2013
     5     2 days, 02:02:23 | Linux 3.10.18+            Tue Nov  5 14:43:48 2013
     6     0 days, 00:04:39 | Linux 3.6.11+             Wed Sep 25 09:39:05 2013
     7     0 days, 00:03:14 | Linux 3.6.11+             Fri Oct  4 09:52:24 2013
     8     0 days, 00:02:50 | Linux 3.6.11+             Fri Oct  4 09:34:04 2013
----------------------------+---------------------------------------------------
1up in     2 days, 23:04:53 | at                        Sat Nov 16 16:18:06 2013
no1 in    26 days, 04:20:23 | at                        Mon Dec  9 21:33:36 2013
    up    62 days, 03:37:00 | since                     Thu Sep 12 13:00:59 2013
  down     0 days, 00:35:15 | since                     Thu Sep 12 13:00:59 2013
   %up               99.961 | since                     Thu Sep 12 13:00:59 2013

Code: Select all

uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
->   1   147 days, 05:44:56 | Linux 3.6.11+             Wed Jun 19 12:29:41 2013
     2    72 days, 21:43:04 | Linux 3.6.11+             Fri Mar  1 12:24:00 2013
     3    20 days, 21:24:58 | Linux 3.2.27+             Thu Feb  7 12:16:50 2013
     4    13 days, 02:57:41 | Linux 3.6.11+             Thu Jun  6 09:30:02 2013
     5    12 days, 05:36:26 | Linux 3.6.11+             Fri May 17 10:31:54 2013
     6     6 days, 04:43:05 | Linux 3.6.11+             Thu May 30 12:37:07 2013
     7     2 days, 03:19:35 | Linux 3.6.11+             Mon May 13 10:16:49 2013
     8     1 day , 19:55:38 | Linux 3.6.11+             Wed May 15 14:31:09 2013
     9     0 days, 20:13:58 | Linux 3.6.11+             Wed May 29 16:23:02 2013
    10     0 days, 00:10:04 | Linux 3.6.11+             Wed May 29 16:08:08 2013
----------------------------+---------------------------------------------------
NewRec    74 days, 08:01:51 | since                     Sat Aug 31 10:12:44 2013
    up   277 days, 09:49:25 | since                     Thu Feb  7 12:16:50 2013
  down     1 day , 19:08:22 | since                     Thu Feb  7 12:16:50 2013
   %up               99.356 | since                     Thu Feb  7 12:16:50 2013
etc
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17880
Joined: Sat Jul 30, 2011 7:41 pm

Re: Prevent SD-Card Corruption

Wed Nov 13, 2013 5:20 pm

antong wrote: Is there something that open-wrt uses that the RPI doesn't?
These tend to use directly connection flash memory systems rather than SD cards.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

JMak
Posts: 6
Joined: Fri Dec 28, 2012 10:25 pm

Re: Prevent SD-Card Corruption

Fri Nov 29, 2013 8:47 am

I too just experienced my first sd card corruption. I was previously running of a USB drive and had the same server running for over 6 months without problems. I needed the USB drive for backups so I switched to a 16GB card and got corruption after 2 weeks. I lost some work and I'm bummed I didn't know about the corruption earlier or I would have done nightly backups. I'm switching back to the USB image.

Return to “Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 42 guests