# Jelly Bean and Data Corruption



## imnuts (Jun 9, 2011)

​
*What hardware revision do you have, and did/do you have issues with data corruption?*

Revision 9 and No issues2247.83%Revision 9 and corruption problems1226.09%Revision 10 and No issues1123.91%Revisiion 10 and corruption problems12.17%


----------



## imnuts (Jun 9, 2011)

I started to get data corruption after moving to Jelly Bean on my phone, and have found several threads of other users having a similar issue. I've also talked to someone else that had the same problem on a phone that was fully stock until JB was flashed just to try it out. With this, it seems that there is an issue in JB that is causing the problem. The other person I talked to was on a HW Rev 9 phone, as was mine. Are others that are experiencing issues with data corruption also on HW Rev 9 phones? The few threads that I've seen about this don't list what hardware revision they're using, so I'm wondering if it's isolated to one hardware revision or not. If you need to know what hardware revision you have, reboot into bootloader and it will be displayed on the screen.


----------



## Joesyr (Feb 7, 2012)

I've seen two things discussed here and there on these forums that seem ripe for causing data corruption:
-Custom kernels disabling fsync as a performance boost (notably franco's kernel, and I don't know if it's still disabled by default, or which other kernels might be doing this), with fsync basically being the safeguard against data corruption when the phone unexpectedly powers off.
-Various apps or rom components that have a shutdown/reboot button that doesn't launch the normal shutdown sequence, but just forces it.

Do you know for a fact that fsync isn't disabled in your kernel, and if the things you use to shut down/reboot the phone seem to let it close everything first, or does it seem to just kill the phone after being selected?

Haven't heard anyone talking discussing general data corruption problems with Jellybean in the time I've been following various rom threads though. For the record I have a HW Rev 9 phone and not a hint of trouble.


----------



## nhat (Aug 21, 2011)

I ran into this issue after I dirty flashed an early JB port over ICS.

I wiped everything with fastboot and flashed Paradigm. Haven't had any issues since then.

H/W Rev. 9 phone.


----------



## yarly (Jun 22, 2011)

> (notably franco's kernel, and I don't know if it's still disabled by default...


It is. He added an option to enable it though that most users will still likely not know about. Some others allow you to disable, but cannot name them offhand.


----------



## MFD00M (Aug 31, 2011)

yarly said:


> It is. He added an option to enable it though that most users will still likely not know about. Some others allow you to disable, but cannot name them offhand.


Morfic (trinity) has the option, but defaults to "safer" or you can switch "faster" via his TKT app


----------



## imnuts (Jun 9, 2011)

FSYNC was enabled on the kernel I was using, and I even tried another ROM entirely, still had the same problem. If I flashed back to ICS, the phone was usable again, but would still get random issues when trying to access /data. Go back to JB, and problem comes back.


----------



## mightybrick (Nov 2, 2011)

Revision 9 here and no issues with data corruption. Been running JB since the I/O leak.


----------



## JRJ442 (Jun 8, 2011)

I had the data corruption 4 different times on a Rev 9 phone. Flashed back to stock each time in order to get it working again. The early ported Roms were really bad for me. Not even making it 2 days without an issue. Finally just stayed on ICS until source ROMs were available. Since then I haven't had an issue with it. Thankfully.


----------



## andrewjt19 (Oct 27, 2011)

I don't see anything starting Rev 9 or Revision 9, but i do see a HW 10.

Sent from my Galaxy Nexus using RootzWiki


----------



## JRJ442 (Jun 8, 2011)

andrewjt19 said:


> I don't see anything starting Rev 9 or Revision 9, but i do see a HW 10.
> 
> Sent from my Galaxy Nexus using RootzWiki


That means yours is a hardware revision 10. Or Rev 10. However u wanna refer to it. I've since gotten a rev 10 phone. Haven't had any issues. But they've all been source built roms too.


----------



## blw1230 (Mar 5, 2012)

HW revision 9. Had JB running very well for about two weeks using XenonHD and then CNA 3.0. Flashed 3.1 and rebooted, then data was corrupt and haven't *been able to feel comfortable about rebooting since. Thought I was just about to have to break out the Toolkit right then


----------



## Knowpig (Dec 20, 2011)

Have you guys updated your boot loader to the jb boot loader?

Sent from my Liquid Galaxy Nexus on Xparent ICS.


----------



## JRJ442 (Jun 8, 2011)

To answer your question yes, but the bootloader wouldn't have anything to do with corrupt data. That's a problem a little deeper I would think.


----------



## blw1230 (Mar 5, 2012)

Knowpig said:


> Have you guys updated your boot loader to the jb boot loader?
> 
> Sent from my Liquid Galaxy Nexus on Xparent ICS.


I have updated as well


----------



## jellybellys (Apr 3, 2012)

Revision 9 and I got it once. Fastboot -w fixed it and it never happened again.


----------



## JRJ442 (Jun 8, 2011)

jellybellys said:


> Revision 9 and I got it once. Fastboot -w fixed it and it never happened again.


Yeah hasn't happened to me in a long time. I honestly think it was cuz the ripped gsm ports were screwy in the beginning.


----------



## DeeBoFour20 (Jul 26, 2012)

Well I'm not sure what exactly data corruption is or what the symptoms of it are so I'm just gonna go ahead and answer no because I haven't had any problems with JB that weren't just bugs in the ROM. Revision 9 btw.


----------



## musashiken (Jan 7, 2012)

DeeBoFour20 said:


> Well I'm not sure what exactly data corruption is or what the symptoms of it are so I'm just gonna go ahead and answer no because I haven't had any problems with JB that weren't just bugs in the ROM. Revision 9 btw.


+1.

Me too, I have no idea what data corruption is, first time hearing about it. On Revision 9.


----------



## JRJ442 (Jun 8, 2011)

musashiken said:


> +1.
> 
> Me too, I have no idea what data corruption is, first time hearing about it. On Revision 9.


Well it was like this for me, My phone would have a screen of death, so I pulled the battery. Tried to boot back up, stuck on Google logo. So I tried to restore a backup, it would restore in about 5 seconds, and the data part would be empty, as in 0 mb. Definitely not right. Wouldn't boot. Tried a fresh install of a ROM which I knew was a good download. Would fail everytime. It was like everything was borked on the SD. Not fun. I don't think it was a widespread problem, maybe 10% of the ones running Jelly Bean. Maybe less. Imnuts, have you restored back to stock to try and straighten things out?


----------



## andrewjt19 (Oct 27, 2011)

I have flashed the JB bootloader and haven't experienced one problem, not even dropped calls/data. However, I went through 3 replacement phones before I got this one....

Sent from my Galaxy Nexus using RootzWiki


----------



## yarly (Jun 22, 2011)

Just a random thought to the OP, you didn't run some ROM/Kernel that removed the fsck related disk/partition checks on boot in the fstab.tuna file by chance?


----------



## clarkkkent434 (Aug 30, 2011)

I had issue on rev9 along time ago. I just wipe my master partition.

A friend if mine is having this issue as well. He can't get anything to read the internal memory

Sent from GNex Maxx


----------



## blw1230 (Mar 5, 2012)

Yeah and as a matter of fact, I had the issue this morning as well. Make for an interesting day at work with trying to downgrade back to stock via the ToolKit and reroot, reflash everything....


----------



## abe_cedar (Jul 27, 2012)

Someone mentioned that VZW sources were released. I have only seen the binaries.
how do you guys know if those binaries made it into each custom roms? some threads spec that some don't.
I cannot get any rom to reboot more than once on twice after installing more apps.
I have tried that with JB/ICS bootloader no difference. I hope that this eon GOOG will release an image for JB for the LTE version.
That should be stable on any HW version. This is ridiculous cannot get some code to work but on a HW version???
Coming from stock should work on all HW versions.
I'll stay on ICS for now.
I use SLIM ICS 4.2. Love this rom.


----------



## imnuts (Jun 9, 2011)

yarly said:


> Just a random thought to the OP, you didn't run some ROM/Kernel that removed the fsck related disk/partition checks on boot in the fstab.tuna file by chance?


I keep the fstab and init.tuna.rc files stock, the only change that I've made to the boot sequence is using CM's system/core/ stuff, so there are a couple changes to init.rc, but nothing major or data threatening. I also experienced the same issue on both my own ROM/Kernel as well as another JB ROM/Kernel combo. Same files flashed to a different phone didn't cause any problems. It was specific to my device and Jelly Bean.

Seeing that others here have had the same issue, and so far, everyone with a revision 9 phone, makes me think that it has to do with something different between revision 9 and 10. I tried the same thing as others here with wiping everything via fastboot, which helped with the problem briefly, but then it came back.

My issue, as I found out with adb in recovery, was that something was getting corrupt on the /data partition, preventing it from being mounted read-write. Running e2fsck manually allowed me to fix it without data loss and reboot normally. The longer I left the phone on, the more issues would have to be fixed with e2fsck in recovery, suggesting that whatever caused the issue got worse over time.


----------



## Smcdo123 (Jun 7, 2011)

HW rev 9. Never had an issue. I installed the test builds of JB and most of the ROMs out there now. I've never had an issue with my phone knock since release day knock on wood.

Sent from my Galaxy Nexus using RootzWiki


----------



## Smcdo123 (Jun 7, 2011)

Is there even another revision for the LTE model anyway?

Sent from my Galaxy Nexus using RootzWiki


----------



## kauthor47 (Jun 7, 2011)

hw 9, this happens to me every time I use a reboot button. If I shut down and reboot by hand, no problems. I've been running JB and the most up-to-date bootloader since the I/O leak. I've tried different ROM's and they all do it. It makes me paranoid.


----------



## Smcdo123 (Jun 7, 2011)

Only thing I get is a long boot once and a while but advice for anyone worried about data corruption make a backup and put it on a computer or something at least if it happens in say a week after your backup youll still have some of your pictures music etc

Sent from my Nexus 7


----------



## JRJ442 (Jun 8, 2011)

Smcdo123 said:


> Is there even another revision for the LTE model anyway?
> 
> Sent from my Galaxy Nexus using RootzWiki


Yes. There was 8. Pre release only a few people have. 9 which was out on release day, and 10.


----------



## blackadept (Jun 13, 2011)

What did you change in your init.rc? Was the change made pre-ROM-compiling (as in you compiled the ROM yourself and altered the source code), pre-kernel-compiling (same as last), pre-ROM/kernel- flashing (same as prior two except you just changed the .zip files), or post-ROM/kernel-flashing (used some flashable mod or altered directly with root explorer or something)? Did you change any other init files or just the init.rc?

Data corruption is caused usually by either I/O or sqlite "mods"/problems. That said, altering the init files can cause it as well depending on what you change and how you do it.


----------



## kauthor47 (Jun 7, 2011)

I just had a really bizarre experience. Upon flashing a new ROM, when rebooting, I got into Android no problem. Upon a test reboot to see if I had this problem, my fears were confirmed when I hit the 10 minute mark of staring at the Google logo. I rebooted into CWM 6.0.1.0 and wiped data and cache, and rebooted phone. It almost instantly went from "wiping /data" to "wiping cache." Too fast to be normal. Formatting the data partition isn't supposed to be instantaneous.

I rebooted from CWM and sat at the Google logo again... my fears still confirmed. However, after a battery pull and cold boot, I got in. But, my data was still there - text messages received while setting up the new ROM, icon placement of the few apps it downloaded, etc.

Did anybody ever get any farther with the data corruption research, like figuring out why it happened or any fix for it without having to fastboot the factory images? It sucks having to use that or to have to make sure I never turn my phone off just to avoid the possibility. I'd consider looking into it myself but I have no idea where to start for such a thing.


----------



## nize2beme (Jan 3, 2012)

third time this has now happened to me, getting irritated. I believe I also have had this issue on my nexus 7, but can't remember ATM. any reports from GSM having this issue?

I just restored, locked and unlocked, wiping everything in the process. 24 hours later had the issue come back! in the meantime I only installed CM10, latest LEAN, and then latest Trinity kernel. After reboot this started again, won't wipe data correctly. and sits at Google logo for 10+ min. before it boots, if it even boots.

Ran all three recoveries as I thought that might be the issue also. only other thought was maybe corrupt NAND?


----------



## nize2beme (Jan 3, 2012)

Perhaps this is why Verizon never pushed the JB update? HAHA.... ok another thing I noticed is if it's really hosed, it takes a while even to boot into recovery, TMRP will sit on the splash screen for a while. and if I hold down all buttons to enter bootloader, it vibrates and takes like 5 seconds for anything to come on the screen. UGH... ok here is what I did so far to try and write enough to the blocks, that if something was bad it would flag and finally install correctly (assuming it's nand issues):

Steps I took tonight to hopefully fix it. Not recommending it to anyone as you could mess up the partitions...
fastboot -w (3 times)
wugs restore to 4.0.4,
oem lock unlock the lock again
odin to 4.0.2 (twice)
wugs restore to 4.0.4
wugs root again

Booting into bootloader and recovery still are slow, so I think this didn't fix it....

flashed newest CWM touch and adb:
e2fsck -f -c -y /dev/block/mmcblk0p12
everything still looks good so i give up.... Going to run 4.0.4 for the next day and then move back JB and see if I get it again

*I almost said screw it time for a new phone after typing this up... but I love this phone and finally have a good screen after months of use that no longer is banded,etc. sooo.... I'm digging deeper into this. I am pulling the whole filesystem, and will check init, etc. once I reproduce this, which it looks like my phone is the perfect candidate to reproduce this haha! once I find what is changed I will try to backtrack and find how it is being changed and report back here. 

All this work to fix 5 of us with bad ver 9 phones ;-) HAHA


----------



## nize2beme (Jan 3, 2012)

Ok reproduced, comparing full filesystem (/) from before and after showed nothing really, my recovery log after it fails to mount data can be seen here: http://pastebin.com/BYzXh6iF

can't run [background=rgb(245, 245, 245)]e2fsck -f -c -y /dev/block/mmcblk0p12 as it says system is busy...[/background]


----------



## nize2beme (Jan 3, 2012)

in order to finally get this to happen actually my final build was CM10 with newest Trinity kernel, installed only trinity's tool and couldn't reproduce after rebooting everywhich way. So then I installed Franco's tool and rom toolbox, flipped through all the kernel options with all given root perms and it then lead to this hang on the next boot. (never changed kernel). So i definetly think it has something to do with the kernel / these apps since this is how I remember it happened the last two times I did this also.

Can anyone confirm this, perhaps on HW ver 10? I know I have done this on multiple ROM builds, but I'm going to wipe then reproduce on dif roms, kernels, etc. and hopefully find the exact combinations causing it. unless someone else has insight on an easier way to log in


----------



## nize2beme (Jan 3, 2012)

ok through more and more tests I'm not able to reproduce this in every instance. I am noticing a long time to boot the first time after making certain changes in the CM options, and I wonder if perhaps each time I pulled the battery too soon at the wrong time causing the corruption. Often it has been reported that it takes a while, in my case 5 -10 minutes, often to boot. It just hangs on the Google screen, which I am accustomed to thinking is a problem resulting in a battery pull, and a corrupt data partition. I am starting to wonder if this is the cause, and not actually a setting.

As described before by others, the data partition is there, and you can see it in recovery, but it's read only. If you unmount it, you often can't remount it until you've rebooted. You can't wipe it, etc. via ADB or recovery, I'm assuming this is because it is corrupt or was unmounted correctly.

Pushing the img or wiping it via fastboot fixes the issue though and you can boot right back into the system (in essence it performs a factory reset but also wipes sdcard).

If I notice anything else I will try and update here, but as of now, this is as much as I can tell. I don't like reviewing stuff like this by testing, without logs I waste hours of my day trying to track something down. Sorry for hijacking the thread also, hope more news on this from other users is posted here, and we start uncovering more on it.

*** curious to try this again also on my nexus 7 as i'm almost sure I've had this issue twice before.


----------



## nize2beme (Jan 3, 2012)

UPDATE: 
just reproduced on CM10 with lean's exp kernel and franco app only installed.... I pulled after a minute of it sitting at the google screen (yes I could have let it sit there and it might have finished booting). then booted into recovery, stuck at splash screen (happens sometimes and i assume this is a hint it's corrupt) and recovery.log shows just this:

Starting TWRP "2.2.2.0" on Sat Jan 1 00:00:01 2000
Loading volume table...
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /system ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system (null)
2 /cache ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache (null)
3 /data ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata (null)
4 /misc emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/misc (null)
5 /boot emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/boot (null)
6 /recovery emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/recovery (null)
7 /sbl emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/sbl (null)
8 /xloader emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/xloader (null)
9 /radio emmc /dev/block/platform/omap/omap_hsmmc.0/by-name/radio (null)
10 /efs ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs (null)
11 /usb-otg vfat /dev/block/sda1 (null)

