User avatar
Lob0426
Posts: 2156
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Prevent SD-Card Corruption

Sat Jun 29, 2013 5:33 pm

I have a Wordpress site up on a RasPi. It has seen a few problems with corrupted cards. Most of mine were earlier on in the wheezy versions. Most of the corruption issues were either power outages/brown outs, with brown outs causing the most corruptions. The one other thing that is most likely to cause a corruption is rpi-update. Usually this is only a /boot issue.

My Lapdock does not seem to be easily corrupted at all. The OS is on a USB HDD and the card only has the /boot. Having its own battery really helps protect from corruptions. Again rpi-update seems to cause irregular corruptions of /boot.

I run a wide variety of SD cards on my 5 RasPi. Transcend class 4 8Gb, SanDisk Ultra class 6 and 10 8GB and 16GB, SanDisk class 2 and 4 cards. My web server uses a SanDisk class 2 512Mb microSD.

So I backup before I update. My website has run for months on end with no issues at all. But last week the card went down and needed a complete reload from backup. Really just no way to tell when it will happen!
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

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

Re: Prevent SD-Card Corruption

Sat Jun 29, 2013 6:13 pm

Lob0426 wrote:The one other thing that is most likely to cause a corruption is rpi-update. Usually this is only a /boot issue.
Really? I use rpi-update a lot, all the time, and have NEVER had a corrupted card. There have been a couple of times when there have been problems caused by the code loaded by rpi-update, which were easily fixed as well - no need to re-install images, but that is due to bad coding, a totally different issue to random corruption due to PSU etc.


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

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

MaxK1
Posts: 922
Joined: Sun Aug 26, 2012 11:34 pm

Re: Prevent SD-Card Corruption

Sat Jun 29, 2013 8:02 pm

How do you know it is writing? The green led just indicates activity initiated by the ARM (either read or write) What and when the SD card chooses to do (remapping blocks, erasing blocks etc) we have no control over and no visual indication that it's doing anything or nothing...
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

Aydan
Posts: 568
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: Prevent SD-Card Corruption

Sat Jun 29, 2013 8:39 pm

MaxK1 wrote:How do you know it is writing? The green led just indicates activity initiated by the ARM (either read or write) What and when the SD card chooses to do (remapping blocks, erasing blocks etc) we have no control over and no visual indication that it's doing anything or nothing...
As far as I know the SD card never does background activity. Remapping happens on write, blocks are erased on request, and the card only returns a response after is has finished an operation. That's how I interpret the SD specification.

Regards
Aydan

User avatar
Lob0426
Posts: 2156
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Prevent SD-Card Corruption

Sat Jun 29, 2013 10:41 pm

MrEngman wrote:
Lob0426 wrote:The one other thing that is most likely to cause a corruption is rpi-update. Usually this is only a /boot issue.
Really? I use rpi-update a lot, all the time, and have NEVER had a corrupted card. There have been a couple of times when there have been problems caused by the code loaded by rpi-update, which were easily fixed as well - no need to re-install images, but that is due to bad coding, a totally different issue to random corruption due to PSU etc.


MrEngman
The RasPii (I have a few) were running just fine until I ran rpi-update. I run rpi-update separate from the update/upgrade process, then I reboot and check everything before running rpi-update. The /boot is what is usually corrupted. That is real easy to fix. Just copy the boot files from another updated card. At least twice it has been a whole corrupted card. Other things Like power "brown outs" have caused the exact same problem. And before you ask I have monitored TP1/TP2 during the rpi-update to see if voltage drop was the problem. Rpi-update does not cause corruption every time, or on every card, updated near that same time.

I think it is significant that the Motorola Lapdock has the least issues. I wonder if it is the battery that reduces these issues for it. Or is it that /rootfs is on a USB HDD? The two RasPii (card based systems) that are back-powered through hubs also have less corruption issues. My power company is definitely part of the problem here and I suspect it is the same for others!
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Prevent SD-Card Corruption

Wed Jul 10, 2013 12:05 pm

3dcircle wrote:By observation of the green act light I notice that the Pi writes to the SD card for about 20 seconds after sudo halt enter. Removing power during this 20 seconds could result in SD corruption.
After the chip reset, the GPU flashes ACT 10 times (to indicate it is going into low power sleep mode). This will be completely uniform flashing rather than usual sporadic flashes from sdcard.
The display will also be off at this point. Powering off diring these flashes is fine.

