What changed in 6.0 that makes the "wipe cache partition" command so slow?

Sicily1918

Well-known member
Feb 18, 2012
141
7
0
OK, so, with every Nexus I own (or have had access to), I've routinely booted into Recovery and wiped the cache. This is on 3 N4s, a few 2012 N7s, another few 2013 N7s, my N5, etc...

Normally, this command takes *maybe* 5 seconds... so, what's changed in Marshmallow that it takes at least 5 minutes?

Edit: this is on my N5, factory image flash (so, completely clean install, not an update). Not rooted, and a locked bootloader.
 
I don't recall ever wiping the cache partition on my Nexus 4, but each time I've done it on my Nexus 5 it's taken anywhere between 3 to 5 minutes, I'd say. I assumed that was the norm.
 
I have never had a system cache wipe finished in 3-5 minutes and I have only 45 apps, no games, and very little music on my Nexus 5.
 
I don't recall ever wiping the cache partition on my Nexus 4, but each time I've done it on my Nexus 5 it's taken anywhere between 3 to 5 minutes, I'd say. I assumed that was the norm.

Me too - on both Nexus 5 and 6 has always taken a very long time.
 
Huh... that's really weird. My cache wipes have never taken more than maybe 10 seconds, and that's a lot of devices!

The mystery deepens... :eek:
 
very weird, on ever Galaxy phone I've owned the Cache wipe takes no longer than 2 seconds. In fact I do it 2 or 3 times just to make sure as it finishes way too fast.
 
It comes down to the kernel. My Moto X 2013, and my Nex5 both took over 5 minutes. As I recall my M8 did too.
 
It's just a guess, but maybe the difference between an encrypted vs. non-encrypted device?

In the DOS/Windows world, for example, you can "delete" files with a simple mod to the File Access Table (FAT - you change the first character of the filename to a question mark)), or you "wipe" a file by overwriting every single data bit with a zero - for true security you overwrite multiple times. The latter operation takes way, way, longer than the former.

So, like I said, just a thought. Maybe Google feels that an encrypted device should be properly "wiped" as opposed to simply clearing the file access table.
 
It's just a guess, but maybe the difference between an encrypted vs. non-encrypted device?

In the DOS/Windows world, for example, you can "delete" files with a simple mod to the File Access Table (FAT - you change the first character of the filename to a question mark)), or you "wipe" a file by overwriting every single data bit with a zero - for true security you overwrite multiple times. The latter operation takes way, way, longer than the former.

So, like I said, just a thought. Maybe Google feels that an encrypted device should be properly "wiped" as opposed to simply clearing the file access table.
Marshmallow doesn't force encryption on phones though. At least on phones upgrading to it from older Android versions
 
Marshmallow doesn't force encryption on phones though. At least on phones upgrading to it from older Android versions

That doesn't mean he didn't choose to encrypt.

However...

I sideloaded Marshmallow on my Nexus 6 because I was tired of waiting. Since my N6 was not unlocked, I first had to do that which, of course, wiped the entire phone. Then I sideloaded Marshmallow and upon initial boot the first thing it did - without asking me - was to encrypt the device.

So, I'm not so certain about your statement above...
 
That doesn't mean he didn't choose to encrypt.

However...

I sideloaded Marshmallow on my Nexus 6 because I was tired of waiting. Since my N6 was not unlocked, I first had to do that which, of course, wiped the entire phone. Then I sideloaded Marshmallow and upon initial boot the first thing it did - without asking me - was to encrypt the device.

So, I'm not so certain about your statement above...
Nexus 6 had encryption enabled by default on release date. At that time Google was still making it mandatory to encrypt phones shipping with Lollipop. Might just not have ever been disabled on the Nexus 6. Haven't seen anything about mandatory encryption being reinstated

OK, never mind. Just saw an article saying that they did indeed make encryption mandatory again. Hopefully that sticks this time around. Phones should be able to handle it now...last year was painful for phones without 64-bit processors
 
Last edited:
Well, on both phones (wife's N5 as well), the second time I performed a wipe they'd not been encrypted yet, and after encryption the cache wipe time was about the same (8 minutes, give or take). On both phones, the first cache wipe happened right after the factory image install (before first boot) and only took about 15 seconds or so. After setting them up with apps and such, the wipes take over 5 minutes.
 
Really doesn't matter how long it takes. Shouldn't wipe the cache partition anyway unless you have a problem. Normally, it's not only totally unnecessary, it's actually counter-productive. See:

http://forums.androidcentral.com/showthread.php?p=4642716

The multiple-delete to fully wipe thing applies to magnetic hard drives, not solid state memory. Recovery software for HDs was said to be able to recover data that had been overwritten up to 7 times. Commonly called going down 7 layers, it was detection of magnetic 'residue' leftover on the disk for up to 7 overwrites. In actual practice, you could usually only go about 3-4 layers, depending on the disk.

Doesn't apply to chip memory. There's no magnetic leftovers to detect. One overwrite and you're done.


Android since v1.0. Linux since 2001
 
Really doesn't matter how long it takes. Shouldn't wipe the cache partition anyway unless you have a problem. Normally, it's not only totally unnecessary, it's actually counter-productive. See:

Cache partition wipe - does it really help? - Page 2 - Android Forums at AndroidCentral.com

The multiple-delete to fully wipe thing applies to magnetic hard drives, not solid state memory. Recovery software for HDs was said to be able to recover data that had been overwritten up to 7 times. Commonly called going down 7 layers, it was detection of magnetic 'residue' leftover on the disk for up to 7 overwrites. In actual practice, you could usually only go about 3-4 layers, depending on the disk.

Doesn't apply to chip memory. There's no magnetic leftovers to detect. One overwrite and you're done.


Android since v1.0. Linux since 2001

Yeah, I mentioned that mostly as an afterthought. What I was really driving at was the difference between simply clearing the file access table ( a few milliseconds) vs. overwriting each individual databit with a zero.
 
Really doesn't matter how long it takes. Shouldn't wipe the cache partition anyway unless you have a problem. Normally, it's not only totally unnecessary, it's actually counter-productive.
I do it only on two occasions:
  1. After an OS update/upgrade.
  2. When I'm having an issue that survives reboots.
The multiple-delete to fully wipe thing applies to magnetic hard drives, not solid state memory. Recovery software for HDs was said to be able to recover data that had been overwritten up to 7 times. Commonly called going down 7 layers, it was detection of magnetic 'residue' leftover on the disk for up to 7 overwrites. In actual practice, you could usually only go about 3-4 layers, depending on the disk.

Doesn't apply to chip memory. There's no magnetic leftovers to detect. One overwrite and you're done.
I've found that a single shred (# shred -n1) makes magnetic recovery almost impossible (even Maximum PC verified this), although yes, the DOD does a 7-pass shred and then destruction for their drives.

Sadly, for flash storage, with its proprietary, back-end wear-leveling, this is not necessarily true... it looks like the better way is to shred individual files on flash memory.
 
That's not really necessary. Not sure Google would do something like that when there are simpler methods

Well, it's clear they are doing something that takes an inordinate amount of time and I can't imagine what else it might be...
 
The correct question is why the hell is it necessary to manually delete the cache partition in the first place, and why the hell do people still tolerate it? After the pile of hot garbage that is Lollipop, it would seem Google would try to make Android better. Nope.