How to mount Android device as USB mass storage instead of MTP?
Follow these Steps to mount your /data partition as Mass Storage:


Boot to recovery
mount | grep /data(note down the device file /dev/block/.....)
umount /data
find /sys -name lun*(Note down the url containing f_mass_storage
adb shell
su
cd /data/local/tmp
vim usb_mount.sh
Press i
echo 0 &gt; /sys/class/android_usb/android0/enable
echo [Previously noted down device file] &gt; [Previously noted down URL]/file
echo mass_storage &gt; /sys/class/android_usb/android0/functions
echo 1 &gt; /sys/class/android_usb/android0/enable
Write :wq and press enter
chmod 777 /data/local/tmp/usb_mount.sh
sh /data/local/tmp/usb_mount.sh


This should disconnect and reconnect your device as USB Mass Storage.

Comment if you face any issues.