USB Mass Storage mode?

Search This thread

Spacy02

New member
Nov 20, 2010
1
1
Well basically nothing of that has to with usb mode. A quick rundown:

Code:
Android Version
4.0.4
self explaining

Code:
Baseband
I9300NELE4
the version of the software responsible for cellular connection (voice call, 3g, umts, etc)

Code:
Kernel Version
3.0.15-554452-user
The linux kernel. 3.0.15 is the standard kernel version, -554452-user is an addition that is vendor dependant. Just see it as an identifier.
Code:
se.infra@SEP-74#1
the user and pc name (user@pcname) that this kernel was "compiled" (build together) on. Not sure about the #1
Code:
SMP PREEMPT ..date etc
kernel features.
SMP means Symmetric MultiProcessor. The kernel is capable of using multiple cores
PREEMPT means this is a preemptive kernel. It also has to do with managing multiple programs running at the same time. See en.wikipedia.org/wiki/Preemption_%28computing%29

Code:
Build number
IMM76D.I9300XXALE8
The build number of the ROM, also basically an identifier, does contain year and month of release. Not 100% sure for S3, but for earlier galaxy s devices see for example ykkfive.blogspot.de/2012/02/samsung-firmware-version-number.html



Spacy

P.S: Sorry not able to post links yet, so just copy the links to your browsers address bar.
 
  • Like
Reactions: aNYthing24

pizzaman79

Senior Member
Jul 4, 2008
345
30
Leiden
Working real solution
Through some heavy googling and trial&error I've found out how to mount the external SDcard as a _REAL_ mass storage.
Warning: requires root and might cause some issues. Stock kernel works

Here's what you'll have to run on the shell:
Code:
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

Within a few seconds the external(!) SD-card should now pop up on your computer as a mass-storage device. I've found no issues so far and doesn't require the SD-card to be unmounted in the phone since it's a LUN target.
As usual this is not reboot-persistant so if you need it a lot use GScript lite to automate it.

Can anyone confirm this?
 

Siran

Member
Aug 21, 2010
23
8
Tried and nothing happened.

The script works, but only half way for me. It works as in my PC now shows two drive letters, one of which is my SD card with all its files, the other looks like its the internal storage and is unaccessible. So far so good.

Sadly, my car-radio seems to not like the two drive letters and doesn't even show an error message (which it does when I connect the phone in MTP mode).

So, for me it didn't help, but for those who just need the drive letter on PC this solution seems to work (tried on a Windows XP machine with Kies installed).

Is there any way to edit the script, so that only the (external) SD card is shown as a drive letter without the other (internal?) drive, that is unaccessible anyway?
 
Last edited:

CSeb95

Senior Member
Jun 13, 2010
268
54
Paris - France
What is USB Mass Storage mode? :confused:
If i connect my S3 with my pc i wont be able to see my sd card files and copy-paste whatever i want?

USB Mass storage allows your computer to see your phone as a USB stick.

With ICS USB mass storage mode disappeared the main reason is :
- when mounting storage as Mass storage the android can no more access the storage, it's only available to the external computer. It may be a problem as somme applications store data on it.
- because with mass storage the file system must be readable by the external computer.

MTP (Media Transfert Protocol) works on Win7 but need to be installed or activated on XP. No need to install any samsung driver for that.

MTP was designed for media player connection, it does not really meet the need for a phone connection.
 

d4fseeker

Senior Member
Oct 16, 2010
1,300
437
Is there any way to edit the script, so that only the (external) SD card is shown as a drive letter without the other (internal?) drive, that is unaccessible anyway?
The drives are shown before mounting the phone but as empty removable-media devices.
The second command populates the first drive with the SD-card filesystem.

Are you sure you ran it without a typo when the phone was connected to the car hifi? No error message _SHOULD_ mean the stereo was waiting for a device to be plugged in, which is correct when the phone reports empty mass storage slots.
The car should be able to handle a device reporting multiple drives.


Please try again but append:
Code:
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
echo 1 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/ro
This will make it populate the other drive with the Sdcard too, but as read-only (since both lun's don't seem to sync until mounted again) if that's what's bothering your car.
 
  • Like
Reactions: Siran

Danielfr

