Dirty vs Clean Flash

Search This thread

papadelogan

Senior Member
Apr 26, 2012
76
20
I tried a dirty flash once, just to see.... and I won't bother with it again. I'll do it clean, every time. I have Nova Prime so my desktop icons, etc. are restored, plus I use MyBackupPro and that will restore System Setting and Android Home, so my setup time isn't too bad. Plus I know I'm reducing my likelihood of issues, and the extra setup time isn't really that much and it helps me find new things in the updated version.
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
A dirty flash is only wiping cache and davlik then flashing your ROM....

a Clean flash is at LEAST factory reset/data wipe + wiping davlik(factory wipe takes care of /cache also)... Maybe doing a format /system also.


SO let the games begin! Which is better?! FIGHT!!

...
If you're going for an update from the same project - even your definition of "dirty" is too much.

e.g. if you're going from one CM nightly to another, or one Omni build to another, etc - If you even have to wipe cache/dalvik, someone screwed up.
 

optimusodd

Senior Member
Mar 15, 2011
660
165
So the Clean Flash is :

Format system > Wipe Dalvik cache > Wipe data/factory reset > Flash Rom, Flash Gapps etc > Fix permissions > Reboot.........Right ?

Is "Fix permissions" necessary ?

What if we are taking nandroid backup ?
a)Of the current ROM
b)Of different ROM

Are we supposed to wipe or format anything ?AFAIK,Recovery automatically does it.But I have also heard that we need to wipe cache partition and dalvik cache after the nandroid backup is restored to make sure that the restored state can be recovered correctly and is not affected by cache issues :confused:
 
Last edited:

Hans5849

Senior Member
Apr 11, 2012
261
39
So the Clean Flash is :

Format system > Wipe Dalvik cache > Wipe data/factory reset > Flash Rom, Flash Gapps etc > Fix permissions > Reboot.........Right ?

Is "Fix permissions" necessary ?

What if we are taking nandroid backup ?
a)Of the current ROM
b)Of different ROM

Are we supposed to wipe or format anything ?AFAIK,Recovery automatically does it.But I have also heard that we need to wipe cache partition and dalvik cache after the nandroid backup is restored to make sure that the restored state can be recovered correctly and is not affected by cache issues :confused:

Fix permissions is unnecessary and not an option in some recoveries anymore. It was a carryover from the times before android supported moving apps to the external sd card.

Nandroid first to backup your current setup.

Personally if I'm restoring a old backup I'll wipe and format everything first then restore the backup.
 

xs11e

Senior Member
Oct 5, 2010
752
126
Phoenix
If you do a dirty (no wipe anything) flash, and it doesn't work, have you tried slipping in a wipe dalvic, cache before you do your clean wipe to see if that works? or do you just go straight to a clean flash if your dirty flash fails?

I never tried that, I just go straight to a clean flash if the "wipe-nothing" flash fails.

Sorry to be so long in answering, I've been away from my S3 for several months but I'm back, now.
 

beepea206

Senior Member
Mar 18, 2011
959
218
I only dirty flash (just a dalvik & cache wipe), unless I'm doing one of the following:
- Going from 4.3 to 4.4 (and vice versa)
- Going from AOSP to CM base (and vice versa).

You only need to wipe data (factory reset) when you're flashing different framework, like an upgraded version or a different base (CM/AOSP). I'll only wipe data if there are issues with the function of the rom and I use it for troubleshooting only. The data wipe only zaps apps, app data and system data associated with the framework, so if there's no substantive change to framework, you don't really need to wipe that partition. If you know what you're doing, you can wipe only when necessary.

You should ALWAYS wipe dalvik and cache... because you should allow the new rom to build up that dalvik cache, rather than carry over from a previous rom. Many bootloops are caused by old dalvik data. We should probably be clear you don't need to 'format' to flash a new rom, only 'factory reset' or 'wipe data', which clears the data partition, rather than wipe the internal memory.

HOWEVER... as someone that compiled and posted CM builds in the past, if you dirty flash, DO NOT go into a development thread and whine about a rom not working. Make sure you've wiped data and maybe even reflashed after a full wipe before you do so. People that dirty flash and complain about roms not working only piss off devs. :)
 
Last edited:
  • Like
Reactions: KanD93
P

playdoc

