-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDCard corruption on RPI2 #397
Comments
@ghollingworth does have a Samsung EVO sdcard that he can provoke into corrupting data. For now, Transcend and Samsung EVO cards are best avoided. Other cards don't seem to suffer in the same way. |
Holy **** that was a freaking fast answer. |
Duplicate of #372 ? |
If your failure is 100% reproducible then it would be interesting to see, currently I'm having trouble reproducing the problem (only seen it twice in the last week) and it makes it very difficult to understand what's going wrong Gordon |
In my first post, I explain how to reproduce it on my card. Basically, after a fresh install of Raspbian, I create a file ( sudo touch /forcefsck ) to run fsck on next boot, I reboot and then lots of errors are found (and it crashes in a very beautiful way). |
My question is: is it 100% reproducible? Does it happen without fail every time you boot in this way? |
Well I tried 3 or 4 times in row (with a fresh install each time) at the time I created the issue. |
Hi,(and sry bad english) ;) |
I have RPi2 and Openelec and got similar problem with Kingston 32GB class 10. *** Error in mount_storage: mount_common: could not mount /dev/mmcblk0p2 *** Starting debugging shell... type exit to quitsh: can't access tty; job control turned off Now using a different card. |
Are you using NOOBS to install the software or an image? Are you updating the image before rebooting? Gordon On 10/04/2015 15:08, "johalareewi" [email protected] wrote:
|
Using an image. Openelec image (for RPi2) from http://openelec.tv/get-openelec |
Whats the minimal steps required to guarantee it will fail... Include versions of software and links do you actually need to install stuff or will it corrupt without this? Thanks |
The minimal steps are install official Openelec or Raspbian image on a Samsung evo 16 U-1, it doesnt matter the way you install it, and switch off the pi while writting on the sd. I saw a posible solution in other forum, but I haven´t test it yet http://openelec.tv/forum/124-raspberry-pi/75281-openelec-5-0-3-still-corrupts-sd-card-on-pi2?start=15#132032 |
@moskichi Switching the Pi off while writing to the sdcard is expected to cause corruption (with any memory device on any platform). Always shut down before removing power. |
@NitroG42
You should see: "mmc_debug:1fff" and "Forcing PIO mode" in dmesg log, and see a reduction in performance. I'd like to know if you still see corruption. |
integral ultima pro 8gb class 10 upto 20mb/s are a brilliant card hardly have any issues been using for 2 years , was out of stock one time so bought 2 different batches from different suppliers of kingston cards ,one of the suppliers was scan computers in bolton so not like they was clone cards , and had almost everyone back over 3months and 50% of them cant be recognised by any device i put them in |
I've bought a 16GB Samsung Evo MicSD when I first got my RPi2 (was still running my good old RPi1 /w normal SD) and experienced the same issues as NitroG42 and johalareewi - after a certain (few, 1 to 3 were sufficient) amount of reboots, the system wouldn't boot up any longer due to mounting errors. I was able to reproduce the issue pretty much reliably any time back then: install an image (doesn't matter if I used a fresh OE image or my 'old' backuped RPi1 image with RPi2 kernel replacing the Pi1 kernel), do the usual setup stuff like config, addon installations, reboot. I even tried manual 'sync'ing and rebooting over SSH to be safe but after one to three reboots I encountered corruption anyways. As long as the Pi stayed powered on I was able to watch movies, tv shows, youtube and amazon prime without a hitch though... problems arose after the nightly power down or the aforementioned reboots. I fixed the problem for now by buying a fresh Sandisk card which works without a sign of any flaws until today... got nearly mad at my RPi2 until I tried a 64GB Sandisk MicSD which worked flawlessly right from the first image install. At first I thought it might be power related but after testing 4 different power adapters (Nexus 10, Galaxy S5, generic 5V 2A adapter and a known brand adapter from a local electronics store) I kinda ruled that one out. If there's anything I can do to maybe help debugging this one please don't hesitate to ask. I'd gladly use the Samsung Evo for my Pi, as it shows nearly doubled 4k writes in comparison to the Sandisk while retaining good 4k reads - I'd really like to run some real world usage scenario performance comparisons on the RPi2 using those cards :) |
Hi Cy4n1d3 , If I understand correctly, you can help by testing the kernel that popcornmix posted in this thread or that is posted on OpenELEC's forum: http://openelec.tv/forum/124-raspberry-pi/75281-openelec-5-0-3-still-corrupts-sd-card-on-pi2?start=210#137875 I hope to test this kernel this weekend. |
Yes, if anyone who is suffering corruption issues can test the kernel linked earlier, or try the OpenELEC test build, that would be very helpful. |
I'll try and see if I can still reproduce the error tomorrow. |
For what it's worth I've installed the patched version of OpenElec 5.0.8 with
Tomorrow or Sunday I'll disable the debug option and send it back through some reboots and see how many I get before corruption occurs... Thank you to everyone who is working to fix this! :) Alec |
If you are happy with |
Sadly I am not happy with Don't get me wrong, it could be pure luck that 17 reboots passed without issue with 0x1fff and the 18th might have killed it just the same, but 17 compared to 4 is a big difference! Since switching back to 0x1fff I have just survived a further 10 reboots without issue. Now bed beckons (early start in the morning). If there's any further testing you would like doing then let me know, not sure I'll be able to do any until Sunday now but fire away nevertheless and I'll do my best to oblige. |
Hi AlecEdworthy, do you got your script to remotely reboot the RPi2 for me? That would save me a lot of time. Thanks! |
Okay if |
I can still confirm the corruption issues I encountered when I first tried the Samsung EVO card. Results so far:
So 1fff seems best so far, If someone is willing to share a reboot loop script I will put those modes to further testing. If you need further information or have more precise instructions please don't hesitate to ask @popcornmix ! |
For automatic rebooting (or running other command) with raspbian, For openelec I would suggest looking here: http://wiki.openelec.tv/index.php/Autostart.sh |
Could someone provide a script that reboots the rpi2 from ssh each two
minutes? In this script, we could count the timew it reboots succesfully?
That would make the testing really easy.
|
@ernstblaauw Can you run the script from a linux machine (which could be another pi)? That's a little easier than from windows. |
I just got this happening on a completely new samsung SDHC 32GB class 10 card. |
I am able to produce this consistently on a RPI3 and Samsung 16 & 64gb mSD cards by trying to use NPM to install new node red nodes and they fail. GPIO Node for example ($sudo npm install node-red-contrib-gpio or $sudo npm install node-red-contrib-mpr121) I hope this helps debug this. I'm downloading the 2016-05-10 build of Raspbian, I hope it fixes the issue. |
The Kingston SDC10G2/16GB cards seem to have a controller fault that makes the ERASE operation both slow and hazardous. The ext4 filesystem will attempt to use ERASE on nodes as they are deleted, and this can lead to corruption. The rpi-4.4.y tree contains a patch that disables erase on such cards (name="SD16G", manfid=0x41, oemid=0x3432") to improve performance and stop the corruption; a kernel including this patch is now available via rpi-update. If you have a card that seems to have the advertised capacity (passes h2testw, etc.) but gets corrupted during an update then please post your card details here, as found using:
For example, my failing card returns:
I imagine I'll need to enable the same "quirk" for additional capacities of the Kingston cards - it sounds like 32GB is affected, so perhaps "SD32G" - but other manufacturers could have the same controller. |
kernel: mmc: Apply QUIRK_BROKEN_ERASE to other capacities See: #397 (comment) kernel: New driver for the AudioInjector audio input and output card See: raspberrypi/linux#1476
kernel: mmc: Apply QUIRK_BROKEN_ERASE to other capacities See: raspberrypi/firmware#397 (comment) kernel: New driver for the AudioInjector audio input and output card See: raspberrypi/linux#1476
There is a new rpi-update release that adds a quirk to disable ERASE commands on cards with:
|
Thanks for the update, I'll try that now on a Pi 2 using a 32G Kingston:
But we also got corruptions on Sandisk Ultra 32G cards, if it's the same issue you should add:
|
I've been following this issue, and although I have not had any issues with my SanDisk Ultra 8G or Kingston 8G. I'm just curious as to why limit the patch for ERASE? Why not just patch it for everything, is there a benefit to keeping it at all? Wouldn't it be safer to just patch it out if it's an SD period and only enable it for eMMC/USB? Again I haven't had any issues I'm just curious as the include list might be harder then an exclude list is all. |
When it works, ERASE should be a performance boost because it reduces any subsequent write time. I don't think this is a Pi-specific problem, therefore it can't be so widespread otherwise ERASE would be disabled in the kernel for all SD cards, so for now I'd rather be cautious. |
makes sense, just thought I'd ask I know you guys work very hard on this and the last thing you want is a list with hundreds of cards on it that you have to maintain ;) So thought I'd bring it up to see if it made sense. |
It's not a bad idea, just one I'd rather keep up my sleeve for now. |
Still have corruption issue with 4.4.11-v7+ and Kingston SD32G after 1 week using my test program. |
I've been running archlinux arm for a long time now and I've been using the following card with a Raspberry Pi Model B Rev 2 and I haven't seen any problems. cid:4134325344333247300051861800e519 I guess the difference might be that I've been using f2fs for the root fs for as long as it has been supported in the archlinux arm kernel. If I recall correctly mmc erase support was introduced after that. As pelwell says, if mmc erase works it should be used as it helps increase write speed by avoiding an erase before a write and might also help with sd card longevity. |
@JocPelletier Could you please tell me what caused your corruptions of your SD-cards? I am having similar issues with Samsung MB-SS32SD, but dont know whats causing it. |
@JocPelletier Thx for fast answer! Could it in your opionion have to do with mono and serial-communication (we are using RS485), because we are using both. |
@SigiK I don't think so, because we have 2 services running, one managing all RS485 communications and one running a webserver with data logging. We tried to disable the data-logging on some RPi and it seems to "fix" the corruption issue. Also, my test program reproducing the issue is not using the RS485 |
@JocPelletier If you enable sqlite, does this give you 100% reliable corruption? I've seen this in the past and similarly put it down to something about SQLite hoping it would be fixed at some time in the future. When you say corruption, does this result in a non-booting system or just a system that needs to do a e2fsck at startup? |
@ghollingworth 99% Yes but it can take more than a week. But it can be NLog too because we are using it too. I've not tried to remove NLog in my test program that's why I can't say 100% yes. By corruption I mean a non-booting system. |
@JocPelletier Thx for this useful information! We used swap before, which probably also corrupted SD-cards. Anyway, we didnt have such issues with smaller (4GB) SD-cards before (having swap and logging activated). In our case it seems to be a combination of SD-card type and heavy writes to SD-card. |
When you say non-booting, how far does it get? Do you get:
|
@ghollingworthI don't remember exactly, and I'm not sure it was always the same result, but it was not 1) or 2) it was kernel panic. |
@SigiK Yes "In our case it seems to be a combination of SD-card type and heavy writes to SD-card." This is true. SQLite ist not the cause, every process using many write operations will cause corruption over time. How long it'll take is a matter of SD-Card Model (actually hardware used for this model at the time of production) and RPi firmware version. This may take from 1 day to 3 months and longer. The RPi3 is able to boot without SD-Card and the RPi2 may boot from a read-only partition of a SD-Card and use an USB Stick oder harddrive. |
It's worth noting that while SQLite isn't the direct cause, it and any other database files (including BerkDB, as well as many backends for most RDBMS software, and (rather significantly) systemd journal files) will tend to accelerate this process on many SD cards because they involve lots of internal rewrites, and most SD cards have really poorly designed FTL's that don't do a good job of wear-leveling. |
@NitroG42 Can this issue be closed? |
Oh I didn't play with my Raspberry for a long time but since user don't seems to have the issue anymore (it was working for me after the first patch I think), it can be closed ! |
kernel: alsa: Make interrupted close paths quieter See: raspberrypi/linux#931 kernel: bcm2835-mmc: Add range of debug options for slowing things down kernel: bcm2835-mmc: Default to disabling MMC_QUIRK_BLK_NO_CMD23 kernel: bcm2708-dmaengine: Add debug option for setting wait states See: raspberrypi#397 firmware: arm_loader: Changes to support bcm2835_sdhost driver
See: raspberrypi#397 kernel: bcm2835-sdhost: Adding overclocking option kernel: bcm2835-mmc: Adding overclocking option See: http://forum.kodi.tv/showthread.php?tid=224025&pid=2005396#pid2005396 kernel: config: Add CONFIG_CIFS_UPCALL See: raspberrypi/linux#968 kernel: config: Add CONFIG_FB_SSD1307=m See: raspberrypi/linux#969 firmware: di_adv: Fix memory leak of converted buffers See: raspberrypi#429 firmware: arm_display: Fix initialisation of framebuffer struct when framebuffer base is passed in firmware: hdmi: Tweak hdmi_mai_thresh for 192kHz audio See: https://discourse.osmc.tv/t/rp2-multichannel-flac-playback/2627/28 firmware: vcsm: Update to header from kernel side
Lots of people seems to be affected by an issue with sdcard.
I'm using a Samsung Evo 16 Gb micro SDCard, and using raspbian, I encounter every time corruption on the sd card.
It's easy to reproduce :
I need to check on my linux system (I'm at work) if I can fix the card at this step or not.
I flashed the raspbian img multiple times and it doesn't work.
It also can be reproduce just by making the RPI reboot multiple times through the terminal (using sudo reboot)
I have 3 of them so I hope it's just a firmware bug (I'll try with another one to be sure it' sno the sdcard itself)
Here's two threaeds that gathered this issue (without creating a post in here though :/ ) :
http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=101183&p=703772&hilit=error+110#p703772
http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=98935
One post is interesting :
If you want card info, I can give them but you need to tell what to run on which system, because I didn't find a way to print sdcard charateristics from Mac OS X.
The text was updated successfully, but these errors were encountered: