Usb storage mass and ICS

Search This thread

Danielfr

Senior Member
Aug 29, 2008
255
22
Antwerpen
Solution:


How to enable USB mass storage on Android 4.0 ICS Samsung Galaxy S2?
1.Bring up Settings.
2.Click More… (under Wireless and network).
3.Then select USB utilities ~ Set USB cable connection mode.
4.Select Connect storage to PC then.
5.Connect USB cable from phone to PC.
6.Select Turn on USB storage.
7.That’s all.
 
Last edited:

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
OR, if you hate going through the menus everytime, you can do like I did and enable the USB mass storage by default (instead of that MTP which doesn't work on Mac OS).

Solution A - put this in your init script (if you have a kernel which supports init scripts, currently only CF-Root works on ICS).

Code:
setprop persist.sys.usb.config "mass_storage,adb"

Solution B - add/change the same settings in build.prop (you probably have now "persist.sys.usb.config=mtp,adb".

Code:
persist.sys.usb.config=mass_storage,adb

And reboot. When you connect your cable, it will default to USB mass storage mode just like it did on Gingerbread.
 

harise100

Senior Member
Oct 20, 2011
1,015
290
Solution C: JKay or any other ROM maker, add a button to the Message bar.

Sent from my GT-I9100 using XDA
 

Danielfr

Senior Member
Aug 29, 2008
255
22
Antwerpen
OR, if you hate going through the menus everytime, you can do like I did and enable the USB mass storage by default (instead of that MTP which doesn't work on Mac OS).

Solution A - put this in your init script (if you have a kernel which supports init scripts, currently only CF-Root works on ICS).

Code:
setprop persist.sys.usb.config "mass_storage,adb"

Solution B - add/change the same settings in build.prop (you probably have now "persist.sys.usb.config=mtp,adb".

Code:
persist.sys.usb.config=mass_storage,adb

And reboot. When you connect your cable, it will default to USB mass storage mode just like it did on Gingerbread.

I have "persist.sys.storage_preload=1"
 
  • Like
Reactions: penfold99 and post8

Elemetrix

Senior Member
Apr 28, 2010
190
10
Nice solution above but I just really wish it could be handled like my old HTC on GB with the dropdown notification.

Sometimes I just want to charge, sometimes mtp will do but more often mass storage.
 

Fed03

Member
Mar 19, 2012
41
0
i rly need this feature...i use it everyday to connect my gs2 to my car stereo....there'sno app capable a the moment?
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
That has nothing to do with what I wrote; as these are computers, even one letter makes a big difference, nevermind one entire word ;)

I've checked the default build.prop files on XXLPQ and ZSLPE and they don't seem to include this setting by default, so you probably have to add it manually; either remount /system as r/w and edit through vi in ADB, either use build.prop Editor from the market.

@Elemetrix: changing the system property mentioned before gives you the old style setting instead of MTP.
 
Last edited:
  • Like
Reactions: Elemetrix

xinfinityoO

Senior Member
May 14, 2011
2,209
574
Wellington
That has nothing to do with what I wrote; as these are computers, even one letter makes a big difference, nevermind one entire word ;)

I've checked the default build.prop files on XXLPQ and ZSLPE and they don't seem to include this setting by default, so you probably have to add it manually; either remount /system as r/w and edit through vi in ADB, either use build.prop Editor from the market.

@Elemetrix: changing the system property mentioned before gives you the old style setting instead of MTP.

editing build.rpop..didnt work
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
What exactly didn't work ? is it still going to MTP, is it not working at all anymore ?

Easiest way to check is to do a
Code:
getprop | grep usb
in Terminal Emulator and see if the values have changed.
 

xinfinityoO

Senior Member
May 14, 2011
2,209
574
Wellington
What exactly didn't work ? is it still going to MTP, is it not working at all anymore ?

Easiest way to check is to do a
Code:
getprop | grep usb
in Terminal Emulator and see if the values have changed.

it is still picking as mtp,adb when i grep it. but i have confirmed i changed it in build.prop.. found under systems
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
it is still picking as mtp,adb when i grep it. but i have confirmed i changed it in build.prop.. found under systems

Was the build.prop saved ? can you grep the property name in build.prop and check it's still there after rebooting the phone ?

The
Code:
getprop | grep usb
should give you two more properties: sys.usb.config and sys.usb.state. They should have the same mass_storage,adb value.
 

xinfinityoO

Senior Member
May 14, 2011
2,209
574
Wellington
Was the build.prop saved ? can you grep the property name in build.prop and check it's still there after rebooting the phone ?

The
Code:
getprop | grep usb
should give you two more properties: sys.usb.config and sys.usb.state. They should have the same mass_storage,adb value.

yes it was saved.. i even checked with root explorer.. and the rest of properties also states the same mtp,adb. can you attach your buildprop for me to test..

thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 37
    As mentioned, my build.prop doesn't have anything related to this (I prefer to modify it as less possible due to the pesky checks done by Market). The shell script is at /system/bin/customboot.sh and contains the two commands mentioned above (with setprop). The /init.smdk4210.usb.rc is in the / filesystem (root). However I don't remember if it came with the stock ROM or after flashing Chainfire's kernel.

    Ok, I'll try to make a small tutorial since it's been asked already (standard disclaimer, no liabilities or responsibilities, test on your own will; it shouldn't break anything though):

    #0. This will work only with a kernel supporting init.d scripts. Currently, only CF-Root does this, so... get CF-Root.

    #1. Copy/paste the following in a text file exactly as it is:

    Code:
    #!/system/bin/sh
    /system/bin/setprop sys.usb.config mass_storage,adb
    /system/bin/setprop persist.sys.usb.config mass_storage,adb
    /system/bin/setprop sys.usb.state mass_storage,adb

    Save this file as "customboot.txt".

    #2. Remount your /system with ADB (through command prompt or whatever):

    Code:
    > adb remount /system
    remount succeeded

    #3. Push the new file on your phone:

    Code:
    > adb push customboot.sh /system/bin/customboot.sh

    #4. Reboot.

    After rebooting, check the properties listed above in a shell (obtained with ADB or Terminal Emulator):

    Code:
    root@android:/ # getprop | grep usb

    It should look like this:

    Code:
    [persist.sys.usb.config]: [mass_storage,adb]
    [sys.usb.config]: [mass_storage,adb]
    [sys.usb.state]: [mass_storage,adb]

    And when you plug the USB cable, the familiar "USB connected" notification should appear.
    Thanks for posting this. It works for me on my SGS2 :D Really hated using MTP and this method allows me to use USB mass storage mode without disabling USB debugging :p

    For the ease of others, I have made the above script as CWM flashable update zip. BUT before using this flashable zip, make sure you do not have an existing customboot.sh in place as this will overwrite it! Nandroid backup first to be safe (always a good practice). I will not be responsible for whatever it does to your phone.

    Only download after you have understand the above.

    Edit: Move download from Box.com share (511 download counts :)) to forum attachment.
    14
    Solution:


    How to enable USB mass storage on Android 4.0 ICS Samsung Galaxy S2?
    1.Bring up Settings.
    2.Click More… (under Wireless and network).
    3.Then select USB utilities ~ Set USB cable connection mode.
    4.Select Connect storage to PC then.
    5.Connect USB cable from phone to PC.
    6.Select Turn on USB storage.
    7.That’s all.
    13
    OR, if you hate going through the menus everytime, you can do like I did and enable the USB mass storage by default (instead of that MTP which doesn't work on Mac OS).

    Solution A - put this in your init script (if you have a kernel which supports init scripts, currently only CF-Root works on ICS).

    Code:
    setprop persist.sys.usb.config "mass_storage,adb"

    Solution B - add/change the same settings in build.prop (you probably have now "persist.sys.usb.config=mtp,adb".

    Code:
    persist.sys.usb.config=mass_storage,adb

    And reboot. When you connect your cable, it will default to USB mass storage mode just like it did on Gingerbread.
    10
    As mentioned, my build.prop doesn't have anything related to this (I prefer to modify it as less possible due to the pesky checks done by Market). The shell script is at /system/bin/customboot.sh and contains the two commands mentioned above (with setprop). The /init.smdk4210.usb.rc is in the / filesystem (root). However I don't remember if it came with the stock ROM or after flashing Chainfire's kernel.

    Ok, I'll try to make a small tutorial since it's been asked already (standard disclaimer, no liabilities or responsibilities, test on your own will; it shouldn't break anything though):

    #0. This will work only with a kernel supporting init.d scripts. Currently, only CF-Root does this, so... get CF-Root.

    #1. Copy/paste the following in a text file exactly as it is:

    Code:
    #!/system/bin/sh
    /system/bin/setprop sys.usb.config mass_storage,adb
    /system/bin/setprop persist.sys.usb.config mass_storage,adb
    /system/bin/setprop sys.usb.state mass_storage,adb

    Save this file as "customboot.txt".

    #2. Remount your /system with ADB (through command prompt or whatever):

    Code:
    > adb remount /system
    remount succeeded

    #3. Push the new file on your phone:

    Code:
    > adb push customboot.sh /system/bin/customboot.sh

    #4. Reboot.

    After rebooting, check the properties listed above in a shell (obtained with ADB or Terminal Emulator):

    Code:
    root@android:/ # getprop | grep usb

    It should look like this:

    Code:
    [persist.sys.usb.config]: [mass_storage,adb]
    [sys.usb.config]: [mass_storage,adb]
    [sys.usb.state]: [mass_storage,adb]

    And when you plug the USB cable, the familiar "USB connected" notification should appear.
    3
    i think it should be setprop persist.sys.usb.config mass_storage,adb

    That is correct. Ok, not giving up that easily; try it like this:

    Code:
    setprop sys.usb.state mass_storage,adb
    setprop persist.sys.usb.config mass_storage,adb

    or in build.prop:

    Code:
    sys.usb.state=mass_storage,adb
    persist.sys.usb.config=mass_storage,adb

    It's basically the same thing, we just want to set these two properties; doesn't matter much if it's through build.prop or setprop. Changing these should trigger a sub-routine present in /init.smdk4210.usb.rc - do you have this file ?