Does anyone know if the "Factory defaults" option in Android's recovery mode performs a secure erase of the data partition, or is it just a "quick format"? I'm not worried about a multiple pass overwrite, I just want to know if the partition is completely zero'd out. This should be sufficient for most users (since it is a NAND and not a magnetic disk --- and some say a zero pass is sufficient for magnetic disks).
Nothing obvious turned up in a quick web search (maybe I wasn't looking hard enough), so I took a look at what's going on. Here's what I found: mydroid/bootable/recovery/recovery.c: - comments at the top indicate the factory reset option calls erase_root() on /data - erase_root() calls format_root_device() in roots.c mydroid/bootable/recovery/roots.c - format_root_device() gets the MTD context "write" and calls mtd_erase_blocks(write, -1) mydroid/bootable/recovery/mtdutils/mtdutils.c - mtd_erase_blocks(MtdWriteContext *ctx, int blocks) appears to determine the total number of blocks if a negative value is passed. It appears that, yes, Android zeros the entire /data partition. Do others agree that this is what is happening? (and hopefully this thread shows up in search results for future references). Thanks, -Will -- William Enck PhD Candidate Department of Computer Science and Engineering The Pennsylvania State University [email protected] -- To unsubscribe, reply using "remove me" as the subject.
