# 4.1.2 Factory Reset Fail — mkdir /data/app fail. err is -1

So, I have a rooted (may have reverted by now, cannot be sure, will explain why below) 4.1.2 Android, Kruger&Matz LIVE 1.

Full story is this:

Went to bed at about 19 (really tired after working) phone okay. Woke up at 8 in the morning phone still okay. Woke up again at 14 phone had the "input your pin to unlock sim". I thought "huh, weird." I did that and ever since then it has been restarting every 2 to 3 minutes.

So I started looking into it. The first thing I came upon was some wifi channel bug. So I tested it, it was restarting itself only when connected to the internet. So I rebooted the rooter but the problem persisted. Changed the wifi at a friend, the phone was still restarting. Then I tried wiping the cache from the recovery menu. That didn't work either. So I looked into it even further, everything pointing towards a hard reset.

Backed up only contacts and sms; formatted the SD Card as well as the SD Card that acts as an "internal storage", went into recovery mode, wiped the cache again and when I tried "wiping/factory reset" it gave me this error:

-- Wiping data...
Formatting /data...
Formatting /cache...
Data wipe complete.
Performing factory reset...
-- mkdir /data/app fail. err is -1

So I thought it was because it was still rooted. So I restarted the phone and I noticed something really interesting. The data on the SD Card that acts as an "internal storage" had been restored.

After unrooting the phone I tried again with the same error.

I also tried hard formatting the "internal storage" from my PC but the data was restored even after that. That's why I don't think my phone has been unrooted.

Also even though it's called "internal storage" it isn't. It's just a built in 1GB SD Card, doesn't have any system files on it, just downloaded apps and save files that are installed here if there is no additional SD Card present. (that's why I'm so confused as to why it's restoring these files in particular)

Any help will be greatly appreciated!

P.S: Even in Safe Mode, while running better, just by going into Manage Apps, the phone restartes after a few minutes, so installing and uninstalling apps is a little tricky, especially because they magically reappear every time the phone restarts.

• The factory reset isn't supposed to alter neither your internal SD (/storage/sdcard0), nor your external SD (/storage/sdcard1). Since you're rooted, did you check the /data partition? – Death Mask Salesman Mar 13 '16 at 20:34
• Yeah, that's why I'm so confused. Everything in my phone reverts back to the state it was before going into recovery mode even after I format the sdcard0 from my PC, with apps and settings. As for the /data partition... I don't know how to access it or what to look for. I have JDK and ADB installed for when I tried to hard reset it through cmd lines, and the phone is still rooted after unrooting it. But it reverts back to being rooted after the phone restarts because everything goes back to what it was :/. Thanks for the reply :D. – Matt Raddin Mar 14 '16 at 10:00
• To access the /data partition from ADB, you can start the daemon with adb start-server, and get an Android shell with adb shell. After doing so, your computer terminal will display an \$, instead of the regular text. If you then issue ls, you'll see the content of your phone's rootfs, which is the / position. Then, by using cd /data, you'll be able to move to the /data partition. The useful commands are: cd folderName (to move to the specified folder), cd .. (to go up a level), ls (to display a folder's content). I suggest you to explore your /data/app. – Death Mask Salesman Mar 14 '16 at 18:29