[beagleboard] BeagleBone: mmcblk0: error -110 transferring data

using BeagleBone A5.

On the board runs:

- Ubuntu 12.04 -r1 (May 1st).
- Apache2
- MySQL
- n.2 python software that writing on DB MySQL

While testing the system I've encountered some problem with sd-card. In
particular on 2 of 10 boards in testing with not heavy load, after a few
days, the sdcard don't works correctly, making writing impossible.

Is that database stored on the SD card?

How often do writes to the database happen? How big is each write?

What SD cards are you using?

What filesystem does the database live on? ext2/3/4, btrfs, fat, etc?

What does your partition table look like?

And any other information you can provide would be helpful.

Below report some of the syslog errors:

[ 229.504821] mmcblk0: error -110 transferring data, sector 1130492, nr 8,
cmd response 0x900, card status 0x200b00
[ 233.088958] mmcblk0: error -110 transferring data, sector 1130496, nr 4,
cmd response 0x900, card status 0x0
[ 233.099548] end_request: I/O error, dev mmcblk0, sector 1130496
[ 236.672637] mmcblk0: error -110 transferring data, sector 1130497, nr 3,
cmd response 0x900, card status 0x0
[ 236.683227] end_request: I/O error, dev mmcblk0, sector 1130497
[ 240.255920] mmcblk0: error -110 transferring data, sector 1130498, nr 2,
cmd response 0x900, card status 0x0
[ 240.266540] end_request: I/O error, dev mmcblk0, sector 1130498
[ 243.839050] mmcblk0: error -110 transferring data, sector 1130499, nr 1,
cmd response 0x900, card status 0x0
[ 243.849670] end_request: I/O error, dev mmcblk0, sector 1130499
[ 247.452392] mmcblk0: error -110 transferring data, sector 1130492, nr 8,
cmd response 0x900, card status 0x200b00
[ 251.050262] mmcblk0: error -110 transferring data, sector 1130496, nr 4,
cmd response 0x900, card status 0x0
[ 251.060882] end_request: I/O error, dev mmcblk0, sector 1130496
[ 254.635406] mmcblk0: error -110 transferring data, sector 1130497, nr 3,
cmd response 0x900, card status 0x0
[ 254.645965] end_request: I/O error, dev mmcblk0, sector 1130497

Looks like your card died.
If you use this card in another machine, do you see similar errors?

-Andrew

After more research, that might not be true. But if you can reproduce
the errors on other machines (ie: not just on your Bones), then it might
be.

-Andrew

Hi Andrew,
thank you for your answer. Following the informations required:

  • Yes, the database in on the SD card.
  • The SD is the bundled 4GB by kingston.
  • DB lives on root filesystem /var/lib/mysql formatted in ext4
  • DB size is 5MB and I measured a medium write rate of 50-100 KB/s to the SD
  • The SD is 50% full so about 1.8GB is free space

Yes I’ve aleady tryed the card on another system with the same problems. The SD is dead.

Thank you for help!
Daniele

- DB size is 5MB and I measured a medium write rate of 50-100 KB/s to the SD

Is this write rate constant? Or do you have spikes of traffic like a
web server would?

Yes I've aleady tryed the card on another system with the same problems.
The SD is dead.

Are the errors the exact same -110 errors?
What kind of other system did you try? Try something that's not a
BeagleBone, like your desktop / laptop computer.

-Andrew

Write rate is pretty constant.
I read some data from the R232 on store it on DB.

I’ve already tried the SD on another BeagleBone (with exatly the same error) and on my computer with read error in the last written files.

Thanks,
Daniele

you can cache data to ram and then dump it to DB. Depending on the
cache size you can save SD card lives.

you can cache data to ram and then dump it to DB. Depending on the
cache size you can save SD card lives.

> Write rate is pretty constant.
> I read some data from the R232 on store it on DB.

Constantly writing small files on an SD card will drastically reduce
the life of the card. Each block will only take so many writes
before it won't accept new data. Cheap cards will probably perform
much worse.