I:Internal path defined: '/data/media'
I:External path defined: '/usb-otg'
Ievice has crypto support compiled into recovery.
Pixel format: 720x1280 @ 32bpp
Pixel format: BGR_565
framebuffer: fd 3 (720 x 1280)
I:=> Installing busybox into /sbin
ln: /sbin/mke2fs: File exists
ln: /sbin/sh: File exists
ln: /sbin/tune2fs: File exists
I:=> Linking mtab
I:=> Getting locations
Wevice does not support /proc/emmc
* Verifying filesystems...
I:=> Created /efs folder.
* Verifying partition sizes...


----------



## akellar (Jun 11, 2011)

It's pretty much been established that pulling your battery while on the Google screen causes corruption more often than not. Let it boot.

Sent from my Galaxy Nexus using RootzWiki


----------



## yarly (Jun 22, 2011)

> ok through more and more tests I'm not able to reproduce this in every instance. I am noticing a long time to boot the first time after making certain changes in the CM options, and I wonder if perhaps each time I pulled the battery too soon at the wrong time causing the corruption. Often it has been reported that it takes a while, in my case 5 -10 minutes, often to boot. It just hangs on the Google screen, which I am accustomed to thinking is a problem resulting in a battery pull, and a corrupt data partition. I am starting to wonder if this is the cause, and not actually a setting.


I can't see how anyone finds it surprising that doing the phone equivalent to pulling the plug on your desktop PC could lead to data corruption (windows users have probably experienced this by the checkdisk that runs on improper shutdowns). Data does not always get written totally to a permanent store when power is suddenly lost on an electronic device and the drive needs to be scanned for corruption and problems potentially fixed by fsck.

It's generally not a big deal as mentioned above if you let it do what it needs to...well unless one uses a kernel with fsync disabled by default (franco) or disables it on others that give the option to do so. If disabled, you're probably screwed.


----------



## JRJ442 (Jun 8, 2011)

yarly said:


> I can't see how anyone finds it surprising that doing the phone equivalent to pulling the plug on your desktop PC could lead to data corruption (windows users have probably experienced this by the checkdisk that runs on improper shutdowns). Data does not always get written totally to a permanent store when power is suddenly lost on an electronic device and the drive needs to be scanned for corruption and problems potentially fixed by fsck.
> 
> It's generally not a big deal as mentioned above if you let it do what it needs to...well unless one uses a kernel with fsync disabled by default (franco) or disables it on others that give the option to do so. If disabled, you're probably screwed.


Actually fsync is enabled by default with Franco. Has been for a while I believe. Its always checked as being enabled in the app anyway.


----------



## rester555 (Jul 20, 2011)

I had the data corruption issue when running AOKP with their earlier builds. As I installed newer versions, I didn't have the problem anymore. Couldn't pinpoint the problem... I am glad more people are talking about it.


----------



## yarly (Jun 22, 2011)

JRJ442 said:


> Actually fsync is enabled by default with Franco. Has been for a while I believe. Its always checked as being enabled in the app anyway.


You must have enabled it at some point. His source code commits still show it as disabled by default:

https://bitbucket.org/franciscofranco/android-tuna-omap/changeset/0ff63ac5e0a3


----------



## JRJ442 (Jun 8, 2011)

yarly said:


> You must have enabled it at some point. His source code commits still show it as disabled by default:
> 
> https://bitbucket.org/franciscofranco/android-tuna-omap/changeset/0ff63ac5e0a3


I don't think I did. I switched back to Franco and it was already checked in his app. Maybe I was drunk. Not sure. Lol


----------



## nize2beme (Jan 3, 2012)

akellar said:


> It's pretty much been established that pulling your battery while on the Google screen causes corruption more often than not. Let it boot.
> 
> Sent from my Galaxy Nexus using RootzWiki


I understand this, I think however the real problem here for me, and I'm sure I'm the only one. I like to flash different kernels, use kernel progs. to change settings in one kernel, but maybe not the next one, etc. Doing all this often resulted in a boot loop in the past, and in some cases it wouldn't boot past the Google screen. Now when doing this w/ JB I am forced to wait a lot longer than before to ensure it's not just taking it's time. Add the fact that if you didn't upgrade your Bootloader it takes even longer for JB ROMs, and you have the reason why I have corrupted my data on so many occasions w/ JB. I know the first night JB was released we also worked on getting it ported to the Nexus, and MANY people were reporting corruption and bootloops as a result, with no reasoning behind it. I now can see that there is a good chance after about 2 minutes someone would assume it not working correctly and pulling the battery, just to lead to total corruption of the Data partiton


----------



## Mattcrecelius (Feb 15, 2012)

Why does 4.1.1 take so damn long to boot? Seriously, it takes my gnex 5 minutes to boot up.

Any ideas?

Sent from my Galaxy Nexus using Tapatalk 2


----------



## akellar (Jun 11, 2011)

Mattcrecelius said:


> Why does 4.1.1 take so damn long to boot? Seriously, it takes my gnex 5 minutes to boot up.
> 
> Any ideas?
> 
> Sent from my Galaxy Nexus using Tapatalk 2


Search is your friend. It's been answered a million times.

Sent from my Galaxy Nexus using RootzWiki


----------



## scar45 (Feb 29, 2012)

Oh man, I am running an HW 9 version, and running into similar problems







Today my phone just randomly rebooted, and would continue to bootloop about 5-10s after it vibrates to signify the start of a boot.

I tried a few things, but ended up flashing the stock factory restore images (for JB + ICS), locked the bootloader, but the same thing still happens! I see the stock Nexus bootanimation for about 5s then the phone reboots into a vicious cycle.

I thought it may have to do with a corrupt userdata partition, but the factory reset also formats and repartitions that...Again, using HW v9, but not sure which steps to take from here. I have a backup of /data/media, so any data on the phone is of no concern to me.

Many thanks in advance for any help, but chalk up another HW v9 with the problem!


----------



## sonicxml (Oct 1, 2011)

yarly said:


> You must have enabled it at some point. His source code commits still show it as disabled by default:
> 
> https://bitbucket.org/franciscofranco/android-tuna-omap/changeset/0ff63ac5e0a3


His source code is on github now 
https://github.com/franciscofranco/Tuna_JB_pre1/commit/5f933ccc29a02c82f48a503e1cbf9c919507876e


----------

