How do you backup with TWRP given the issues caused by dm-verity? - Samsung Galaxy J7 Questions & Answers

I have a J710DM/DS. I flashed the latest version of TWRP (TWRP for j7xelte - 3.0.2.1) with no problems.
But when I try to do a backup (to the external SD card), I get the expected "failed to mount /data" errors that result from dm-verity.
TWRP's website talks about this and mentions that some versions have a "System Image" option, but I don't see it on my phone.
So how do I properly do a backup?

This is nothing to do with dm-verity, it's encryption.
Format DATA to remove encryption and then install the boot patch.
My builds of TWRP have image backup, but not sure if I've compiled a j710 version.

ashyx said:
This is nothing to do with dm-verity, it's encryption.
Format DATA to remove encryption and then install the boot patch.
My builds of TWRP have image backup, but not sure if I've compiled a j710 version.
Click to expand...
Click to collapse
Thanks for the information.
What boot patch?
Edit:
Also, what's the recommended way to format DATA? If TWRP can't even mount it, can it even format it?

Haphim said:
Thanks for the information.
What boot patch?
Edit:
Also, what's the recommended way to format DATA? If TWRP can't even mount it, can it even format it?
Click to expand...
Click to collapse
FORMAT *not* WIPE. You don't need to mount to FORMAT.
To disable forced encryption and mount internal storage:
(Note this MUST be flashed after SuperSU if you intend to root)
1. Boot to Twrp
2. Format Data partition using FORMAT DATA button under Wipe options.
(Note: This will wipe the internal storage)
3. Check DATA is mountable.
4. Install SuperSU (if root is required)
5. Install boot image patch below.
6. Reboot
Boot image patch
no-verity-no-encrypt_ashyx

ashyx said:
FORMAT *not* WIPE. You don't need to mount to FORMAT.
To disable forced encryption and mount internal storage:
(Note this MUST be flashed after SuperSU if you intend to root)
1. Boot to Twrp
2. Format Data partition using FORMAT DATA button under Wipe options.
(Note: This will wipe the internal storage)
3. Check DATA is mountable.
4. Install SuperSU (if root is required)
5. Install boot image patch below.
6. Reboot
Boot image patch
no-verity-no-encrypt_ashyx
Click to expand...
Click to collapse
Thank you so much for elaborating!
Quick follow-up: I have already flashed SuperSU previously. Will I need to flash it again after formatting DATA?

Haphim said:
Thank you so much for elaborating!
Quick follow-up: I have already flashed SuperSU previously. Will I need to flash it again after formatting DATA?
Click to expand...
Click to collapse
You will need to reflash supersu.

Quick, but vital question:
Does flashing "no-verity-no-encrypt_ashyx" mean that I can now safely restore a full system backup?

Haphim said:
Quick, but vital question:
Does flashing "no-verity-no-encrypt_ashyx" mean that I can now safely restore a full system backup?
Click to expand...
Click to collapse
If you made a backup of an unencrypted data partition then you can restore if /data is mountable.
If you are not restoring /data then it doesn't matter.

Thank you so much for helping me understand all of this. You're the best!

Related

failed to mount /data