Mounting with noatime or relatime will reduce atime writes, which can
help reduce overall writes. Disabling the filesystem journal is
probably a good idea. Setting elevator=noop should help prevent some
unneeded writes that some SD card controllers do, but you won't see
these at the Linux level. Caching in RAM as Maxim says is also a
possibility. If you can store your database in a tmpfs or other RAM
backed file system and snapshot it to flash every X minutes/hours/days,
that would probably be best. If you don't need persistence across
reboots for your database, just store it in a tmpfs and forget the
snapshotting.

If you can't do those things, put your database on something other than
an SD card. An external spinning hard disk or solid state disk via USB
is one option. A SAN (or NFS mount) on the network would probably be a
good choice, too.

If you really need an SD card that can handle this, you'll need to shop
around. SLC flash might get you 10x the writes of MLC flash, but
you'll pay for it in dollar cost. Maybe the upcoming eMMC / flash cape
could help here, usually eMMC devices have better controllers to
account for high write activity, but you'll pay for that, too. Raw
flash managed by Linux should have decent performance as mtd should wear
level fairly nicely.

> I've already tried the SD on another BeagleBone (with exatly the same error)
> and on my computer with read error in the last written files.

Sounds dead, then.

Regardless, you should read Arnd's flash articles:

https://wiki.linaro.org/WorkingGroups/Kernel/Projects/FlashCardSurvey

-Andrew

Thank you very much Andrew for these important informations!

A few last questions:
do you know name/vendor for a commercial SD 8GB (SLC)?
Using a larger SD could extend the total life of the card, because every free cels will be random write?
I think that bundled kindstone sd 4gb is with MLC technology, do you confirm that?

Thanks,
Daniele

mmcblk0: error -110 transferring data :

could it be a timeout problem ?
I have an SD card that cause similar problems

I have used this patch and the problem disappeared

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 690255c…0f2caca 100644
— a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -280,7 +280,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
if (data->flags & MMC_DATA_WRITE)

  • limit_us = 300000;
  • limit_us = 3000000;
    else
  • limit_us = 100000;
  • limit_us = 1000000;

HTH
Christian

mmcblk0: error -110 transferring data :

could it be a timeout problem ?

Could be.

I have used this patch and the problem disappeared

Worth a try. I'd start with a few brand new Kingston cards though, then
run the same workload on a few Bones and see how they compare with and
without that patch.

-Andrew

do you know name/vendor for a commercial SD 8GB (SLC)?

No, sorry. But if you find one, reply so we can all learn.
Be prepared to pay 5x the cost of a similar MLC card.

Using a larger SD could extend the total life of the card, because every
free cels will be random write?

Not necessarily. It really all depends on how the controller within
the card handles things. And going to a larger card may move you to
larger erase blocks, but not many more of them. It really depends card
to card and it's hard to make a recommendation here.

Card data sheets (the 50+ page version, not the 3 page version) can
help here as they should list information such as write methods and
block sizes and such. You'll probably need to sign NDAs and commit to
large order quantities to get them, though. If you're not able to do
that, buying as many as you can find that look interesting (search
Arnd's list on Linaro, previous mail had it) and test them with
Flashbench.

I think that bundled kindstone sd 4gb is with MLC technology, do you
confirm that?

I don't know for sure, but I'd assume so. Most low cost cards are MLC.
SLC is generally more expensive due to more Si == more $.

The Kingston cards that ship with Beagles aren't that great. I believe
they're procured due to availability and cost more than performance.
Kingston is more willing to sell at wholesale prices in mid-sized
batches than other vendors from what I remember.

Then again, lots of microSD cards aren't that great. It's hard to find
good ones. Samsung, SanDisk, and Trancend have a few decent ones...
usually.

-Andrew

How to properly apply this patch? --git doesn’t seem to be recognized as a valid argument?
Also, next move? Recompile core.c (how?)

Thanks.

How to properly apply this patch? --git doesn't seem to be recognized
as a valid argument?
Also, next move? Recompile core.c (how?)

That's a git diff, you should be able to apply it with either 'patch'
or 'git apply'.

Next step would be to recompile the kernel, lots of good reference
material on how to do that is available on the web.

Did you find any solution or workround?

29 Ekim 2012 Pazartesi 14:11:50 UTC+2 tarihinde Andrew Bradford yazdı: