Hovatek Forum DEVELOPMENT Android [Tutorial] How to fix TWRP internal storage (0MB) / data encryption
Can't login? Please, reset your password.
Hovatek is recruiting! Apply Now


[Tutorial] How to fix TWRP internal storage (0MB) / data encryption

[Tutorial] How to fix TWRP internal storage (0MB) / data encryption

Pages (3): 1 2 3 Next
X3non
X3non
X3non
Recognized Contributor
22,062
19-09-2019, 11:28 PM
#1



This is a step by step guide on how to fix the 0 MB internal storage / data encryption (decrypt data, enter password) issue in TWRP. This issue doesn't mean there's a problem with your ported TWRP recovery, it simply means your device has encrypted userdata. This issue results in your custom recovery being unable to mount userdata partition.

[Image: twrp-data-decrypt-password-0mb-internal-storage.jpg]

Ensure to read the important notice section at the end of the guide

Method 1 - Patching fstab in /vendor partition using file manager + root access


Note that this method will only be doable if your device rooted

See the video below or @ https://youtu.be/YSSaGE2CW7A

  1. Install a file manager with root access e.g File Explorer Root Browser bu Jrummy apps from Play Store
  2. Launch the file manager and note that you might need to enable root access depending on the app. For Xplore, click the three dots at the top right hand corner > configuration > root access > superuser + mount writable
  3. Return back to the file manager then navigate to /vendor/etc/fstab.**
  4. Edit the fstab file by long pressing it then select Edit
  5. Search for the word "encrypt", you'll find it on the same line containing userdata's mount point e.g as seen below, the full word in this example is forceencrypt
    Code:

    /dev/block/platform/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev wait,check,quota,formattable,resize,forceencrypt=/dev/block/platform/bootdevice/by-name/metadata,

  6. Replace only "forceencrypt" with "encryptable" e.g as seen below
    Code:

    /dev/block/platform/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev wait,check,quota,formattable,resize,encryptable=/dev/block/platform/bootdevice/by-name/metadata,

  7. Save the file
  8. Also navigate to /vendor/nvdata/fstab.** , edit and make the same modification (if you can't find fstab in this location then skip it)
  9. Flash back your stock recovery.img
  10. Boot into stock recovery mode and do a factory reset
  11. Reboot to home screen (system) then flash back your TWRP
  12. Boot into TWRP and confirm that encryption issue is fixed


Method 2 - Flashing no-verity-opt-encrypt.zip in TWRP


  1. Download no-verity-opt-encrypt.zip @ https://build.nethunter.com/android-tool...t-encrypt/
  2. Copy this zip into external_sd or USB-OTG storage
  3. Reboot your device into TWRP recovery
  4. Click Install > Select Storage > ExtSD or USB-OTG (depending on where you stored the zip file) > Navigate to & select the no-verity-opt-encrypt.zip > Swipe the slider to flash
  5. If successful, reboot TWRP then confirm if encryption issue is fixed
  6. If it's not then reflash no-verity-opt-encrypt.zip then Format /data partition (TWRP > Wipe > Format Data > Type yes)
  7. Then reboot TWRP and confirm if encryption issue is fixed


Method 3 - Patching fstab in /vendor partition using TWRP + Text editor


Note that this method will only be doable if you're able to mount vendor partition in TWRP > Mount. If you can then proceed with the steps below if not then try a different method

  1. Boot to TWRP
  2. Mount vendor partition in TWRP > Mount
  3. Return to TWRP homescreen > Advanced > File Manager
  4. Navigate to /vendor/etc/ then copy fstab.** to external_sd or USB-OTG storage
  5. Navigate to /vendor/nvdata/ then copy fstab.** to a different folder in external_sd or USB-OTG storage (if you can't find fstab in this location then skip it)
  6. Now to edit the fstab file(s) you just copied, either reboot your device to homescreen and use a text editor from play store or while in TWRP, you can copy the file to your PC (only if MTP works in TWRP)
  7. Edit the fstab file using any text editor
  8. Search for "forceencrypt", you'll find it on the same line containing userdata's mount point e.g as seen below
    Code:

    /dev/block/platform/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev wait,check,quota,formattable,resize,forceencrypt=/dev/block/platform/bootdevice/by-name/metadata,

  9. Replace only "forceencrypt" with "encryptable" e.g as seen below
    Code:

    /dev/block/platform/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev wait,check,quota,formattable,resize,encryptable=/dev/block/platform/bootdevice/by-name/metadata,

  10. Save the file, copy it back into external_sd or USB-OTG storage
  11. Reboot to TWRP, copy the newly modified fstab file(s) to their various locations and replace the existing files
  12. Format /data partition (TWRP > Wipe > Format Data > Type yes)
  13. Then reboot TWRP and confirm if encryption issue is fixed

Important Notice
  • If you end up with unknown baseband and null IMEI then set permission for the modified fstab file(s) to 644
  • Since this method involves wiping userdata, ensure to backup your important stuff before proceeding
  • If you don't see "forceencrypt" within the fstab file but rather you see "forcefdeorfbe" or "fileencryption" then change it to "encryptable"
  • If you modify fstabs in vendor but they keep getting restored, then flash Disable_Dm-Verity_ForceEncrypt_03.04.2020.zip @ https://androidfilehost.com/?fid=4349826312261749617 to disable force encryption then format /data
  • If you happen to format /data and reboot and your device keeps booting back to TWRP, then flash back and boot into stock recovery.img then perform a factory reset. You can flash back TWRP once factory reset is successful
  • There's no guarantees that any method will work on your device so be sure to try each method, hopefully one works
  • On some devices, check vendor/build.prop . Look for ro.crypto.volume.contents_mode=adiantum and ro.crypto.volume.filenames_mode=adiantum then change adiantum to footer
This post was last modified: 25-11-2020, 10:01 AM by hovatek.
riadtaihi
riadtaihi
riadtaihi
Junior Member
20
19-03-2020, 03:25 PM
#2
Thanks, will give it a try!
Mitchie Boom
Mitchie Boom
Mitchie Boom
Enthusiastic Member
10
10-05-2020, 03:15 PM
#3
I already tried many times.. but the problem is I cannot edit the fstab file on vendor folder. Please help I already subscribed for private support but nothing has change. I also tried the method 3 where you need to extract the fstab file from vendor folder and modifications, but everytime I place back the file to their respective folder then after booting the phone can't detect the sim. by the way BIG THANKS to Enigma! Smile
This post was last modified: 10-05-2020, 03:20 PM by Mitchie Boom.
B3nSleazy
B3nSleazy
B3nSleazy
Newbie
3
11-07-2020, 10:20 PM
#4
(10-05-2020, 03:15 PM)Mitchie Boom I already tried many times.. but the problem is I cannot edit the fstab file on vendor folder. Please help I already subscribed for private support but nothing has change. I also tried the method 3 where you need to extract the fstab file from vendor folder and modifications, but everytime I place back the file to their respective folder then after booting the phone can't detect the sim. by the way BIG THANKS to Enigma! Smile
i have the same issue, has there been a fix found??
X3non
X3non
X3non
Recognized Contributor
22,062
13-07-2020, 09:08 AM
#5



(11-07-2020, 10:20 PM)B3nSleazy i have the same issue, has there been a fix found??

stick to your thread @ https://www.hovatek.com/forum/thread-35667.html
This post was last modified: 25-11-2020, 07:44 AM by hovatek.
maxmavis
maxmavis
maxmavis
Newbie
2
07-12-2020, 10:27 AM
#6
Method 2 worked for me.
Thanks a lot!

It also formatted my phone. Luckily I had backup.
ogghi
ogghi
ogghi
Newbie
2
05-01-2021, 05:00 PM
#7
Hey there, does using this mean that system is un-encrypted then?
That would not be much good...
X3non
X3non
X3non
Recognized Contributor
22,062
06-01-2021, 12:24 PM
#8
(05-01-2021, 05:00 PM)ogghi Hey there, does using this mean that system is un-encrypted then?
That would not be much good...

system partition doesn't contain / store user sensitive data like userdata partition does
Detective_Khalifah
Detective_Khalifah
Detective_Khalifah
Senior Member
237
23-01-2021, 08:51 PM
#9
(07-12-2020, 10:27 AM)maxmavis Method 2 worked for me.
Thanks a lot!

It also formatted my phone. Luckily I had backup.

Device specs?
Windows Vista
Windows Vista
Windows Vista
Junior Member
27
29-01-2021, 02:10 AM
#10



I tried the method 2, and now my tablet asks me for a password and also "Gboard has stopped working" appears. If I make a factory reset my tablet gets encrypted again Sad. At least method 1 worked for me Smile.
This post was last modified: 01-02-2021, 06:52 PM by Windows Vista.
Pages (3): 1 2 3 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram