2

I know that unlocking bootloader does wipe the /data partition. However, can it also wipe the /storage partition and others, too?

8
  • It wipes all data on the internal storage... Data on an SD card setup as portable/external storage is not touched in most cases, it is recommended to remove an SD card prior to unlocking the bootloader just in case though.
    – acejavelin
    Commented Aug 24, 2017 at 20:36
  • So your answer is: It wipes 100% of the phone?
    – user167294
    Commented Aug 24, 2017 at 20:37
  • Yes, all user data, apps, music, pictures, videos, etc... unless they are stored on an SD card configured as portable storage. It will essentially be as "blank" as the day it came out of the box from the manufacturer, except as noted.
    – acejavelin
    Commented Aug 24, 2017 at 20:38
  • Then, after unlocking, relocking is possible?
    – user167294
    Commented Aug 24, 2017 at 20:40
  • 1
    Note: I unlocked the bootloader on my Huawei P8 GRA-UL00, and my user data wasn't wiped. I'm not sure why, but it is possible user data does not get wiped in some instances. Commented Aug 25, 2017 at 1:37

2 Answers 2

3

There is nothing like storage partition. What you see under /storage/emulated is a FUSE implementation of /data/media/userID. Whenever you unlock or relock the bootloader, fastboot causes factory reset of the device which wipes data and cache partitions. No bit of data escapes it, including what you see under /storage.

Source:

printf("oem unlock requested:\n");
printf("\tUnlocking forces a factory reset and could\n");
printf("\topen your device up to a world of hurt.  If you\n");
printf("\tare sure you know what you're doing, then accept\n");
printf("\tin %d seconds via 'fastboot oem unlock_accept'.\n",
3
  • Think of it that way: whichever partition accumulated user generated data gets to be wiped. They mostly include data and cache partition under normal circumstances (no deliberate tampering that is).
    – Firelord
    Commented Aug 24, 2017 at 22:04
  • When we say data is wiped during oem unlock can that operation be conceived of as like a calloc operation that zeros out that block of memory on the relevant partition? Or is the wiping basically a deletion in the filesystem but the data may still be physically present on the disk where something like the dd command could potentially recover it?
    – jxramos
    Commented Jul 4, 2021 at 8:02
  • 1
    @jxramos implementation of oem unlock is vendor specific and is not publicly disclosed, so I don't really know how data wipe takes place.
    – Firelord
    Commented Jul 4, 2021 at 12:44
0

It wipes the complete storage when the bootloader has never been unlocked. If it has been unlocked it just wipes /data as far as I have experienced this on my oneplus x. (Onyx)

6
  • I m thinking about LG, not 1+. Still I don't have any 1+ phones either.
    – user167294
    Commented Aug 24, 2017 at 20:46
  • @user167294 should be the same, but Im not 100% sure
    – Booming
    Commented Aug 24, 2017 at 20:47
  • fastboot oem lock is only supported on a handful of devices, many devices use a specific process that requires flashing a signed image.
    – acejavelin
    Commented Aug 24, 2017 at 20:51
  • Ok, I will remove it then.
    – Booming
    Commented Aug 24, 2017 at 20:52
  • 1
    What do you mean for "complete storage"?
    – Grimoire
    Commented Aug 24, 2017 at 21:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .