[Q] USB Masst Storage ? UMS ...

Search This thread

Captain_Throwback

Recognized Developer
Gpe isn't aosp so I had some hope. My m8 is a gpe from the play store, not a rom or ruu. Even if it just worked in a version of twrp that would be fine, it's rare when I need ums but often enough to where I'd gleefully spend $20 on it.

Sent from my HTC One_M8 using XDA Premium 4 mobile app
Where's my $20?

;)
 

billqu

Member
May 2, 2015
10
1
UMS on HTC M7

Here is a quick tuto from a friend:

echo 0 > /sys/class/android_usb/android0/enable
echo 22D9 > /sys/class/android_usb/android0/idVendor
echo 2767 > /sys/class/android_usb/android0/idProduct
echo adb,mass_storage > /sys/class/android_usb/android0/functions
echo /storage/sdcard1/debian.iso > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
echo 1 > /sys/class/android_usb/android0/enable

Here is the interesting part:
root@htc_m8:/storage/emulated/legacy # cat /sys/class/android_usb/android0/functions
mtp,adb,mass_storage

This means ... my kernel can do UMS. I will dig this later.

Sounds like this method can be used to simulate several devices at the same time: several HDD, several CDs ...


Hi doublehp,

Your is the closest I have come to what I call as 'hope'! I've been trying for the past three weeks to recover data from my HTC One M7 after an accidental factory reset.:crying: In order to use a Recovery Software(I have R-Studio), the phone needs to be mounted as a USB drive. Unfortunately, I cannot find a way to disable MTP and enable UMS on my phone.

I haven't tried DriveDroid yet. I want to be sure (at least as much as possible) before I write more data into the drive thereby overwriting my previous data. My phone has an unlocked bootloader, rooted and has terminal emulator on it. I can access it through adb shell from my PC. I tried the last command you have quoted. I got this.

root@m7:/ # cat /sys/class/android_usb/android0/functions
mtp,adb,mass_storage

Using lsusb, I got the following
root@m7:/ # lsusb
lsusb
Bus 001 Device 002: ID 05c6:9048
Bus 001 Device 001: ID 1d6b:0002

I'm not sure what device 001 & 002 stand for and which ones to use for the IDs. Is there a way to activate UMS with a similar set of commands?

Else, my option seems to be DriveDroid. I have the following.

Android 5.0.2
HTC Sense 6.0
Software Number 7.17.1540.7
Kernel 3.4.10-g3c9a631
Baseband Version 4T.35.3218.16_10.33Q.1718.01L
Build Number 7.17.1540.7 CL468180

Is it possible for DriveDroid to enable UMS on my device? Please let me know.

Thanks a lot in advance....

---------- Post added at 01:43 PM ---------- Previous post was at 01:08 PM ----------

Not sure if you're still trying to figure this out, but I got UMS working in TWRP ;). Link is in my sig.

Hi Captain_Throwback,

I have the following on my HTC One M7 (no external SD card, unlocked bootloader, rooted, superSU installed). I'm trying to mount the internal storage as a drive and recover data.

Android 5.0.2
HTC Sense 6.0
Software Number 7.17.1540.7
Kernel 3.4.10-g3c9a631
Baseband Version 4T.35.3218.16_10.33Q.1718.01L
Build Number 7.17.1540.7 CL468180

Can the TWRP ROM you quote enable UMS on my device? I'm currently running TWRP v2.8.0.2 and cannot activate UMS with the Mount option. Please let me know.

Thanks a lot in advance....
 

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
There is an app called disk digger that has a high success rate of recovering deleted stuff.
Or you could go the create image of the said partition route and then use Windows recovery software on it.
 

billqu

Member
May 2, 2015
10
1
There is an app called disk digger that has a high success rate of recovering deleted stuff.
Or you could go the create image of the said partition route and then use Windows recovery software on it.

Hi ashyx,

I have tried making an image with the technique mentioned here (http://xdaforums.com/galaxy-nexus/general/guide-internal-memory-data-recovery-yes-t1994705). However, I couldn't find anything recoverable! I'm not sure what kind of copy the 'dd' command does. I could find only the files from the existing partitions and nothing from before the factory reset. I find it hard to believe that 'factory reset does a low level erase of the internal drive. About DiskDigger, I'm not sure of installing apps on my device and overwrite any possible data especially when there's no guarantee that the app can do anything.

The last resort for me is to get the internal memory mounted somehow as a UMS and the access it directly from the recovery software I have on my PC.

Thanks for your reply....
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    The phone doesn't offer UMS. Be disappointed all you want, it's not going to happen mate.
    1
    Hello. I have a semi good news.

    My view of the world changed tonight.

    I received a message from andreasyeah telling me to try https://play.google.com/store/apps/details?id=com.softwarebakery.drivedroid&hl=en ... and it's amazing. He also recommends to use ElementalX kernel.

    First, what UMS was for me untill yesterday ? Use my phone as SD to USB card adapter, and, make my PC able to read and write on SD, as if SD was in a legacy USB card reader. Plug phone, android unmounts sd, and pushes SD to USB, and PC can mount the SD, and do whatever it wants to it.

    Whatever used to include .. repartition, reformat, and, some some of my friends like Galoula ... install a MBR on SD, so that, when any PC is broken, he can boot the PC by just plugging the phone. His phone became a classic external disk. Android could partly read the SD, with limitations (legacy android can only read first partition in FAT; having fat on non first part, and, reading non FAT partitions requires ... manual operations).

    This app does things a completely differen way. To make the story short ... it downloads an ISO over internen, store it in your phone (at any place you like, any folder), and, presents this ISO as a USB-CD. Emulates the USB-CD, and provides the media inside. App let you choose amongst large choice of distributions, install CD, and live CDs. The last option is to ask the app to create an empty drive, and, eventually, format it in FAT.

    Negs:
    - phone is no more a SD adapter
    - copying files from phone to PC requires to manually mount the FAT block, copy, unmount; then, the app will show it as a CD
    - copying from PC to phone requires a CD burning soft, and will erease the whole block
    - the process can fail at many places. Phone can fail to emulate the CD. PC can fail to detect it. But, in most case, PC will fail to see partitions inside the CD. Also, for me, boot failed on two computers (BIOS could see the USB CD drive, but boot failed without reason)
    - apps only emulates a CD; so, in short, the volume is READ ONLY. Except for CDRW softs.

    Advantages:
    - can work for phones that do not have SD slot
    - can store as many boot sections as you want.
    - include a large pannel of distributions, live CD, and other similar stuff
    - provides partial workaround for people like us who are limited to MTP by default.
    - UMS independant from SD
    - images can be stored at any place in the phone (or even over network for me ^^ my phone mounts NFS, Samba, CIFS, SSHFS ... )

    Apps has good design, and offers a variety of UMS implementations, and a blacklist for phones known to not work.

    Success is heavily ROM and kernel dependant.

    So, depending on the reasons why you want UMS ... this could be an alternative. Or not :)

    I am going to test related apps over night; first needed to make my report for this one.
    1
    Here is a quick tuto from a friend:

    echo 0 > /sys/class/android_usb/android0/enable
    echo 22D9 > /sys/class/android_usb/android0/idVendor
    echo 2767 > /sys/class/android_usb/android0/idProduct
    echo adb,mass_storage > /sys/class/android_usb/android0/functions
    echo /storage/sdcard1/debian.iso > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
    echo 1 > /sys/class/android_usb/android0/enable

    Here is the interesting part:
    root@htc_m8:/storage/emulated/legacy # cat /sys/class/android_usb/android0/functions
    mtp,adb,mass_storage

    This means ... my kernel can do UMS. I will dig this later.

    Sounds like this method can be used to simulate several devices at the same time: several HDD, several CDs ...
    1
    Not sure if you're still trying to figure this out, but I got UMS working in TWRP ;). Link is in my sig.