20

If I use the Pi a bit, filesystem corruption soon appears.

For instance, this file was changed to another one:

$ ls -alt  /etc/apt/apt.conf.d
total 16
lrwxrwxrwx 1 root root   13 Oct  2 22:18 50raspi -> ../init.d/ntp

Or /var/lib/dpkg/info/fake-hwclock.list became a binary file, which means dpkg can no longer work:

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'fake-hwclock' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

fsck on the filesystem finds many mistakes and send dozens of files to lost+found:

Pass 1D: Reconciling multiply-claimed blocks
(There are 34 inodes containing multiply-claimed blocks.)

File /etc/fake-hwclock.data (inode #26, mod time Thu Aug 16 02:20:47 2012) 
  has 1 multiply-claimed block(s), shared with 1 file(s):
        ... (inode #30, mod time Thu Aug 16 02:20:47 2012)

...

Inode 30 ref count is 1, should be 3.  Fix? yes

dmesg displays what looks like I/O errors:

[   49.082758] mmc0: final write to SD card still running
[   59.088233] mmc0: Timeout waiting for hardware interrupt - cmd12.
[   59.089411] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900

I tried with four different SD cards, of makes SanDisk SDHC 16 GB and Duracell SDHC 16 GB. So, it does not seem to be the card.

I also tried with Raspbian 2012-08-16-wheezy and ArchLinux 13-06-2012. Both have the same problem so I assume it is not a bug in the OS.

Following advices by @gnibbler and @Avio, i ran memtester (which, unlike memtest86 on the PC, runs after the kernel and therefore cannot test all the RAM) and it reported no problem. "memtester 200 2" -> everything OK

Following the discussion in http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=6201&start=400 , I tried from a new image with a config.txt written for a little underclocking:

core_freq 240
arm_freq 650
sdram_freq 350

but it made the problem worse (a lot of timeouts on the card)

I have only one Raspberry Pi so I cannot check with another. Known problem? Broken hardware?

bortzmeyer
  • 472
  • 2
  • 4
  • 12
  • Many thanks, @oliver-salzbug, for the edits, and sorry for the mangled output that I included. – bortzmeyer Oct 03 '12 at 06:59
  • Do you get corruption if you run it without anything plugged into the USB ports (or only a powered HUB plugged in)? What is the voltage/current rating of your power supply? – Craig Oct 03 '12 at 16:08
  • Measure the supply voltage - make sure it really is 5V and stable. Could be caused by faulty ram or something. Can you run memtest on it? – John La Rooy Oct 03 '12 at 02:57
  • I don't have a voltmeter right now (I'm not much a hardware guy). After the USB keyboard, the charger and the HDMI cable, this small and cheap Pi will become quite expensive if I have to buy a voltmeter. – bortzmeyer Oct 03 '12 at 06:17
  • Isn't the message "Timeout waiting for hardware interrupt" a clear indication something is wrong with the SDcard reader? – bortzmeyer Oct 03 '12 at 06:55
  • I do not find an image with memtest. Google does not like me or I'm not bright enough for it. Any pointer? – bortzmeyer Oct 03 '12 at 06:55
  • @Craig I have no voltmeter. And there is nothing in the USB ports (not even a keyboard, I connect via SSH). – bortzmeyer Oct 03 '12 at 20:05
  • @bortzmeyer Many power supplies list the current rating on the label. Have you tried a different power supply? – Craig Oct 03 '12 at 20:34
  • @Craig No, not yet. Only one power supply. – bortzmeyer Oct 04 '12 at 20:24
  • I'm having exactly this problem with a new 512MB board, and a known good power supply and SD card. – scruss Oct 26 '12 at 13:56
  • @scruss try playing with over_voltage? – bortzmeyer Oct 27 '12 at 17:13
  • I did, thanks. Seems to have a positive effect, though the machine's only been up 12 hours or so. Not sure why this might work. – scruss Oct 28 '12 at 13:30
  • Can you confirm that this over_voltage=2 solution made it stable, or have you still experienced any file system corruptions? I've experienced this problem twice within 24h, using 1A power supply + Kingston class 10 32GB SD card. I'm running 2013-02-09-wheezy-raspbian. Empty usb ports. Has the overvoltage lead to any heat problems? –  Mar 28 '13 at 06:38

3 Answers3

5

It may be to soon to answer my own question but, until now, the option which was the most successful was:

over_voltage=2

Until now (it's only a few days), it seems better (no corruption or card timeout yet).

I'm not an expert in power issues so, before using this on your own Pi, please do some research.

Does it mean my Pi has a voltage problem, as suggested by @gnibbler?

bortzmeyer
  • 472
  • 2
  • 4
  • 12
2

There is a really good chance that you have a problem with the RAM and, maybe, you are not experiencing kernel freezes because the Raspberry Pi's architecture is somehow tolerant to a certain degree of memory corruption.

The first thing to do is to change the memory split, reducing the video memory to the minimum, to maximize the amount of available RAM (240 MB of RAM and 16 MB of VRAM). I suggest to start over with a new raspbian, freshly copied to the SD. Then you can install and run memtester.

sudo aptitude install memtester

Here there is a small tutorial about how to launch memtester, and this is the man page. The command line should be something like:

sudo memtester 200 2

Where 200 is the amount of MB to test and 2 the number of passes. Remember that this solution works purely in userspace, so the amount of free memory is less of the amount of total available memory. If you want the exact number, type:

cat /proc/meminfo

However, given that the problem isn't in your memory cards and the Raspberry Pi is quite "monolithic", probably the only option available will be to return the Pi to your reseller.

Avio
  • 1,167
  • 2
  • 13
  • 25
1

This is a long shot, but every time I run rpi-update to update the firmware the file system gets corrupted somehow such that I can no longer create an image of the SD card using dd (see my question). I first noticed when trying to manually update the firmware to install ffmpeg and just now when omxplayer tried to update the firmware.

puk
  • 685
  • 4
  • 10
  • 26