Senior Member
Aug 29, 2008
259
22
Antwerpen
I used the USB mass storage mode, to sync my eWallet applications between PC and SIII :-(

If I understand right, on SIII it doesn't do anymore, is it correct ???

Thanks a lot
Ciao

There is a new version of Ewallet that doesn't require anymore the USB storage mass mode because you can now synchronize your Pc and your S3 via Wifi.

Daniel
 

gumpelstilzchen

Senior Member
Mar 28, 2010
81
384
Working real solution
Through some heavy googling and trial&error I've found out how to mount the external SDcard as a _REAL_ mass storage.
Warning: requires root and might cause some issues. Stock kernel works

Here's what you'll have to run on the shell:
Code:
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

Within a few seconds the external(!) SD-card should now pop up on your computer as a mass-storage device. I've found no issues so far and doesn't require the SD-card to be unmounted in the phone since it's a LUN target.
As usual this is not reboot-persistant so if you need it a lot use GScript lite to automate it.

You are my hero. Confirmed working with linux (had to install fuse-exfat first and needed to mount it manually, but anyway, hooray!)

MTP was a real PITA

Thank you.
 

ufo3k

Member
Jul 20, 2010
5
0
No USB Mount Shown

i face the same problem, having S3 was like a good damm device yet piss me off when i couldn't see the USB Connect Mode...

awaiting stock updates before i do the root...
finger cross...:D
 

Siran

Member
Aug 21, 2010
23
8
The drives are shown before mounting the phone but as empty removable-media devices.
The second command populates the first drive with the SD-card filesystem.

Are you sure you ran it without a typo when the phone was connected to the car hifi? No error message _SHOULD_ mean the stereo was waiting for a device to be plugged in, which is correct when the phone reports empty mass storage slots.
The car should be able to handle a device reporting multiple drives.

Thanks again for the reply and your help, really appreciate it!

It seems I was too impatient while waiting for my car to recognize the drive. While driving home yesterday it recognized the SD-card as a drive after a short while and I could play files from it, so thanks!!

Only problem I had was with "hickups" in regular intervals (appr. 90s apart) where the car-radio lost connection for several seconds but immediately reconnected and resumed playing. I could fix this by closing all tasks via task-manager - maybe something was trying to access the now mounted SD-card in the background. After I closed all programs this way, it stayed connected without any problems :)
 
Last edited:

BoneMo

Senior Member
Jun 25, 2009
2,018
290
Prague
Working real solution
Through some heavy googling and trial&error I've found out how to mount the external SDcard as a _REAL_ mass storage.
Warning: requires root and might cause some issues. Stock kernel works

Here's what you'll have to run on the shell:
Code:
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

Within a few seconds the external(!) SD-card should now pop up on your computer as a mass-storage device. I've found no issues so far and doesn't require the SD-card to be unmounted in the phone since it's a LUN target.
As usual this is not reboot-persistant so if you need it a lot use GScript lite to automate it.

a NON working solution :(

tried windows 7 64bit, windows 8 consumer preview 32 bit, reboot phone etc. but after this script i can see just 2 empty removable drives and nothing else
 

d4fseeker

Senior Member
Oct 16, 2010
1,300
437
That means your phone successfully entered mass storage mode (first command) but could not map the sdcard filesystem to it's virtual drive (second command)
Which again usually means you got a typo. It will return an error message on failure (e.g: no such file, permission denied, ...), please post it here.

Also please post your kernel/build version. I'm on stock ALE8 build with root-patch and can confirm it work on 2 S3's on Windows7 32bit, 64bit and Ubuntu 12.04
 

d4fseeker

Senior Member
Oct 16, 2010
1,300
437
@Siran (and everyone else)
I've updated the script so that it includes unmounting the SDcard before going into mass storage mode and remounting it afterwards.
That might not only fix your car stereo's hiccups but also makes sure the file system is not thrashed for being mounted on 2 different locations simultaneously.
 
  • Like
Reactions: Siran

Siran

Member
Aug 21, 2010
23
8
thanks for updating the script! Just to be clear - the line that was changed from the original script is "umount /mnt/extSdCard" right? So I only have to add this to my GLite Script (in the correct order of course) for the mass storage option?

thx again!
 

d4fseeker

Senior Member
Oct 16, 2010
1,300
437
Yes.
And the remount through the 'vold' command after clearing the mountpoint for the mass storage mode.

So you've gone from 1 (enable) to 2 gscript's (enable and disable).
 
  • Like
Reactions: Siran

Siran

Member
Aug 21, 2010
23
8
Thx again - I wasn't sure about the remounting, but it all makes sense now :)

Such a great script, now I can fully enjoy my S3! :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    After some time of usage and experimentation, I've come to the conclusion that the filesystem takes too much damage from being mounted in 2 different locations which might cause data loss, corruption and other issues on concurrent or cached writes (especially on the filesystem index).
    So I recommend unmounting the filesystem for the phone before using it externally.
    This brings the commands to:

    One-Time preparation
    Code:
    setprop persist.sys.usb.config mass_storage,adb

    To revert to MTP mode
    Code:
    setprop persist.sys.usb.config mtp,adb

    Mount SDcard (Unmounting might fail when SDcard is in use, so don't just assume it works!) [works for international i9300 only]
    Code:
    umount /mnt/extSdCard
    echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
    -or for all other versions, including the US-variant-
    Code:
    umount /mnt/extSdCard
    mount | grep /mnt/extSdCard | cut -f 1 -d " " > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

    Unmount from computer (Warning: as usual 'eject' on computer first)
    Code:
    echo "" > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
    vold


    This will make it no longer possible to use the contents on the external SD card when it is mounted on the computer, the rest of the phone (including 99% of your apps) will still work.


    ---- HERE ARE THE GSCRIPT SCRIPTS ----
    Make sure the 'Needs root' checkbox is ticked!
    Start-Script:
    Code:
    setprop persist.sys.usb.config mass_storage,adb
    umount /mnt/extSdCard
    mount | grep /mnt/extSdCard | cut -f 1 -d " " > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

    Stop-Script
    Code:
    echo "" > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
    vold
    setprop persist.sys.usb.config mtp,adb

    To use, please install 'GScript Lite' from the market.
    Open the app, press hardware Menu-button and select 'Add script'.
    Name the script 'Mass Storage' and type the contents of the above 'Start-Script'.
    Press Save and repeat with second Script above but name it 'MTP Mode'.
    Go back to your launcher and add a Shortcut. Choose 'GScript Lite' and select the 'Mass Storage' script.
    Repeat with the 'MTP Mode' script.

    Connect your phone to the computer and press the 'Mass Storage' shortcut on your home screen. Enjoy =)
    When finished, eject the Disk from the computer (important!), then press the 'MTP Mode'.

    -----BELOW IS ONLY KEPT FOR INTEGRITY's SAKE----

    Working real solution
    Through some heavy googling and trial&error I've found out how to mount the external SDcard as a _REAL_ mass storage.
    Warning: requires root and might cause some issues. Stock kernel works

    Here's what you'll have to run on the shell:
    Code:
    setprop persist.sys.usb.config mass_storage,adb
    echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

    Within a few seconds the external(!) SD-card should now pop up on your computer as a mass-storage device. I've found no issues so far and doesn't require the SD-card to be unmounted in the phone since it's a LUN target.
    As usual this is not reboot-persistant so if you need it a lot use GScript lite to automate it.
    5
    You can still access and move all your files when connected to a Pc.
    In MTP your S3 tells the computer "look, I'm a phone with 2 storage devices", allowing you to tether via USB and acces your data.

    In Mass-Storage mode it tells your computer "look, I'm 2 Usb Sticks" which quito frankly is stupid.
    However mass storage is faster and works out-of-the-box with programs and hardware (like car radios) that are not designed for this usage scenario.
    (Note: on your computer you can easily create a virtual drive mapping to your phone's storage afaik, so no worries there)

    The whole reason for not allowing mass storage is actually 2 issues:

    - in MS the phone cannot use the sdcards while they're mounted on the computer, causing all sorts of issues with apps.

    - MS requires the compute to recognize the filesystem. Pretty much the only filesystem all major Os can access is the 15-ish year old vfat which tends to corrupt easily, is slow and has several other major drawbacks.
    In MTP the phone's system converts the filesystem to a standarized open protocol, allowing it to e.g. use the brand-new highly sophisticated ext4 linux filesystem instead of some legacy stuff Microsoft invented years ago.
    2
    I know this thread is for the international version, but I tried it on my T-Mobile version just to see if it would work.
    We should probably take this to a different forum (e.g., http://xdaforums.com/showthread.php?t=1731514) but the short answer is that the external card (at least for the AT&T version - probably T-Mobile as well) is at /dev/block/vold/179:97 instead of 179:17 and there doesn't seem to be an equivalent to the s3c-usbgadget folder (which is processor-specific).
    2
    here the script.

    Move back to MTP Mode

    setprop persist.sys.usb.config mtp,adb
    echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
    2
    That's an app in the Play Store.

    If you have ADB on the computer you may use it too, but I figure since you already ask about Terminal Emulator, that it's not the case.
    For your conveniance I've attached adb anyway as a zip file. Extract the contents to C:\Windows
    Open a Dos Promt (cmd) and type 'adb shell'