SOLVED
I rooted my s7 and installed twrp. I tried to do a nandroid backup in twrp and got the message that it couldn't mount /data. It turns out that by not performing the data format step in http://forum.xda-developers.com/galaxy-s7/development/recovery-official-twrp-herolte-t3333770 TWRP couldn't access /data. I did the steps over again and all was well.
kettir said:
I've rooted my s7 and installed twrp. I tried to do a nandroid backup in twrp and got the message that it couldn't mount /data.
I do have root, twrp does run when I boot into recovery. However, whether I select to allow modifications to system or not, twrp does not see the internal sd card.
I followed these instructions to root: http://forum.xda-developers.com/galaxy-s7/development/recovery-official-twrp-herolte-t3333770
However, I did not do step 10:
Only if you want internal storage or data to work in TWRP:
Go to [Wipe] -> [Format Data] (not advanced wipe) -> type "yes".
WARNING: This will wipe your internal storage, disable encryption, and factory reset your phone!
Go to [Reboot] -> [Recovery].
Is this the reason that I can't access internal storage? If it is, I can go ahead and do the format data thing. I just would like to know if that is probably the reason I'm having this problem. NOTE: The phone is not encrypted so far as I know.
Click to expand...
Click to collapse
Internal data is encrypted nevertheless. Only a format will remove this encryption and it is the only way that you can make a TWRP backup of this data.
Bright.Light said:
Internal data is encrypted nevertheless. Only a format will remove this encryption and it is the only way that you can make a TWRP backup of this data.
Click to expand...
Click to collapse
Frag. Well, in that case, I've already installed TWRP, so presumably I can just boot to TWRP, swipe right to enable changes, format data, flash supersu, and then flash dm-verity and force encryption disabler. Then go through the setup again.
If I could have my way, someone would disable the security deal with writing to the SD card, the phone could be purchased pre-rooted, and I wouldn't have to worry about bricking my phone every time I flash something.
Rant over.
@kettir: You're exactly right!
btw: The security deal is not over when you root your phone. 'I still haven't found what I'm looking for' is a very precise song for this problem.
I had the same issues and succesfully used the sequence proposed by Kettir:
- Enable OEM unlock
- ODIN: Install TWRP
- TWRP: Wipe -> Format data
- TWRP: flash supersu
- TWRP: flash dm-verity and force encryption disabler

Disable encryption protection?

Hi Guys
Im having trouble flashing new Roms to my S7. When I enter TWRP recovery, it shows my device as 0MB and it doesnt picK up any files. I looked into this and read that Encryption should be disabled on the handset. I followed instructions to do this and noticed that there is no option for Encryption Protection. Its not there!
I disabled any passwords and Pin numbers to erase decryption and it still didnt work!
last resort was to try a factory reset and the device restarted to recovery and failed as TWRP recovery cant find any mounted devices due to the encryption crap.
Any help appreciated.
Chris
scientificharmony said:
Hi Guys
Im having trouble flashing new Roms to my S7. When I enter TWRP recovery, it shows my device as 0MB and it doesnt picK up any files. I looked into this and read that Encryption should be disabled on the handset. I followed instructions to do this and noticed that there is no option for Encryption Protection. Its not there!
I disabled any passwords and Pin numbers to erase decryption and it still didnt work!
last resort was to try a factory reset and the device restarted to recovery and failed as TWRP recovery cant find any mounted devices due to the encryption crap.
Any help appreciated.
Chris
Click to expand...
Click to collapse
Hi mate
Seems like you did not format your data partition during TWRP installation.........
Try flashing your custom rom from the External SD card......your data partition has all your app , files , passwords, photos...there is still a chance that there it may be a incompatibility issue between your apps and the new rom....that is why they recommend a factory reset when flashing a new custom rom
MAX 404 said:
Hi mate
Seems like you did not format your data partition during TWRP installation.........
Try flashing your custom rom from the External SD card......your data partition has all your app , files , passwords, photos...there is still a chance that there it may be a incompatibility issue between your apps and the new rom....that is why they recommend a factory reset when flashing a new custom rom
Click to expand...
Click to collapse
hi mate
thanks for your reply. I dont have an external SD card
Is there any other way of sorting this? I am downloading a stock rom as we speak.
scientificharmony said:
hi mate
thanks for your reply. I dont have an external SD card
Is there any other way of sorting this? I am downloading a stock rom as we speak.
Click to expand...
Click to collapse
Hi
TWRP can not handle Samsung encryption . if you wish to use TWRP and have access to the Data partition ( internal SD card) you need to format it so the encryption is disabled ( you lose all your apps , data and user configuration AKA factory reset) , you can have TWRP and data encryption but mods and roms have to be flashed from external memories also you will not have available MTP in recovery or factory reset from it.
There is no way to disable data encryption without format data.....
Ok, I got a friends SD card and placed the Rom on there. I can now see the Rom but the trouble is, TWRP wont let me wipe Dalvik / data / system / cache as it wont mount the storage....
can I still apply the ROM?
Unable to restart your device. The integrity verification has failed. You need to reset your device to factory default settings. This will erase all of your data.
scientificharmony said:
Unable to restart your device. The integrity verification has failed. You need to reset your device to factory default settings. This will erase all of your data.
Click to expand...
Click to collapse
That is why I point it out " factory reset is recommended when flashing custom rom" if you wish to flash a custom rom you will have to format your data partition and flash the data verify file........
MAX 404 said:
That is why I point it out " factory reset is recommended when flashing custom rom" if you wish to flash a custom rom you will have to format your data partition and flash the data verify file........
Click to expand...
Click to collapse
I have tried to format/wipe data. TWRP keeps saying it failed as it cant mount the storage.
I tried flashing the stock rom via odin and it also failed as it goes to recovery to wipe data and it fails again as it cant mount storage.
scientificharmony said:
I have tried to format/wipe data. TWRP keeps saying it failed as it cant mount the storage.
I tried flashing the stock rom via odin and it also failed as it goes to recovery to wipe data and it fails again as it cant mount storage.
Click to expand...
Click to collapse
How did you flash the stock rom...which files did you use?
Wipe data is not enough you have to Wipe / FORMAT DATA and type yes....
1 To get rid of encryption, go to "wipe", format data (TWRP) (keyboard will pop up) then type "yes" and format it, then reboot to recovery
2. After flashing this, hit wipe, full wipe (this will clean all internal memory and your data will be lost
3 you can test if encryption is still enabled, if TWRP shows error about not mounting data your phone is still encrypted
Sent from my SM-G930F using XDA-Developers mobile app
Josh Smith10 said:
1 To get rid of encryption, go to "wipe", format data (TWRP) (keyboard will pop up) then type "yes" and format it, then reboot to recovery
2. After flashing this, hit wipe, full wipe (this will clean all internal memory and your data will be lost
3 you can test if encryption is still enabled, if TWRP shows error about not mounting data your phone is still encrypted
Sent from my SM-G930F using XDA-Developers mobile app
Click to expand...
Click to collapse
What version of TWRP are you guys using and what version Super SU?
Delete

twrp

Does Format Data in twrp wipe the system partition or will I be fine to format data from twrp? I'm wanting to do this because I've read that doing this will remove encryption
Newrooter22 said:
Does Format Data in twrp wipe the system partition or will I be fine to format data from twrp? I'm wanting to do this because I've read that doing this will remove encryption
Click to expand...
Click to collapse
It only wipes /data.
Though, if you use TWRP by Pretoriano80 there's no point as that has decryption.
If you still want to continue you need to Format Data, 'reboot recovery', then remove fileencryption flag in /vendor/etc/fstab.hi3660. (you can pull this file using adb, edit on computer then push it back using adb.).
If you don't edit fstab your phone will re-encrypt on next boot to system.
You will also have to flash Public and HW zip for your firmware as these will be gone (system update ability and themes are stuff that will be gone if you don't flash these.)

0 mb in TWRP internal storage

I searched for an answer and noticed it's a common issue. I am trying to flash a kernel on to my already flashed rom. I was wondering if there is a more current fix. More importantly, how can this be avoided in the future. Thank you guys!
Its caused by a bug/error with either the filesystem or encryption.
Did you wipe data after flashing the new ROM? Data from stock usually doesn't work with custom ROMs.
Do you have a PIN/password on Android?
Are you using the latest build of TWRP?
Press the menu button at the bottom of the screen in TWRP and post what the error message is in the red text.
It's caused by no root access
djhulk2 said:
It's caused by no root access
Click to expand...
Click to collapse
Something is probably wrong with the data partition. TWRP should always have root access.
Try in TWRP:
Wipe > Format Data > Slide to format
This will erase the data partition, so backup everything to a PC in Android first if needed. It should allow TWRP to mount /data again.
KemikalElite said:
Something is probably wrong with the data partition. TWRP should always have root access.
Try in TWRP:
Wipe > Format Data > Slide to format
This will erase the data partition, so backup everything to a PC in Android first if needed. It should allow TWRP to mount /data again.
Click to expand...
Click to collapse
I've debated on doing this. I'm not worried about losing pictures texts etc as they're backed up.
I read that it essentially leaves the device with no OS. If that's wrong please let me know!
I have found that if I choose Slot A and reboot system it reboots me in to TWRP. If I choose Slot B it runs the OS like normal (except I still have issues using Facebook and it's services).
The ROM works and I can perform all the custom mods on it. I just want to flash a kernel and the problem persists. 0 mb in storage.
It's trial and error at this point. Fail fast fail forward. I have another phone I can use but I love the OnePlus. Any help will be appreciated!
https://andi34.github.io/faq/faq_twrp.html
I'm not willing to risk it until I know how to get the custom ROM on to the storage to flash it.
Yes formating by typing in yes will wipe it all,everything including pictures, with no rom on it at all. If u choose to do that, don't close twrp. Instead you should be able mount after wards, once mounted transfer the magisk zip, twrp, and your custom rom(has to be 1.5gb not 200mb through magisk). Flash magesik, install ram disk twrp, install rom. That was a method I've done before but if u want to keep everything there is other way
fastboot boot twrp.img, that command boots twrp if u have it or don't, installing to ram disk makes it permant...this boot command is just a one time thing each time. It's what I do when new firmware update, I loose root but I regain it each time
Never heard of formating data removing the OS, that would be if you wipe the system and normal wipe is like a factory data reset and therefore will not wipe your phone of the OS
djhulk2 said:
Yes formating by typing in yes will wipe it all,everything including pictures, with no rom on it at all. If u choose to do that, don't close twrp. Instead you should be able mount after wards, once mounted transfer the magisk zip, twrp, and your custom rom(has to be 1.5gb not 200mb through magisk). Flash magesik, install ram disk twrp, install rom. That was a method I've done before but if u want to keep everything there is other way
fastboot boot twrp.img, that command boots twrp if u have it or don't, installing to ram disk makes it permant...this boot command is just a one time thing each time. It's what I do when new firmware update, I loose root but I regain it each time
Click to expand...
Click to collapse
I attempted to format. It said
"failed to mount /data (device or resource busy)
"unable to mount storage"
Try this in recovery, sometimes its known to work.
Wipe > Advanced Wipe > Check Data and press Repair or Change File System > Change File System > Change it to EXT2.
Repeat the same process selecting Ext4
Wipe > Advanced Wipe > Check Data and press Repair or Change File System > Change File System > Change it to back to EXT4.
Try formatting data after this.
drey4211 said:
I attempted to format. It said
"failed to mount /data (device or resource busy)
"unable to mount storage"
Click to expand...
Click to collapse
Since you dont care about the data on the phone I would just do 1 of 2 things. 1st I would reflash twrp on to you phone if that doesn't work then I would just grab the fastboot ROM and just flash your phone back to full stock reroot and install twrp from scratch. I would not try to start repairing partitions. I wouldn't want to worry about screwing up the EFS partition
Well in an update, I formatted the
Storage and now I'm stuck in bootloader screen. It's unlocked but I'm having a hard time flashing a ROM through adb.
I use the twrp version 3.3.1-2
Best would be to just use fast command to boot it
But it should be under wipe/format data/then type in yes
That was what I was trying to have you avoid. If your can boot to fastboot download the fastboot ROM I told you to and run the flash-all.bat file. If your on 9.5.8 make sure you use the fastboot ROM of the same version. Do not flash azip of a different version firmware like 9.5.7.
It happens to me any time I'm in twrp and flash a rom then reflash twrp. It doesn't matter if I flash Magisk or not the issue always happens. What I do is use a USB C flash drive and plug it in when I want to flash/backup a rom. This way I can always access it. After flashing any rom then booting I'm always able to access my internal storage again. It seems like a bug in twrp.
The strange part is when this bug happens your files are encrypted in a 0 folder but you can still copy from your PC to your internal storage while in twrp.
I essentially soft bricked my device. Called OnePlus and they got me up and running. That's awesome that they have that service!
Are you removing all security? Pattern, pin and fingerprints? Are you decrypted? Never had an issue with flashing a ROM causing these issues which is why I'm asking. Something you've done at some point is causing this
I'm not sure what that was. Ironically enough I am now stuck in TWRP boot loop. Hopefully I can figure this out otherwise I have to call oneplus again.
I will admit I may not know everything but it's trial and error. I don't have anyone to really teach me this so I try to read the forums and learn. You guys have been great!
ajsmsg78 said:
It happens to me any time I'm in twrp and flash a rom then reflash twrp. It doesn't matter if I flash Magisk or not the issue always happens. What I do is use a USB C flash drive and plug it in when I want to flash/backup a rom. This way I can always access it. After flashing any rom then booting I'm always able to access my internal storage again. It seems like a bug in twrp.
The strange part is when this bug happens your files are encrypted in a 0 folder but you can still copy from your PC to your internal storage while in twrp.
Click to expand...
Click to collapse
I've the same issue.. did you find a fix? So annoying

TWRP 0mb Storage

Is there a way to fix 0mb Internal storage in twrp to flash from there magisk? My usb port doesn't work so everything I can do is from the device by itself.
I tried wipe, and data format repair file system ange change file system ext2 and back to ext4. It temporarily says the storage size and when rebooting into system then is again to 0mb. Anybody can help?
imichalakis said:
Is there a way to fix 0mb Internal storage in twrp to flash from there magisk? My usb port doesn't work so everything I can do is from the device by itself.
I tried wipe, and data format repair file system ange change file system ext2 and back to ext4. It temporarily says the storage size and when rebooting into system then is again to 0mb. Anybody can help?
Click to expand...
Click to collapse
Did you try to mount the internal storage?
riojosepha said:
Did you try to mount the internal storage?
Click to expand...
Click to collapse
This even doesnt work
imichalakis said:
This even doesnt work
Click to expand...
Click to collapse
Try reinstalling TWRP, if that doesn't work maybe using a different recovery such as orangefox or shrp
Is it possible reinstalling recovery without usb cable and with existing problem?
imichalakis said:
Is it possible reinstalling recovery without usb cable and with existing problem?
Click to expand...
Click to collapse
yeah, if you get the "recovery.img", flash as an ".img; image", flash it to the recovery partition. try shrp first, dont use orangefox since it caused problems with me.
Could you send me a guide or a link to download img file and tell me how to flash it
The problem is that after installed rom, i have to install magisk ,su and etc. I cannot use "su" command. My problem is how to flash magisk
Edit: I have image file of shrp.Where to place it and how to flash it? The problem is that i cant find from recovery this file because of 0mb internal storage
imichalakis said:
The problem is that after installed rom, i have to install magisk ,su and etc. I cannot use "su" command. My problem is how to flash magisk
Edit: I have image file of shrp.Where to place it and how to flash it? The problem is that i cant find from recovery this file because of 0mb internal storage
Click to expand...
Click to collapse
Forgot to ask but, did you encrypt internal storage? There are a couple of forums documenting that encryption causes the TWRP 0mb problem.
Try this:
TWRP Internal Storage(0 MB)
I am trying to root my Samsung A7(2017). I have installed twrp to my phone but when I open it to install SuperSU it writes Internal Storage(0 MB) therefore I can not access to SuperSU. I am searching
android.stackexchange.com
Read more about it here:
twrp 0mb at DuckDuckGo
DuckDuckGo. Privacy, Simplified.
duckduckgo.com
---
Flash SHRP recovery & Magisk via an SD card.

Categories

Resources