How to mount Internal Storage as USB Mass Storage for recovering data? I accidentally formatted my Android phone's storage partition while updating to Android Oreo today. When I tried to restore the backup I realized that the backup of the data partition had failed and basically is an empty file with 0 Bytes.  

I would like to run PhotoRec over it but I'm somehow unable to get my phone into mass storage mode. It seams like Google has ditched it for MTP. I tried some apps from XDA but none of them really worked with my device. I was able to get the external SD mounted but not the internal storage. The custom recoveries that are available for my device only support MTP as well.

Does anyone have an idea how it could be possible to recover my files? I'm rooted and bootloader is unlocked.
You can't do that. Google has made MTP the default since version 3.0 and remove mass storage mode completely years ago in Android 4.0


No USB MASS STORAGE Support!!? Only MTP PTP?
Enabling USB Mass Storage in Android Kitkat 4.4.2 
Any way to get USB Mass Storage instead of MTP?
Why Do New Versions Of Android Not Support USB Mass Storage Mode?


If you want to do things directly on the data partition you have 2 ways


Run command in adb shell
Start in recovery mode (if you're using a custom ROM)


Since you're running a restore from backup, I assume you're on a custom ROM and still have the backup file with you, why don't just do the restoration again?