
If you have experienced something like:
Failed to mount '/data' (Invalid argument)
or
Failed to wipe dalvik
or
Unable to mount storage
This might be due to stock rom encryption which does not play well with dm-verity in TWRP and orangefox. If you want to fix this situation,
1. Connect the phone to PC
2. Boot phone to fastboot
3. Open Terminal/CMD with fastboot binary in path.
4. Type command
fastboot erase userdata
5. Reboot to recovery directly.
6. Enjoy