I developed some scripts for switching to and from mass storage, using posts for the GT-I9300 and for the Xperia S. You can unzip them (attached) to the root of your internal sdcard. You can then easily import them into GScript Lite, available for free through the Play store.
For reference, the commands are as follows:
Just plug in your phone and run:
echo 0 > /sys/devices/virtual/android_usb/android0/enable umount /mnt/extSdCard/ echo "mass_storage,adb" > /sys/class/android_usb/android0/functions echo "/dev/block/vold/179:97" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun_ex/file echo 1 > /sys/devices/virtual/android_usb/android0/enable
Unmount/Eject in your operating system first, to be sure. Then:
echo "" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun_ex/file echo 0 > /sys/devices/virtual/android_usb/android0/enable echo "mtp,acm,adb" > /sys/class/android_usb/android0/functions echo 1 > /sys/devices/virtual/android_usb/android0/enable vold
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file seems to be prepared for the internal sdcard, but I have had no success in using it in conjunction with the device, /dev/block/vold/179:96. At least the external works.