maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Pi keeps corrupting filesystems

Fri Oct 12, 2012 5:41 am

every now and then after shutting the Raspi down neatly with a halt or reboot command it loads up with a corrupted filesystem (system partition). As far as I know during operation the file system is not getting corrupted and the Pi runs stable. I've never overclocked it.

I'm using Raspbian wheezy and my only main change to it is that I created a 2nd ext4 partition for mp3's and videos and I added it to the mountpoints in /etc/fstab. When the system partition gets corrupted often both ext4 partitions their filesystems are corrupted. (files being crosslinked etc.)

This problem is really disheartening me since everytime I loose work and time by needing to restore a backup. I don't think alot of people have this otherwise I would've read or heard from it. So my question now is :what is wrong that I got this kind of trouble with the Pi ?

Details about my setup:

-Raspberry Pi 1st version

-Ultron UHN-710 powered hub (on verified pheripherals list)

-only the hub connects to one of the raspi usb ports and in the hub is the mouse, keyboard and wifi-dongle

-I'm using raspbian wheezy from September 18 and used rpi-update

-SDHC card : Extremememory 32GB class 10 with id= man:0x000003 oem:0x5344 name:SMI hwrev:0x1 fwrev:0x0 which is exactly the one from the verified pheripherals list

-1.2A (1200ma) power supply selected especially for the Pi by RS components

pictures of the PSU:
Image
Image
Click to see the same pics larger:

http://i1152.photobucket.com/albums/p49 ... G_3672.jpg
http://i1152.photobucket.com/albums/p49 ... G_3673.jpg

vjacobs
Posts: 2
Joined: Fri Oct 12, 2012 10:31 pm

Re: Pi keeps corrupting filesystems

Fri Oct 12, 2012 10:38 pm

Going to chime in here to add that I have exactly the same problem. Tried with two different SD cards. The first time my install worked for over a month, when suddenly data started disappearing.
I have a CalDAV server running which is powered by PHP. Out of the blue it stopped working and gave syntax errors on the scripts (which is really weird because they worked fine for a long time). I ran diff on the file which was causing the error with a clean source version. Turns out 20-some lines just vanished into thin air. Replaced the file, worked like a charm!
Few days later I was logged in over ssh when suddenly I got segfaults on every command I ran, was even impossible to reboot from command line...
Second install had same problem but only after a few hours of uptime. Pulled the plug and refused to boot, screen said it was unable to mount root partition. Just tested both SD cards and they are fine.

EightBitTony
Posts: 2
Joined: Fri Nov 02, 2012 10:40 am

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 10:44 am

Same issue here. First generation model B's (two of). Both have corrupted the filesystems on their SDHC cards.

In the first instance, the Pi was sitting on a desk, powered up, but doing very little for about 3 days, on the 3rd day I could no longer ssh in. As the device is headless, I power cycled it, and it would no longer boot. Booting when connected to the TV showed it couldn't mount the root filesystem, and further investigation showed that filesystem to be hugely corrupt.

The second Pi was working fine, I plugged in a USB thumb drive, carried out a reboot (from the command line), and it never came back. Again, corrupt filesystem.

It appears any fluctuation in the power at all might result in a corrupt filesystem. Makes it very hard to trust the Pi to do anything at all, very disappointed.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 12:14 pm

It indeed doesn't seem to happen very frequently, but it's a scary issue.
The only writing that needs to be done to the Pi root fs in most occasions are the logfiles.
Maybe something is happening to the Pi OS that causes excessive writing to those.
I use the same RS power adapters.
I ran some tests with the watchdog to see if it would corrupt the sd card and didn't had the issues.
A watchdog reset still isn't the same as a Power dip.
Maybe opening an ssh window and monitoring the dmesg could make us wiser?

Wanderlei
Posts: 79
Joined: Tue Aug 21, 2012 2:01 pm

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 12:21 pm

Sorry cant help but I did experience files being corrupted being caused by overclocking the gpu. (cpu and ram overclocked no problem and other board is fine with gpu overclock)

vjacobs
Posts: 2
Joined: Fri Oct 12, 2012 10:31 pm

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 1:07 pm

