Usb storage mass and ICS

Search This thread

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
Unfortunately my build.prop won't help you because I'm applying these settings with a /system/bin/customboot.sh script which is read by CF-Root kernel. Perhaps the stock kernel ignores this value in build.prop.

Could you try unplugging the USB cable, running
Code:
persist.sys.usb.config mass_storage,adb
in Terminal as root and then rebooting ? the setting should be kept across reboots.
 
  • Like
Reactions: Phil3759

xinfinityoO

Senior Member
May 14, 2011
2,209
574
Wellington
Unfortunately my build.prop won't help you because I'm applying these settings with a /system/bin/customboot.sh script which is read by CF-Root kernel. Perhaps the stock kernel ignores this value in build.prop.

Could you try unplugging the USB cable, running
Code:
persist.sys.usb.config mass_storage,adb
in Terminal as root and then rebooting ? the setting should be kept across reboots.

I am using Omega 5.1 rom which uses xxlpq rom with cf lpq kernel. i also tried that command on terminal.. after reboot it reverts back..and even before rebooting ..doesnt work.. sorry to be a pain.. but maybe its the rom or the rom version which is causing the problem..anymore ideas :)

thanks

i think it should be setprop persist.sys.usb.config mass_storage,adb

but doesnt work
 
Last edited:

Mr.Greg

Senior Member
Sep 19, 2010
6,566
5,062
I am using Omega 5.1 rom which uses xxlpq rom with cf lpq kernel. i also tried that command on terminal.. after reboot it reverts back..and even before rebooting ..doesnt work.. sorry to be a pain.. but maybe its the rom or the rom version which is causing the problem..anymore ideas :)

thanks
Same here, I`m using Omega BB 5.1 still not working
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
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 ?
 

xinfinityoO

Senior Member
May 14, 2011
2,209
574
Wellington
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 ?

build.prop doesnt work.

last time i tried the command with su privilage i wasnt able to restore it back to mtp..

how are u making it work.. are u able to share your build.prop plus the sh file u call.

sorry to be a noob but where is the file /init.smdk4210.usb.rc located
thanks
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
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.
 

Fed03

Member
Mar 19, 2012
41
0
i've managed to change the parameters but when i connect it, the pc recognise 2 romovable discs that cannot be accessed...wind asks to insert a disc....
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
Either you don't have the two storages formatted as FAT32 (mounted as vfat inside the phone), either you have a problem with your computer. You could try letting it "automatically search" for drivers and it should mount the two storages.
 

Fed03

Member
Mar 19, 2012
41
0
Either you don't have the two storages formatted as FAT32 (mounted as vfat inside the phone), either you have a problem with your computer. You could try letting it "automatically search" for drivers and it should mount the two storages.

mhhh so i've to format the internal sd card in fat32? it's very strange...
 

VAXXi

Senior Member
Mar 19, 2012
139
177
Bucharest
vaxxi.net
You shouldn't do anything. The internal storage is already formatted from the factory, the SD card is formatted to FAT32 by the phone when you insert it the first time (if it's not already formatted). Just let Windows search for the drivers, it will probably find something like "Generic storage" and work after that.
 

infamous6622

Senior Member
Jul 12, 2008
58
4
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.

is there a way to create a shortcut for quicker access to 'set usb cable connection mode'? would be great if there was a widget or app icon on homescreen to get to that straight away with one click. i've tried 'bar shortcut' and 'QuickShortcutMaker', but that was no good, using that i only manage to get as far as 'wireless and network'. i have that on my homescreen now and requires 3 clicks before i'm asked to plug in usb cable, not bad but could be better.
 
Last edited:

Fed03

Member
Mar 19, 2012
41
0
You shouldn't do anything. The internal storage is already formatted from the factory, the SD card is formatted to FAT32 by the phone when you insert it the first time (if it's not already formatted). Just let Windows search for the drivers, it will probably find something like "Generic storage" and work after that.

sadly not....if i connect my phone in mass storage with the norml procedure it's ok, but with the mod to the prop win instals samsung android ADB interface making impossible to open the drive
 

desean

Senior Member
Oct 29, 2008
364
214
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.
 

Attachments

  • ics-usb-mass-storage.zip
    143.4 KB · Views: 5,279
Last edited:

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 ?