[Q]Kitkat and USB mass storage mode

Search This thread

GokulNC

Senior Member
Jan 10, 2015
826
1,440
Chennai
github.com
I have scripts that can enable it on KK. Check the attachment. It has 2 scripts. Copy them to ur phone and use Script Manager (SManager) to run it under Root, One to enable UMS and other to disable it.

I have made shortcuts of the scripts from SManager on my Home page so that I can press one to enable and other to disable it. have fun...

Can you please explain me how the script logically works.

I need this because DVDs, TVs and other phone's OTG don't recognize MTP protocol for File Transfer.
USB Mass Storage is the only way in these cases.

I own a different phone (not S4), so I want to know how to make a script for my phone.
Thanks :)
 
Last edited:

manu8586

Member
Aug 2, 2013
15
1
Poitiers
Hi,
Didn't get any problem with USB mass storage on my S4. I just use Paragon NTFS&HFS+ or Total Commander for NTFS drives ;)
 

TKPL

Senior Member
Sep 12, 2013
98
7
This worked for me:
Mass Storage Enable Routine for the External SD Cad on Samsung Galxy S3 I9305 with KitKat Android 4.4.4 Build KTU84P.I9305xxufnl1
1. Root the phone!
2. Update the SU Libraries (SUperSu on PlayStore)!
3. Install Mass Storage Mode Note3*ROOT (PlayStore)!
4. Install SManager (Script Manager , PlayStore)!
5. Create folder KitKatUMS somewhere on the internal SD card!
6. Place the scripts from the ZIP File into the KitKatUMS Folder!
Here is the text of the Enable Script (File Name “Mass Storage Mode”:
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
7. Open the Script File “Mass Storage Mode” with SManager
8. Select "Su" (green skull and crossbones icon), "Boot" (cogwheel icon), and "Bg" (& icon). (Note:Selecting "Boot" will ensure that the script enabling UMS mode is automatically run each time the phone starts up )
9. Select "Save" and "Run"
10. Open the Enabler (Install Mass Storage Mode Note3*ROOT (PlayStore)
11. Select MSM Mode
If the Solution does not work with your phone, try folowing:
- Solution 2: The Path “…*/s3c-usbgadget/gadget/lun0/file” is not correct. Go to /sys/devices/platform/ using File Explorer and try to findout the corect driver path
- Solution 3: “179:17” is not the correct parameter... Open the mounted-devices-list (<root>/proc/mount) with text editor and look for the access parameter of your SD card.

For instance look for similar text: “/dev/block/vold/179:17 /mnt/media_rw/extsdCard vfat

Usually “179:17” or “s3c-usbgadget” are to be replaced with the proper values.
JJdoctor used in the primary script (Post #2) msm_hsusb instead s3c-usbgadget
Corect the script file with the proper text and try again!

All this is on your own risk!

Hello Samsung friends :) I don't have an S4, I have a Find7a. How can I modify this script to my phone? As it is now, it doesn't work, it says:
can't create /sys/devices/platform/msm_hsusb/gadget/lun0/file: No such file or directory :(
 
Last edited:

beavermjr

Senior Member
Dec 29, 2009
198
5
Albany
Hey there, everyone. I have a Verizon Galaxy s5 and the script that was provided didn't work as the directory was wrong. I would modify the script to have the correct one, but do not know what to change the script to. Can someone help? My S5 is running kitKat 4.4.2. I downgraded from lollypop in order to root.
 

adrianadro

New member
Aug 27, 2012
2
0
Lenovo s860

For Lenovo s860

setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:8 > /sys/devices/platform/mt_usb/musb-hdrc.0/gadget/lun1/file
 

b90210

New member
Oct 11, 2006
4
2
Tried hard for a few hours now on
Samsung GT-I9195I aka S4 Mini Plus aka S4 Mini Value Edition aka S4 Mini VE
(this is the S4 Mini with the quadcore CPU) with Stock Android 4.4.4

No App worked, but

setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:65 > /sys/devices/platform/msm_hsusb/gadget/lun1/file

did the trick for me.

Difference ist 179:65 and lun1 (not lun0)

It also mounts an additional CD-Rom drive but there is no access (and i dont need it because the other USB drive works fine for Read and Write)

Thank you all very much. Great Forum.
 
Last edited:
  • Like
Reactions: Old faithful

Old faithful

Senior Member
Dec 31, 2008
595
205
Wentworth-Nord
Tried hard for a few hours now on
Samsung GT-I9195I aka S4 Mini Plus aka S4 Mini Value Edition aka S4 Mini VE
(this is the S4 Mini with the quadcore CPU) with Stock Android 4.4.4

No App worked, but

setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:65 > /sys/devices/platform/msm_hsusb/gadget/lun1/file

did the trick for me.

Difference ist 179:65 and lun1 (not lun0)

It also mounts an additional CD-Rom drive but there is no access (and i dont need it because the other USB drive works fine for Read and Write)

Thank you all very much. Great Forum.

Nice - the CD-ROM thing is pretty much a side effect of gaining access, I got the same effect on my Note 2 connecting to the PC (although it is running 4.1.2). The CD-ROM is essentially the internal memory that you can't access (although there are ways to access it as well, but that is way more flaky and risky). The most important thing is you finally got full ownership of YOUR SD Card ;)
 

BigJim.T32

Member
Jan 16, 2010
41
20
A little for your information everyone

I installed the cyanogen mod 12 which claimed to have usb mass storage enabled on it.
It does and this works perfectly and I am very pleased with the performance. Just a simple option when you connect the device to change to usb storage.

http://xdaforums.com/galaxy-s4/i9505-orig-develop/rom-cyanogenmod-12-t2943934

Bit of a quote-resurrection I confess, but could you elaborate please? :)

I'm running CM12.1, and have been trying for weeks to get true UMS (usb mass storage) to work, like it did back on my blade & Galaxy S2....
I've searched out apps and mods to enable it, and so far, no joy.

For me, CM12.1 "seems" to offer UMS - When I plug the phone in to my PC via usb cable and it mounts via MTP, I can then navigate to Storage Settings, and from there access a menu that gives the options for MPT, Camera, and UMS.
However, when I enable the UMS option, I can't actually read or write to the SD card in windows (using Win-7), so it's like the option is there, but disabled... :(
I see what I would expect (namely, the phone storage disappears from Windows Explorer, and the SD card appears as a flash drive), but when you navigate to the "flash drive", it appears as an empty drive with no data on it.

If you'd be so kind, would you explain in excruciating detail exactly what you did to enable true UMS on the S4 using CM12/12.1? :)

Many thanks!
 

GokulNC

Senior Member
Jan 10, 2015
826
1,440
Chennai
github.com
Bit of a quote-resurrection I confess, but could you elaborate please? :)

I'm running CM12.1, and have been trying for weeks to get true UMS (usb mass storage) to work, like it did back on my blade & Galaxy S2....
I've searched out apps and mods to enable it, and so far, no joy.

For me, CM12.1 "seems" to offer UMS - When I plug the phone in to my PC via usb cable and it mounts via MTP, I can then navigate to Storage Settings, and from there access a menu that gives the options for MPT, Camera, and UMS.
However, when I enable the UMS option, I can't actually read or write to the SD card in windows (using Win-7), so it's like the option is there, but disabled... :(
I see what I would expect (namely, the phone storage disappears from Windows Explorer, and the SD card appears as a flash drive), but when you navigate to the "flash drive", it appears as an empty drive with no data on it.

If you'd be so kind, would you explain in excruciating detail exactly what you did to enable true UMS on the S4 using CM12/12.1? :)

Check if this app helps:
http://xdaforums.com/android/apps-games/app-universal-mass-storage-enabler-beta-t3240097
 
  • Like
Reactions: BigJim.T32

ramsdaro

Member
Nov 26, 2014
10
1
hey sorry I am not longer running CM but if I recall you are doing everything right for it to work.
Only thing I can think of i that I thought I had to format my sd card to a specific format, try searching around for that. hopefully this help.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    So I used a HTC One X for two years and I used it a lot as a Dropbox synced external USB mass storage device, so am kinda interested in getting my S4 doing the same thing. Pretty much out of the box I left it updating and it's now a shiny S4 running 4.4.2.

    Sadly, after the update it seems that it is somewhat crippled.

    Apparently, the thing to use is USB mass storage enabler, for which it needs root. So I rooted using Autoroot (and triggered Knox 0x1) and installed Busybox, which is all working well. I also found that apps cant write to the SD Card, so I fixed that too....

    However, all the different ways I have tried the USB mass storage app, the best I can get is an empty USB drive.

    I've trawled through a series of other threads and blogs, but they all seem to recommend using the same applications and techniques, which seems not to be working for me.

    Any other suggestions greatly received.

    I have scripts that can enable it on KK. Check the attachment. It has 2 scripts. Copy them to ur phone and use Script Manager (SManager) to run it under Root, One to enable UMS and other to disable it.

    I have made shortcuts of the scripts from SManager on my Home page so that I can press one to enable and other to disable it. have fun...
    8
    Thanks to jjdoctor. Works like a charm. I have a Samsung S9505, Kitkat 4.4.2, rooted with Knox 0x1.

    1. I installed SManager from google play.
    2. I downloaded the scripts to /storage/emulated/0/documents/scripts/massstorage
    3. I opened SManager and navigated to the above script directory.
    4. I selected the "Mass Storage" script.
    5. I enabled "su" (green skull and crossbones second from left) and "bg" (looks like an &, second from right)
    6. I selected "run"
    7. Black screen with lines of text (it's a terminal) and it then appeared as a USB Mass Storage device.

    Even does not dismount it from Android, which is nice. I hate to think how that's gonna blow up in my face at some indeterminate point in the future. Almost tempted to add some conditions so I can use it as a toggle.... but for now its awesome.
    3
    So I used a HTC One X for two years and I used it a lot as a Dropbox synced external USB mass storage device, so am kinda interested in getting my S4 doing the same thing. Pretty much out of the box I left it updating and it's now a shiny S4 running 4.4.2.

    Sadly, after the update it seems that it is somewhat crippled.

    Apparently, the thing to use is USB mass storage enabler, for which it needs root. So I rooted using Autoroot (and triggered Knox 0x1) and installed Busybox, which is all working well. I also found that apps cant write to the SD Card, so I fixed that too....

    However, all the different ways I have tried the USB mass storage app, the best I can get is an empty USB drive.

    I've trawled through a series of other threads and blogs, but they all seem to recommend using the same applications and techniques, which seems not to be working for me.

    Any other suggestions greatly received.
    2
    How to use it my freind?? Should i just browse to location of the script and open them.and execute??

    Sent from my C6902 using Tapatalk

    Yes, execute in SManager with Root privileges
    2
    UMS on S4 GT-I9505

    Not Working on galaxy S4 Gt i9500

    Hy,
    I have the same problem with my S4 9505.
    I looked on the Script on Post 2 and i see a problem on my S4.
    The original Sript was this:

    setprop persist.sys.usb.config mass_storage,adb
    echo /dev/block/vold/179:33 > /sys/devices/platform/msm_hsusb/gadget/lun0/file

    The new code thats working for my S4 was this...
    setprop persist.sys.usb.config mass_storage,adb
    echo /dev/block/vold/179:32 > /sys/devices/platform/msm_hsusb/gadget/lun0/file

    See only the 33 to 32 changed and it worked...
    I hope that Help all people that have the same problem...

    You can use the SManager App to change the text of the Script or use my changed...
    I have a Samsung Gt-I9505 with KitKat 4.4.2 (root)