I've narrowed my issue down to, indeed, overclocking. I've reinstalled my rpi without overclocking this time, and it's been running for over three weeks without any troubles.
If I find the time I'm going to do a stress test when it's overclocked to see if this is actually the case.

HenryG
Posts: 28
Joined: Sat Sep 10, 2011 3:15 pm

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 8:28 pm

I've subjected my Pi to rebooting tests, and at the end the rootfs on the SD always gets corrupted: http://www.raspberrypi.org/phpBB3/viewt ... 28&t=21385

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

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 9:08 pm

vjacobs wrote:I've narrowed my issue down to, indeed, overclocking. I've reinstalled my rpi without overclocking this time, and it's been running for over three weeks without any troubles.
If I find the time I'm going to do a stress test when it's overclocked to see if this is actually the case.
Yes, core_freq above 250 does cause sdcard corruption for some users. Because of this, the latest image only increases core_freq on the highest overclock setting.
You are recommended to only try turbo on a backed up sdcard (or a newly imaged one), just in case there are problems.

User avatar
openloopx
Posts: 17
Joined: Wed Sep 26, 2012 2:52 pm
Location: Surrey, England

Re: Pi keeps corrupting filesystems

Fri Nov 02, 2012 9:25 pm

I've also had similar corruption problems. The first time, the system froze and on re-booting I had the error message: PANIC: stack-protector; Kernal Stack is corrupted in c059e4e8. The 4Gb SD card I was using was that provided by RS with Rasbian wheezy pre-loaded. The power supply was also RS provided. I bought another 4Gb card and re-loaded a fresh OS using berryboot. This worked OK for a few days before crashing in a similar fashion. At the time, I had walked away from the desk for a few minutes and when I returned the system had hung. So another OS re-load, which is what I am using to send this post, and waiting for the next crash.

jblackburn
Posts: 3
Joined: Sat Jun 09, 2012 2:01 pm

Re: Pi keeps corrupting filesystems

Sun Nov 04, 2012 5:24 pm

I'm seeing corruption as well :(

I'm using raspbmc RC5, and have reinstalled several times today. The corruption seems to occur on reboot -- at least it runs fine until I try to restart it. raspbmc doesn't have the dynamic overclock functionality enabled, though it does overclock to 800Mhz out the box.

Previously I had no corruption at all, so I wonder whether there's been a regression in the kernel / firmware that might cause this?

User avatar
openloopx
Posts: 17
Joined: Wed Sep 26, 2012 2:52 pm
Location: Surrey, England

Re: Pi keeps corrupting filesystems

Sun Nov 04, 2012 6:31 pm

Touch wood, no further crashes with new (Integral) SD card. I re-flashed the RS (Transend) card with a new OS and this worked OK until I tried WiFi setup, when system then hung and would not re-boot. I am used to Windows XP crashing, but it always re-boots without having to re-install the OS. So I wonder what's happening with Pi? Maybe its just a faulty SD card.

theoduino
Posts: 1
Joined: Thu Jul 19, 2012 8:42 pm

Re: Pi keeps corrupting filesystems

Sun Nov 04, 2012 7:24 pm

My raspberry pi is reporting a corrupted ext4 partition on reboots. It is only happening with the 2012-10-28 Raspbian

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

*update* Re: Pi keeps corrupting filesystems

Sat Nov 10, 2012 1:29 am

I'm finally confident about the following:

I got 2 Raspberry Pi's of the first generation. One I purchased from Rs Components and one from Element14.

I have made a script that logs in the Pi with Putty and edits a file on /boot and one on /etc (it just adds a comment each time) and then sends a reboot command.

When running the script while the Pi from Rs Components is booted it fails every now and then (corruption of the filesystem). It fails well before 30 tries. At that moment the Pi only had a mouse and keyboard in its USB ports.

Now when running the script while the Pi from Farnell is booted it has run for 224 ! times without failure and then I aborted the script.

I'm using exact the same Power adapter and SDcard (identical contents).

It looks like Pi from RS is faulty but it will be hard to prove this to Rs Components :(

I suspect everyone in this thread is having a faulty Pi. Maybe it has to do with the brand of memory. My Pi of Rs Components has Hynix memory while the Element14 one has Samsung memory.

The bad news is that Quake III crashes on the Element14 Pi while working fine on the Rs Components Pi so neither of my Pi's is 100% fault free :(

EDIT: I forgot to say that neither of my Pi's is overclocked

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: Pi keeps corrupting filesystems

Sat Nov 10, 2012 3:05 am

Swap the cards between the two, does it make a difference?

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Re: Pi keeps corrupting filesystems

Sat Nov 10, 2012 3:28 am

Dilligaf wrote:Swap the cards between the two, does it make a difference?
swap ? I used the same card (and same content) on both Pi's. I powered them up one after one and just changed all wires and the card to the other Pi

minaya
Posts: 2
Joined: Mon Mar 11, 2013 9:14 pm

Re: Pi keeps corrupting filesystems

Mon Mar 11, 2013 9:21 pm

Any progress on this issue?

I've also a *recent* (ordered in Dec. 2012) RS raspi and after ~15-20 days of uptime system with a SD card (16gb class 6) raspberry pi eventually remounted it as read-only and after a reboot, it was heavily corrupted. I checked with fsck in my laptop and nearly all block were wrong!.

Now, even if I remake the partition table with cfdisk+mkfs or gparted, it corrupts this SD card after a reboot or two.

The system was installed using the raspbian "debian installer" and I didn't set any overclock at all (just use the default config).

fradeve
Posts: 2
Joined: Thu May 16, 2013 3:14 pm

Re: Pi keeps corrupting filesystems

Thu May 16, 2013 3:18 pm

Exactly same situation as Minaya. So, it appears I've spent 50 euros in a faulty device. Very disappointing, now I have a brick, more or less.

Any progress on this issue?

Should we complain about this with the reseller -- RS Components?

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Pi keeps corrupting filesystems

Thu May 16, 2013 5:26 pm

There isn't any progress on the issue because it maybe isn't a widespread problem.

Some people have this problem, personally I've 5 Pis and I've never suffered a corrupted file system in over 12 months of running Pis, despite all of the Pis at sometime or another had an 'unsheduled shutdown' (deprived of power without a clean shutdown ).

I've never ventured into the dodgy territory of Class 10 cards or using cards larger than 8GB, which is maybe the secret or I'm just incredibly lucky..........

Decent power supplies that gives very close to 5V at the test points, Class 4 Sandisk 4 & 8 GB cards, limited overclocking (1 or two are running at 800 Mhz). Thats about it.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

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

Re: Pi keeps corrupting filesystems

Fri May 17, 2013 12:01 pm

Our best guess is that a bad power supply can produce sdcard corruption.
This is specifically the 3.3V supply. It is mostly down to how noisy the 5V supply is, although the tolerances of the regulators on the specific board do have some effect.

You can identify a noisy 3.3V supply by playing silence through analogue connection. With the new "de-popped" firmware, this will occur after playing the first audio file.
Listen carefully with headphones. With a good power supply, it should be virtually silent. If it clicks and buzzes as work is done, then you have noise on the supply
Running something that uses lots of power will increase the load and hence the noise on the supply. Overclocking will add to this.

If you have multiple power supplies, listen for the quietest one, and then see if sdcard corruption is reduced.

englebert
Posts: 1
Joined: Tue Aug 26, 2014 7:24 am

Re: Pi keeps corrupting filesystems

Tue Aug 26, 2014 7:31 am

I am having the same issue and I had fixed the issue. My capacitor was torn off from the board. I though it was not important. The issue happened is quite random and also depending on the type of SDCard you used too. Until I checked the voltage was a bit unstable.

Every reboot the whole sdcard image will gone and I thought of must be my SDcard is near to end of life. I switched to another SDcard and it works again but random effect where not everytime it will crash the whole sdcard. Till I get another raspberry pi board and it works like a charm. Then, I noticed that the capacitor was off from my board and quickly get the capacitor replaced and now my board is recovered.

The sdcard no longer corrupt after the capacitor is replaced back and I had tested rebooting it without any issue. I hope this will help others that having this issue.

Return to “Troubleshooting”