Usb storage mass and ICS

Search This thread

normally_crazy

Senior Member
Apr 9, 2006
111
7
Mumbai
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.

Download from: http://www.box.com/s/000684327a5035932167

Brilliant work ! The zip worked perfectly. Thanks.
 

tolis626

Senior Member
Dec 31, 2009
2,518
598
Amaliada
Tried this on latest AOKP and all I'm getting is a notification saying that the phone is in "Install mode" or something(my phone is in Greek) and when I click on that it takes me to the menu where I get to select between MTP and FTP.Any ideas?I despise MTP.
 

SDOF

Member
Mar 4, 2012
17
0
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.

Thanks mate
 

krkojzla

Senior Member
May 9, 2011
67
3
34
Kraljevo
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.

Great job man
 

shadowofdarkness

Senior Member
Jun 11, 2010
554
139
Thanks I just added "persist.sys.usb.config=mass_storage,adb" to the end of my build.prop and rebooted then it worked great. Mass storage and adb at the same time is great.

You have no idea how annoyed I would get that without it everytime I started mass storage it would turn off adb, then I would have to remember to turn it on again.
 

diehard2222

Senior Member
Aug 9, 2010
459
50
Adelaide
Thanks I just added "persist.sys.usb.config=mass_storage,adb" to the end of my build.prop and rebooted then it worked great. Mass storage and adb at the same time is great.

You have no idea how annoyed I would get that without it everytime I started mass storage it would turn off adb, then I would have to remember to turn it on again.

Hey man what did you enter under key?

Sent from my GT-I9100 using Tapatalk
 

diehard2222

Senior Member
Aug 9, 2010
459
50
Adelaide
What do you mean under key?

I just appended persist.sys.usb.config=mass_storage,adb to the end of /system/build.prop and rebooted. Nothing else.

I am running Turkbeyrom v3 with Siyah 3.0b7

I ask cause im using build.prop editor from the play store and under property name it also has property key. Isnt this the app you used?


Sent from my iPad 2 using Tapatalk
 

shadowofdarkness

Senior Member
Jun 11, 2010
554
139
How would I go about reverting this change. I do like mass storage better but I just updated to the Ubuntu 12.04 beta and would like for curiosity sake to know if MTP has started "just working" without the screwed up names.

I tried changing it prop to persist.sys.usb.config=mtp,adb as that is mentioned as the old value but on reboot it still comes up with the mass storage connection in the notifications area. "getprop | grep usb" lists everything as changed to mtp,adb which confuses me as to why I still get mass storage.

Edit: I finally figured it out, the only way to revert is to set it to "mtp,ptp"
 
Last edited:
  • Like
Reactions: behemot24

evo17paul

New member
Feb 29, 2012
2
0
Hey all,

Now running Siyah 3.0.1 and CM9 which is great and the USB storage is working great apart from in my car. On GB I used to run Multi-Mount SDCard to just mount my 32gb SDCard and could happily play my music on the stereo, has anyone sussed how we can just not mount the internal storage in certain situations?
 

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 ?