Before this point, there will be a lot of writing as caches are synced to disk. Powering off here is not safe.

DrMag
Posts: 62
Joined: Sat Jun 01, 2013 7:59 pm

Re: Prevent SD-Card Corruption

Wed Jul 10, 2013 5:41 pm

That description makes sense to me from my experience and expectations. What doesn't match up is the circumstances in which my SD card became corrupted: the Pi had been powered on, idle for some time. I performed an OS update (Arch) and rebooted. Never pulled the power cord; the supply powers two Pis at once (yes, it can handle it), and I updated both Pis simultaneously. One came back up, the other did not. Both have identical cards and configurations. The card that boots up will work in the Pi that had the corrupted card, so it really is a card issue.

I just don't get how it can be corrupted if there has not been a single power issue. Granted, I can't be absolutely certain that's the case, but if there had, why did it corrupt one but not the other? I suppose there could be some ill-timing, where the power problem happened at the right time during reboot for one, but not the other.

andrum99
Posts: 381
Joined: Fri Jul 20, 2012 2:41 pm

Re: Prevent SD-Card Corruption

Wed Jul 10, 2013 7:42 pm

DrMag wrote:That description makes sense to me from my experience and expectations. What doesn't match up is the circumstances in which my SD card became corrupted: the Pi had been powered on, idle for some time. I performed an OS update (Arch) and rebooted. Never pulled the power cord; the supply powers two Pis at once (yes, it can handle it), and I updated both Pis simultaneously. One came back up, the other did not. Both have identical cards and configurations. The card that boots up will work in the Pi that had the corrupted card, so it really is a card issue.

I just don't get how it can be corrupted if there has not been a single power issue. Granted, I can't be absolutely certain that's the case, but if there had, why did it corrupt one but not the other? I suppose there could be some ill-timing, where the power problem happened at the right time during reboot for one, but not the other.
The answer is that the corruption probably did not happen during the reboot, but rather between it booting up "some time" ago and your recent reboot. You only see the corruption when you try to boot because that is the only time certain critical files are accessed.

As far as the actual cause of the corruption goes, my experience has been that some SD cards work better than others, and some power supplies better than others. Make sure you have updated your Pi to the very latest stable firmware and Linux kernel as a lot of work has gone into improving support for as wide a range of SD cards as possible since the Pi was launched. Also, it is best not to attach/detach anything from the USB or GPIO pins while the Pi is powered on as I have seen that cause corruption as well. (It is also possible to cause the Pi to spontaneously reboot by attaching a USB device that draws lots of power).

In order to rule out power problems I ordered one of these - https://www.modmypi.com/raspberry-pi-ac ... wer-supply along with their USB power cable. Probably overkill, but I can at least be certain that it is not a duff PSU causing my issues.

How far along the boot process does your problem Pi get?

DrMag
Posts: 62
Joined: Sat Jun 01, 2013 7:59 pm

Re: Prevent SD-Card Corruption

Wed Jul 10, 2013 7:57 pm

It doesn't. On power up, the PWR light turns on, and the ACT light briefly lights. Then nothing. No screen output, no blinkies anywhere, just the red PWR led and nothing more. I've tried re-flashing the SD card to no avail.

In my case, I seriously doubt it's a power supply issue, as the same supply (physically the same, not a separate but identical supply) was powering both Pis at once. Nothing plugged in or out during the entire time. Both Pis use identical SD cards. Only one corrupted. It's possible something happened to the power where it was right on the edge-- one Pi had trouble, and the other was (barely) fine. But that seems improbable to me.

In any case, I would agree with the building consensus that investigation is warranted-- ideally this is an issue that shouldn't be present on hardware designed for teaching.

andrum99
Posts: 381
Joined: Fri Jul 20, 2012 2:41 pm

Re: Prevent SD-Card Corruption

Wed Jul 10, 2013 11:43 pm

If the ACT light comes on at all then the Pi has got as far as successfully running bootcode.bin on the SD card. You should be able to get the Pi booting from this card by formatting it with the SD Association Formatter 4.0 (https://www.sdcard.org/downloads/formatter_4/), but make sure you set the format size adjustment to ON. Once you have run the tool, eject the SD card. You can then re-install whatever OS you were using.

The way you have described it, it does sound unlikely that it is a power issue causing the corruption, but the fact you are running two Pi's from the same PSU makes me nervous. How are you re-flashing the card?

DrMag
Posts: 62
Joined: Sat Jun 01, 2013 7:59 pm

Re: Prevent SD-Card Corruption

Thu Jul 11, 2013 2:28 pm

I've reformatted the card twice with the v4.0 formatter; no love. Absolutely no change. The card is flashed using dd in linux. I'm starting to wonder if the card itself is damaged in some way that it works fine in general but is unbootable, and I may have to just buy a new card.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Prevent SD-Card Corruption

Thu Jul 11, 2013 4:13 pm

Gordon spotted an sdcard that repeatedly gave a timeout error followed by corruption. Increasing the timeout has solved the problem for this card.
rpi-update should get the fix. Let us know if thing are better after this.

benoitm76
Posts: 3
Joined: Mon May 06, 2013 6:55 pm

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 11:47 am

I have same problem here. I have a Raspberry PI plug on a TV with a wireless dongle (no keyboard, no ethernet --> no user interaction). An app is launch at boot to show information contains in Excel files in network folder. Rpi is overcloked to 800 Mhz and stay alive all the time.

It's the second time that my SD card is corrupt. The cards have bad sectors and i can't use it anymore. I use a 1500 mA power supply.

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

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 12:17 pm

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.
I have been taking a piece off my  π. Now it's behaving like a raspberry π. ;-)

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

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 3:46 pm

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.
I use one for powering odd bits of electronics and an old (1980's) 4GB harddrive but not a Pi, using the 5v and 12v outputs. One problem with them though is that they usually require a minimum load, often several amps, to be stable.

Powering 20-50 Pi's off one PSU might be feasible as that will generate sufficient load, powering just one not a good idea at all.


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

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

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

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 6:57 pm

dom wrote:Gordon spotted an sdcard that repeatedly gave a timeout error followed by corruption. Increasing the timeout has solved the problem for this card.
rpi-update should get the fix. Let us know if thing are better after this.
Is this sort of update a good idea? Surely the SD card interface should be set to mirror the official spec as far as operation and timings are concerned. If the card doesn't meet the spec then too bad. Buy a decent card.

After running rpi-update to update from #494 I now see these errors when I hot-plug a wifi adaptor

Code: Select all

[ 3086.122434] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 1, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04600001
[ 3086.122434]
[ 3101.333678] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 2, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04600001
[ 3101.333678]
Never seen these with any previous revisions. And I've never seen any corruption either since starting with the Pi back in Apr 2012 on any of the 30 or so SD cards I have..

I've also seen some other issues with a couple of new SD cards with this update but I'm not sure it's the cards or the software. Going to investigate some more and will post if I find anything definite.

I also see the following when I unplug my wifi, although this has been around for quite a while. The "leaking at least 'ampdu_enable'" just concerns me somewhat.

Code: Select all

[ 3074.446572] usb 1-1.3.1: USB disconnect, device number 6
[ 3074.457643] ------------[ cut here ]------------
[ 3074.457711] WARNING: at fs/proc/generic.c:849 remove_proc_entry+0x280/0x2a0()
[ 3074.457727] remove_proc_entry: removing non-empty directory 'rtl819xC/wlan1', leaking at least 'ampdu_enable'
[ 3074.457736] Modules linked in: snd_bcm2835 snd_pcm snd_page_alloc snd_seq snd_seq_device snd_timer snd leds_gpio led_class 8192cu
[ 3074.457819] [<c0013a7c>] (unwind_backtrace+0x0/0xf0) from [<c001e2ec>] (warn_slowpath_common+0x4c/0x64)
[ 3074.457849] [<c001e2ec>] (warn_slowpath_common+0x4c/0x64) from [<c001e398>] (warn_slowpath_fmt+0x30/0x40)
[ 3074.457878] [<c001e398>] (warn_slowpath_fmt+0x30/0x40) from [<c0118264>] (remove_proc_entry+0x280/0x2a0)
[ 3074.458336] [<c0118264>] (remove_proc_entry+0x280/0x2a0) from [<bf03c748>] (rtw_proc_remove_one+0xf4/0x188 [8192cu])
[ 3074.458979] [<bf03c748>] (rtw_proc_remove_one+0xf4/0x188 [8192cu]) from [<bf03d6bc>] (rtw_dev_remove+0x94/0x134 [8192cu])
[ 3074.459340] [<bf03d6bc>] (rtw_dev_remove+0x94/0x134 [8192cu]) from [<c0278054>] (usb_unbind_interface+0x48/0x108)
[ 3074.459378] [<c0278054>] (usb_unbind_interface+0x48/0x108) from [<c0237670>] (__device_release_driver+0x58/0xb0)
[ 3074.459403] [<c0237670>] (__device_release_driver+0x58/0xb0) from [<c02376e4>] (device_release_driver+0x1c/0x28)
[ 3074.459425] [<c02376e4>] (device_release_driver+0x1c/0x28) from [<c02371ec>] (bus_remove_device+0xc4/0xe4)
[ 3074.459461] [<c02371ec>] (bus_remove_device+0xc4/0xe4) from [<c023538c>] (device_del+0xf8/0x17c)
[ 3074.459486] [<c023538c>] (device_del+0xf8/0x17c) from [<c0276730>] (usb_disable_device+0xa0/0x1c8)
[ 3074.459524] [<c0276730>] (usb_disable_device+0xa0/0x1c8) from [<c026f9d0>] (usb_disconnect+0x7c/0x124)
[ 3074.459549] [<c026f9d0>] (usb_disconnect+0x7c/0x124) from [<c027088c>] (hub_thread+0x31c/0x10d4)
[ 3074.459589] [<c027088c>] (hub_thread+0x31c/0x10d4) from [<c003a7ec>] (kthread+0x88/0x94)
[ 3074.459626] [<c003a7ec>] (kthread+0x88/0x94) from [<c000e9fc>] (kernel_thread_exit+0x0/0x8)
[ 3074.459640] ---[ end trace 2c8924235559fb5c ]---
I found one previous reference in the forum here http://www.raspberrypi.org/phpBB3/viewt ... 44#p376544 and searching Google for "leaking at...." brings up a few references in Fedora. No idea if this a real problem or not.


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

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

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

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 7:18 pm

Just looked at dmesg again and found a few more errors and the Pi has been sitting idle

Code: Select all

[ 3116.921750] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 6, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04600001
[ 3116.921750]
[ 3459.501345] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 3, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04600001
[ 3459.501345]
[ 3487.049959] 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 0x04600001
[ 3487.049959]
So errors from 5 different DMA channels. What's this all about then?


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

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

boyoh
Posts: 1046
Joined: Fri Nov 23, 2012 3:30 pm

Re: Prevent SD-Card Corruption

Fri Jul 12, 2013 10:28 pm

Switching off the RPi at the power adapter can some times cause a power spike .
As there is not much protection built in to the RPi, I feel this could cause corruption
to the SD card, Try un plugging the RPi at the micro USB plug.
When switching off at the power adapter ,you are switching off at random, the AC
Cycle might be at its peak or at it,s lowest
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

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

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 7:41 am

I've done a disk check and it is reported as clean

Code: Select all

pi@raspberrypi ~ $ sudo fsck -Vf /dev/sda2
fsck from util-linux 2.20.1
[/sbin/fsck.ext4 (1) -- /dev/sda2] fsck.ext4 -f /dev/sda2
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 72823/245760 files (0.2% non-contiguous), 448369/952704 blocks
pi@raspberrypi ~ $
Checking the FAT32 partition gave

Code: Select all

pi@raspberrypi ~ $ sudo fsck -Vf /dev/sda1
fsck from util-linux 2.20.1
fsck: fsck.vfat: not found
fsck: error 2 while executing fsck.vfat for /dev/sda1
pi@raspberrypi ~ $
so I checked it on my W7 laptop and it reported all was OK, no errors as well.

So why have these DMA error suddenly started to appear?


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

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

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 11:43 am

MrEngman wrote: So why have these DMA error suddenly started to appear?
Nothing to do with the sdcard timeout increase.
Possibly related to the USB split FIQ patch that went in a week or two ago. You should report it here:
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=23544

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 11:54 am

MrEngman wrote: Is this sort of update a good idea? Surely the SD card interface should be set to mirror the official spec as far as operation and timings are concerned. If the card doesn't meet the spec then too bad. Buy a decent card.
See https://github.com/raspberrypi/linux/co ... 2d6b09865c
The upstream Linux kernel has chosen 3 seconds for the timeout (to support "crappy" cards).
There is some Pi specific code that was using a smaller timeout which we believe to be wrong.

There's no reason to not make the timeout big. A good card will never trigger the small or large timeout.
We know hitting the timeout results in sdcard corruption.
There is an argument to making the timeout infinite (I'd prefer a hang to corruption), but that would make removing a misbehaving sdcard and inserting a good one impossible (In the case I'm running from USB/nfs rootfs).

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

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 1:01 pm

dom wrote:
MrEngman wrote: So why have these DMA error suddenly started to appear?
Nothing to do with the sdcard timeout increase.
Possibly related to the USB split FIQ patch that went in a week or two before. Gordon can perhaps comment.
OK.I haven't seen it before doing the latest update from #494 to #496. I'm going to check to see if I can see it in any earlier versions. Just that I usually run rpi-update whenever a new update appears so I can check if it upsets a wifi driver I have that is not included in the standard images and so may need a recompile and I've not seen this error before.

It's just that after doing the update my Pi started behaving strangely. I use it headless with Putty on my W7 laptop and text output to the screen became rather erratic. Long delays sometimes appeared when executing some commands. e.g. tried an rpi-update and it appeared to hang, no text output to the screen for a least a minute. Was reluctant to power of so went to make a cup of tea and when I came back rpi-update had run and finished, and of course reported already up to date. Tried to restore to the previous version #494 with sudo rpi-update 960e2f6b07a663e01b76d6215638fe0a69fa06b2 and after downloading the tar.gz it again appeared to hang, having got to this point with no abnormal delays this time. This would generally take 15-20 seconds while the tar.gz is unpacked but it just sat like that for several minutes. This time I lost patience and powered off. I changed cards to one with an earlier version and did an fsck on the card I'd been using and had no errors reported. What it had been doing and why the delays I haven't a clue but I had never seen it behave like that before.

Anyway I'm going to start back at 2013-05-25-wheezy-raspbian and run through all the updates and see what I can find and will get back when done.


MrEngman


EDIT: Thanks for the pointer. Must read up on how SDHC cards are interfaced.
Last edited by MrEngman on Sat Jul 13, 2013 1:23 pm, edited 1 time in total.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

chorlton2080
Posts: 124
Joined: Sun Dec 23, 2012 9:44 pm

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 1:10 pm

I've never (9 months of owning 2 RPi's) corrupted my SD card despite frequently switching off the power without initiating a shut down command; so complacent have I become that everything functions fine afterwards that I rarely do the soft shutdown. I know it's neither elegant or good practice. I do try to make sure I'm not writing any files at the time.

Perhaps the reason I can be complacent is that I always use Samsung SD Cards, rather than the much maligned alternatives.

Or I'm just insanely lucky given my recklessness.

User avatar
joan
Posts: 12818
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 1:20 pm

Ditto.

I haven't had a problem for ages. I used to get corruption in the boot sector quite often immediately after doing a rpi-update. The rpi-update related corruption stopped some time ago, I assume something was fixed.

I redirect as many logs as possible to /dev/null. Nothing else should regularly be writing to SD card other than edits by me. I aim to switch off safely. I don't always meet my aim.

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

Re: Prevent SD-Card Corruption

Sat Jul 13, 2013 5:47 pm

dom wrote:
MrEngman wrote: So why have these DMA error suddenly started to appear?
Nothing to do with the sdcard timeout increase.
Possibly related to the USB split FIQ patch that went in a week or two ago. You should report it here:
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=23544
Looks like you were right. Appears to start with #488 - .firmware_revision 44dc4f093c9ec075e6704965665311a94f6371aa - linux: Enable fiq split fix for usb


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

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

Return to “Troubleshooting”

Who is online

Users browsing this forum: Exabot [Bot], ghans, lost and 27 guests