Monday, August 29, 2016

6.0 marshmallow - Mounting .img from internal storage as USB Mass Storage


I am trying to mount an .img file from my internal storage as Usb Mass Storage.


There is an Android App named DriveDroid which does exactly what I wanted. I tested with this app and the app successfully mounted an .img file as USB Mass Storage.


But I am unable replicate the same manually.


Anybody having any information on how to mount .img as UMS ?


Phone Details:

  Model : Moto G 2013
  Device Name : falcon
  Rooted : YES
  OS : CyanogenMod 13.0


Thanks.



Answer



Here are the Terminal commands:


su
echo /sdcard/your_image.img > /sys/class/android_usb/f_mass_storage/lun/file
echo 1 > /sys/class/android_usb/f_mass_storage/lun/cdrom

setprop sys.usb.config mass_storage

(The location of LUN may vary for some devices, you can manually check/search for it even using File Explorer..)


If above commands fail, you might want to disable SE Linux by setenforce 0 command to set it to Permissive, and try again..


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...