Guest
Thanks to the useful posts! I tried to get SlimBean 4.3 on my Samsung Nexus S 4G (I know, I'm in the wrong forum). But when the phone booted up, it was stuck on the activation screen. I then cleaned flash everything to start over. This time, I put an AOSP ROM on first, then did a dirty flash (just a dalvik & cache wipe), before flashing the SlimBean 4.3 ROM on. This time, after reboot, I was easily able to get past the activation screen, and the ROM's been running smoothly so far. I never did a dirty flash before, always a clean flash. But, this experience has opened me up to doing dirty flashes, when needed, now. Thanks again guys!
 

beepea206

Senior Member
Mar 18, 2011
959
218
Yea, devs don't ever want you to dirty flash, especially if you're going to report issues, but if you're mindful of the framework/version you're going to/from, you can generally dirty flash and be fine.

FYI, you will most certainly have bootloops if you try to go from CM10/CM11 to an AOSP-based rom; I've tested and confirmed. Always full wipe if making a jump like that. :)
 

twistedillutions

Senior Member
Mar 7, 2013
3,036
476
209
All this time i thought I was doing clean flash
wipe catche dalvik then flash new version of rom (liquidsmooth)
i do factory reset /clean flash wen i got to a different rom
also learn that i had to clean flash wen i went from 4.3 to 4.4 on the same rom
 

KanD93

Senior Member
Sep 27, 2013
121
51
AFAIK, AOSP means pure android and all ROMs are based off AOSP. So that way CM = AOSP.

I think you should have rather compared going from CM to AOKP and not AOSP.
 

dbus08

Member
Feb 11, 2011
11
1
I just dirty flash unless switching android versions. I throw an occasional clean flash in just because it helps me get rid of stuff I never use but never really noticed until I can't remember what went here.
 

wanerza77

Senior Member
May 7, 2013
85
19
Sarcasm? Lol cuz #'s 1 and 2 are the same, they are dirty flashes. As for #3, format data before flashing the rom but yes that's a clean flash.

Sent from my SCH-I535 using xda app-developers app

That mean if I'm from rom v1 to v2 I'm just wipe cache & flash the v2 rom without flash the gapps? Aren't Im right?

Sent from my GT-I9300 using XDA Premium 4 mobile app
 

Bramton1

Senior Member
Apr 13, 2011
218
41
Columbia, MD
I usually play it safe and do a clean flash almost regardless. The only exception is nightlies. Even then, I won't sorry flash more than a few nightlies without a clean flash (this is probably why I shy away from ROMs with nightlies).

I just upgraded Bean Stalk from one version to a newer version a month and a half later. Did a clean flash.

Sent from my SCH-I535 using XDA Premium App
 

jdip

Senior Member
Jun 10, 2013
69
7
I read this whole thread and am still confused...

Does restoring to factory settings in TWRP, then flashing a ROM count as a clean install? Or do I have to manually wipe cache and dalvik manually in addition to restoring to factory settings?
 

twistedillutions

Senior Member
Mar 7, 2013
3,036
476
209
I read this whole thread and am still confused...

Does restoring to factory settings in TWRP, then flashing a ROM count as a clean install? Or do I have to manually wipe cache and dalvik manually in addition to restoring to factory settings?

Factory reset fall in dirty flash. At least from my understanding. Cuz some partitions still may or will stay on ur device. Wen it comes to clean flash u do a formating. Everything gets wipe.
But if u were to do flash rom then flash factory settings then it will be clean flash. Idk if that even works well

Sent from my SCH-I535 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    A dirty flash is only wiping cache and davlik then flashing your ROM....

    a Clean flash is at LEAST factory reset/data wipe + wiping davlik(factory wipe takes care of /cache also)... Maybe doing a format /system also.


    SO let the games begin! Which is better?! FIGHT!!

    ...
    18
    Wipe data? What's that for? Is THAT why my phone won't turn on.......... :p

    Nightlies: No data wipe (yes to cache/dakvik)
    New rom, even if it's the same android build: always, full wipe
    Themes: No wipe at all, flash right on, right after flashing rom's. Don't like to wait for two bootups!

    Sent from my SCH-I535 using xda premium
    6
    why do so many folks wipe cache and dalvik after they wipe data? A data wipe/factory reset wipes all three, there is no need to do anything else.

    I always wipe data, flash rom, then advance restore data only from a nandroid...dirty flashing in its most elegant form ;)

    Factory reset doesn't touch the davlik(Which I speculate(Guess) has to do more with the kernel than anything)

    So we all agree that a dirty flash is just wipe cache/dalvik cache.

    Do you wipe prior to re-flashing, or afterwards? Does it matter?


    Sent from my SCH-I535 using xda app-developers app
    This is what I meant as a dirty flash when I made the thread yes...

    What about flashing a new, updated kernel for a rom you're currently using? What steps should be taken for that? For example, cleanrom 2.1 comes with cleankernel 1.1, but the kernel has been updated to 1.2 and is out as a seperate download. How would you update just the kernel that's made specifically for the rom you use?

    Usually when I flash a new kernel, or a different kernel, I just wipe the davlik cache and I am fine. There was some reboots after the first boot on the AOSP ROMs but afterwards it ran fine.

    Incorrect, flashing anything is what may lead to losing your IMEI. Backup using the appropriate tools in the development section. Btw stop wiping battery stats, it's not necessary.

    Sent from my SCH-I535 using xda app-developers app

    SlimSnoop is correct. According to one of the developers of a very prominent ROM the IMEI issue was because our phones got confused sometimes(Randomly phone to phone) and tried to reset during a flash. The data it tried to reset was bogus, therefor losing IMEI. He is also correct far as the wiping battery stats. It's only usefull when you have really strange results with battery. Google for the real reason to use them.


    Far as backing up your IMEI so you will never run into the problem of losing it.... go into your terminal (almost every ROM has a Terminal emulator)

    Type this:

    su

    then hit enter. Grant permissions

    then type:

    reboot nvbackup

    then hit enter. This will make your phone do some shyt and reboot, but you really shouldn't need to worry about your IMEI after this. Regardless of how many ROMs you flash or what you do or who you date or who you kiss, etc... blah blah....


    This really should be the end all for the IMEI...
    4
    why do so many folks wipe cache and dalvik after they wipe data? A data wipe/factory reset wipes all three, there is no need to do anything else.

    I always wipe data, flash rom, then advance restore data only from a nandroid...dirty flashing in its most elegant form ;)
    2
    If you go to the note 2 thread you will get help from those with a note 2. Yet you go to a galaxy s3 thread and expect galaxy s3 owners to help you with your note 2. Then when someone says "wrong forum dude" you get an attitude about it. Next time post in a note 2 thread. FYI although both have a Touchwiz variant of android the note 2 version comes with added features so it is a different variation of the same OS. It is exactly like having different variations of Ubuntu.