yashsingh1/xdaforums huggingface dataset:
[Nexus One Themes and Apps] InitiatePenguin:
MTP Sticks

Hey, I just wanted to say thanks for this awesome app that I'm sure is going to help a lot of people transfer to ICS until a proper Kernel gets released but I'm having a problem with my phone.

I know it isn't on your approved list of devices, but maybe one of those phones react the same way. I have a Rooted Nexus S runnning ICS 4.0.1 Brainmaster ROM v6. When pluggin in via USB I can either check MTP or PTP. And one must be checked at all times.

You app turns on UMS but the MTP check seems to still overide it. Does anyone here know how to disable the MTP/PTP services?
[Nexus One Themes and Apps] Bexton:
@InitiatePenguin: i'll have a look at it. but to make this easier you could do me favour and send me a copy of your boot image (either from nandroid backup or romdump directly (just the boot.img)). then i can extract the ramdisk and take a look at the setup in init scripts (what could be the reason). You can send me the boot.img via mail to eyecatchup@gmail.com and i'll let you know about any progresses on that asap.
[Nexus One Themes and Apps] Bierfreund:
i became aware of the app / this thread from that link... :)

Yes i tried it and it does not work.

When i try the echo command from the first post i get the following error:

/system/bin/sh: cannot create /sys/devices/platform/usb_mass_storage/lun0/file: No such file or directory

I checked and i have no usb_mass_storage directory in /sys/devices/platform

(at the moment i use AOSP build from here)
[Nexus One Themes and Apps] tytung:
Something you can try.

Loot at what you have first .

getprop | grep usb

The delete mtp and/or ptp.

For example, if you have persist.sys.usb.config=mtp,adb, then do the following.

setprop persist.sys.usb.config adb

Edit /default.prop or add a script to init.d folder to have permanent change on each boot.
[Nexus One Themes and Apps] Bexton:
Thanks for the source link. A quick lookup in the github repo unvealed the problem. Thing is that the device map for on your linux box points to a different location. sdcard refers to /dev/block/sda1

I will work something out for it and will merge it in the next build. I had to fix a sync problem when using a2sd (what seems to be fixed now) anyway. Tomorrow i'm doing some code clean up and add some settings (like a selection for the partition to be mounted) and then the next build should be ready before the weekend.

Would be great if you will test it, as i don't have a GN to do it (not yet, hopefully at saturday :D).

Cheers
[Nexus One Themes and Apps] InitiatePenguin:
Thanks!

While it did feed me back that I was connecting via MTP when I typed in the second code as a root user my computer made the 'new device plugged in' sound but then tried to find drivers for a USB MTP Device which then failed.

Still unable to use UMS.

Can you explain in more detail how to use a script that initiates on boot?
[Nexus One Themes and Apps] Bierfreund:
No problem, looking forward to test it :)
[Nexus One Themes and Apps] Bexton:
Hey Bierfreund (or sombody else who has a Galaxy Nexus), could you plase send me a copy of ls -la /dev/block ? Thanks
[Nexus One Themes and Apps] InitiatePenguin:
Boot.img link

Sorry for the delay, here is a link to download only the boot.img of the ROM I'm using, thanks! http://ge.tt/8VAoEZB?c
[Nexus One Themes and Apps] Bierfreund:
root@android:/ # ls -la /dev/block
ls -la /dev/block
brw------- root root 7, 0 2011-12-22 09:56 loop0
brw------- root root 7, 1 2011-12-22 09:56 loop1
brw------- root root 7, 2 2011-12-22 09:56 loop2
brw------- root root 7, 3 2011-12-22 09:56 loop3
brw------- root root 7, 4 2011-12-22 09:56 loop4
brw------- root root 7, 5 2011-12-22 09:56 loop5
brw------- root root 7, 6 2011-12-22 09:56 loop6
brw------- root root 7, 7 2011-12-22 09:56 loop7
brw------- root root 179, 0 2011-12-22 09:56 mmcblk0
brw------- root root 179, 8 2011-12-22 09:56 mmcblk0boot0
brw------- root root 179, 16 2011-12-22 09:56 mmcblk0boot1
brw------- root root 179, 1 2011-12-22 09:56 mmcblk0p1
brw------- root root 259, 2 2011-12-22 09:56 mmcblk0p10
brw------- root root 259, 3 2011-12-22 09:56 mmcblk0p11
brw------- root root 259, 4 2011-12-22 09:56 mmcblk0p12
brw------- root root 259, 5 2011-12-22 09:56 mmcblk0p13
brw------- root root 179, 2 2011-12-22 09:56 mmcblk0p2
brw------- root root 179, 3 2011-12-22 09:56 mmcblk0p3
brw-rw---- radio radio 179, 4 2011-12-22 09:56 mmcblk0p4
brw------- root root 179, 5 2011-12-22 09:56 mmcblk0p5
brw------- root root 179, 6 2011-12-22 09:56 mmcblk0p6
brw------- root root 179, 7 2011-12-22 09:56 mmcblk0p7
brw------- root root 259, 0 2011-12-22 09:56 mmcblk0p8
brw-rw---- radio radio 259, 1 2011-12-22 09:56 mmcblk0p9
brw------- root root 31, 0 2011-12-22 09:56 mtdblock0
drwxr-xr-x root root 2011-12-22 09:56 platform
brw------- root root 1, 0 2011-12-22 09:56 ram0
brw------- root root 1, 1 2011-12-22 09:56 ram1
brw------- root root 1, 10 2011-12-22 09:56 ram10
brw------- root root 1, 11 2011-12-22 09:56 ram11
brw------- root root 1, 12 2011-12-22 09:56 ram12
brw------- root root 1, 13 2011-12-22 09:56 ram13
brw------- root root 1, 14 2011-12-22 09:56 ram14
brw------- root root 1, 15 2011-12-22 09:56 ram15
brw------- root root 1, 2 2011-12-22 09:56 ram2
brw------- root root 1, 3 2011-12-22 09:56 ram3
brw------- root root 1, 4 2011-12-22 09:56 ram4
brw------- root root 1, 5 2011-12-22 09:56 ram5
brw------- root root 1, 6 2011-12-22 09:56 ram6
brw------- root root 1, 7 2011-12-22 09:56 ram7
brw------- root root 1, 8 2011-12-22 09:56 ram8
brw------- root root 1, 9 2011-12-22 09:56 ram9
drwxr-xr-x root root 2011-12-22 09:56 vold

As i said before, i'm using an AOSP ROM atm, i hope it doesn't matter.
[Nexus One Themes and Apps] rickslick:
@Bexton

is there a service in your app because I dont see it in the source code. I was wondering if the app is exited ..the app wont detect presence of usb connected.

I tried (from git) and found out that if the app is exited by pressing the back button next time I connect to a pc it wont detect
[Nexus One Themes and Apps] Bexton:
Recognized the same just today. But this did worked. So i think i just messed a bit to much with the code. I had to fix a few things anyway and now i am about to clean up everything. I will have an extra look at this.

---

Previews of the upcoming version (coming after xmas):
[Nexus One Themes and Apps] Bierfreund:
Did the directory listing of /dev/block of the GN help? Any chance of support für the GN in the upcoming version?
[Nexus One Themes and Apps] Bexton:
It should be working with the Galaxy Nexus as well. But as said i will need you to test it (unless my GF will come up with the right present *keeping finger crossed* ;)). Anyway there're still a few things to do. So i will not be able to release the next version before, probably, tuesday. If i will need you for testing, i will send you a pm.

Frohe Weihnachten! :)
[Nexus One Themes and Apps] rickslick:
Ok thanks i ported your app to galaxy 3 gt5801 (had to change the path) and its working for ICS port and cm7 . I also added a service which starts when booted up. Its improved but as you know a service gets removed after a while..any solution?
[Nexus One Themes and Apps] Bexton:
What path do you have to use? Do you have the source online (eg github) so i can have a look at it?
[Nexus One Themes and Apps] mori90:
It's reboot my phone when I install it everytime :confused:What should I do now ?
[Nexus One Themes and Apps] rickslick:
I just changed the path to /sys/devices/platform/s3c-usbgadget/gadget/lun0/file for galaxy 3

I dont have any source online
[Nexus One Themes and Apps] kubatbg:
I have a problem with my HD2 on NexusHD2-IceCreamSandwich Beta7 ROM (http://xdaforums.com/showthread.php?t=1354267). Windows see the device and allows me to transfer files but none of transfered files are being recognized by HD2.

Is it a problem with a program or with a ROM? Tried reinstalling the ROM but no effect. Also when I download something using HD2, it appears on the SD and the device and works.
[Nexus One Themes and Apps] inblues4u:
Thanks for the post bro
[Nexus One Themes and Apps] Bexton:
This is a sync error that occurs when having multiple partitions. The fix for this is included in the upcoming version.
[Nexus One Themes and Apps] Bexton:
Could someone with a Galaxy Nexus please gimme the console output for

find /sys/devices/platform `pwd` -name "file" | grep "usb" | grep "lun0" | sed -n '1,0p'

Thanks..
[Nexus One Themes and Apps] Bierfreund:
root@android:/ # find /sys/devices/platform `pwd` -name "file" | grep "usb" | grep "lun0" | sed -n '1,0p'
` -name "file" | grep "usb" | grep "lun0" | sed -n '1,0p' <
/sys/devices/platform/omap/musb-omap2430/musb-hdrc/gadget/lun0/file
[Nexus One Themes and Apps] Bexton:
Hey Bierfreund,

thanks for your help. I have reorganzied all the code and the app now detects the existing fat and ext mount points, as well as the path of the lunfile. Also it can surpress the usage of mtp protocol. So bascically the app now can be used for much more devices.

But as MTP protocol can read from ext partitions, one (actualy obvious) thing that came to my mind is, that the GN probably doesn't have a fat partition at all. Can you verify this? (You can use cat /proc/mounts | grep vfat | grep sdcard | awk '{print $1}' | sed -n '1,0p' and see if it returns anything).
[Nexus One Themes and Apps] Bierfreund:
omg, haven't thought about this, yet. I think you are right...

root@android:/ # cat /proc/mounts | grep vfat | grep sdcard | awk '{print $1}' | sed -n '1,0p'
grep sdcard | awk '{print $1}' | sed -n '1,0p' <
root@android:/ #

hm. sdcard seems to be fuse, never heard about that, but i'm no linux guy :) :

127|root@android:/ # cat /proc/mounts
cat /proc/mounts
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro,relatime,barrier=1,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro,relatime,barrier=1,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
[Nexus One Themes and Apps] Bexton:
kay, damn. that is exactly what i thought. userdata is ext4. so the most simple solution will probably be to mount the ext4 partition containing the userdata and use an extra software that is able to read ext partition on windows computers.

Could you maybe try if you can access your userdata partition by

1.) Install any Windows Ext Explorer, such as:

http://www.diskinternals.com/linux-reader/

http://sourceforge.net/projects/ext2fsd/files/Ext2fsd/0.51/

(Note: The linked Progs give you read-only access to the ext partitions. But there is a lot of similar Freeware around the web that gives read-write access for full control. More info (for example) can be found here: http://www.howtoforge.com/access-linux-partitions-from-windows)

2.) Then use a terminal to your GN and issue:

cat /proc/mounts | grep ext | grep data | awk '{print $1}' | sed -n '1,0p'

3.) Replace returnFromCommandAbove in the following command with the returned value from above and issue:

echo "/dev/block/[B][I]returnFromCommandAbove[/I][/B]" > /sys/devices/platform/omap/musb-omap2430/musb-hdrc/gadget/lun0/file

It should prompt a Window in Windows that says you must repartition the device to use it. Ignore that and cancel. (If that shouldn't work, try #3 again, but using mmcblk0p{1-8} rather than what you got from #2).

Now you should be able to access the ext partition from the EXT Explorer Software:

Does that work for you? And if it worked, what mount point did worked?
[Nexus One Themes and Apps] Bexton:
Oups. I just recognized the fuse file system on /mnt/sdcard . Could somebody please shad some light on it. What is the partition in question that needs to be mounted on the GN? The ext or the fuse? Or, what data is stored on each of those?
[Nexus One Themes and Apps] Bierfreund:
I installed the ext-Filesystem Tools für Windows and tried your instructions

root@android:/ # cat /proc/mounts | grep ext | grep data | awk '{print $1}' | sed -n '1,0p'
rep data | awk '{print $1}' | sed -n '1,0p' <
/dev/block/platform/omap/omap_hsmmc.0/by-name/system
root@android:/ #

Neither

echo "/dev/block/platform/omap/omap_hsmmc.0/by-name/system" > /sys/devices/platform/omap/musb-omap2430/musb-hdrc/gadget/lun0/file

Nor

echo "/dev/block/mmcblk0p1" > /sys/devices/platform/omap/musb-omap2430/musb-hdrc/gadget/lun0/file

...

echo "/dev/block/mmcblk0p13" > /sys/devices/platform/omap/musb-omap2430/musb-hdrc/gadget/lun0/file

worked. No Popup for a Mass Storage Device in Windows. MTP Device was always accessible.

I tried the steps without your App installed and with in installed and running.
[Nexus One Themes and Apps] Bexton:
Thanks again! Regarding MTP: Probably you would have to use

setprop persist.sys.usb.config adb

to disable MTP (Well, at least this solved issues on other devices using mtp).

Anyway i assume the actual data you want to get your hands on will be stored in the fuse filesystem at /mnt/sdcard.

So i will release the updated version without GN support for the moment and will try to work out a solution. But that will be much more tricky than i thought.

If you have some time (no stress on that) maybe you could do me one last favour for the moment? To get a deeper insight in what's happening on a booted system, it would be really helpful to have a look at a full system backup. When i have that, i can work on a UMS workaround for the GN much easier. You can do this by:

tar cvf /mnt/sdcard/fullbackup-gn.tar --exclude=/mnt/sdcard /

This will create an archive of all your system as it is after boot, including dynamic created symlinks etc.. (If your tar binary has the -p flag, you can add that to the command above). As the filesize of that tar will be a bit to big for sending it via email, you can send me a pm so i will give access to my ftp server to upload it to there.

Many thanks again. Greetings from Köln!

Stephan
[Nexus One Themes and Apps] dk_zero-cool:
Must say that I did not have much plans about any new phones at the moment, but the structure of the GN interests me enough to buy one, just for the fun of it.
[Nexus One Themes and Apps] Bierfreund:
I had to remove the leading "/" in the exclude operator ("mnt/sdcard" instead of "/mnt/sdcard") otherwise sdcard content was also backuped.

tar always aborts with error "tar: short read":

root@android:/mnt/sdcard # tar cvf /mnt/sdcard/fullbackup-gn.tar --exclude=mnt/sdcard /
...
sys/fs/ext4/features/lazy_itable_init
tar: short read
1|root@android:/mnt/sdcard #
[Nexus One Themes and Apps] dpendolino:
UMS for Droid 3 running ICS

This works wonderfully on my Droid 3 running hashcodes ICS alpha, thank you so much.

The only thing is that your app only mounts the external sdcard, but the droid 3 has and internal fat partition. I am able to mount both simultaneously using the following:

echo ”/dev/block/vold/179:1” > /sys/devices/platform/usb_mass_ storage/lun0/file
echo ”/dev/block/vold/179:57” > /sys/devices/platform/usb_mass_storage/lun1/file

Is there any chance of including a feature to enable mounting any internal memory if available?

Also, I had a quick question. I noticed that when you mount the sdcard via UMS it is still accessible to the phone. The phone seems to notice changes made via pc but not vice versa, is there any workaround for this?

Thanks again!
[Nexus One Themes and Apps] partsguy1:
Thank you very much. This works with no problem on my Evo with ics-deck-alpha1. Great work.
[Nexus One Themes and Apps] Schrotty35:
Not working with CM9 and Galaxy S2.
[Nexus One Themes and Apps] gausie:
Confirmed.

The issue is

because contents of the usb_mass_storage folder are

.

How do we create the lun file?
[Nexus One Themes and Apps] DarkZu:
sorry im quite a newbie at this, everything going over my head.

i would like to know how to install this file.

the extention is a .apk and im not familiar with this type of file:confused:. is there a certian place to install the file or just put it anywhere when you download it?

im running ICS beta 9 btw

__________________

Edit: ahahha nvm i got it working, just got to fine where i downloaded it and installed it. (didn't know how to delete this post)
[Nexus One Themes and Apps] InitiatePenguin:
an .apk is an Android Application Package or App. Put it anywhere on your SD card and navigate to it using a file explorer app. When clicking the file from your phone it is recognized as an application and asks you whether you want to install it or not.

You must also have the "Allow installs form third party" or "Unknown Sources" if on ICS option enabled in settings > security.
[Nexus One Themes and Apps] itsy:
Can you change the notification to an ongoing notification (means that you cannot clean it)?

Described here

Thanks ;)
[Nexus One Themes and Apps] cowsquad:
Awesome app., its working on ICS DROID original droid
[Nexus One Themes and Apps] scottspa74:
@bexton

Just wanted to pop in to say thanks sooo much for this.

Evo 4g

Thanks. ;)
[Nexus One Themes and Apps] chizzy58:
Verizon Galaxy Nexus owner

If you should need any assistance with getting the Galaxy Nexus to work with your app I am available!

my phone is 95% because of this issue!:mad:
[Nexus One Themes and Apps] ratchetandclankf:
May we add the Kindle Fire to the list? Works perfectly when running any ICS ROM.
[Nexus One Themes and Apps] Bexton:
Thanks. Added to the list.
[Nexus One Themes and Apps] asisc:
Just a report:

Tried version 1.1.4 on Huawei Ideos U8150-D running Ice Cream Sandwich[Beta 3] by Zackconsole.

App installs, runs, obatins root privileges, but doesn't syncronize phone's SD-CARD on the PC (tried both with Win and Linux and enabling/disabling "debug USB" and never "never stand-by" on the phone) when I press the big android icon and it becomes green/yellow (don't know eactly which color..).

Just a report....

I'm following the matter on Zackconsole beta3 pages..

Cheers.
[Nexus One Themes and Apps] :
Thanx!

This works also on the Xperia X10i running on CM9.0 - FXP103 FreeXperia Project!
[Nexus One Themes and Apps] droidfta:
Does someone want to remove the kindle fire from the list. I don't know why the previous guy said as such, I'm using jackpot clavins latest build. Now lets set this up when using the older builds in this app say 1.10 it will mount an sd card but windows says it has to format it which of course im not going to do. The next thing when you use the latest build it when trying to mount it says Failure! You cannot enable UMS without a usb connection. Now maybe like two times out 200 i have gotten this to mount with current version but it also mounts a "raw sd card" in which it wants you to format. Maybe it has to do with the kindle fire having a partitioned 8gb memory card.
[Nexus One Themes and Apps] sondeu:
Same for me with HP Touchpad CM9. Anything I can do? MTP is not running or buggy on my Ubuntu 10.04. ...
[Nexus One Themes and Apps] xda-developer001:
Thanks alot...It works on Lg Optimus One P500

Brilliant. It works on lg p500 w/o a2sd.

I am using lupohirp 's Cm9 port alpha3.

You can add P500 to your list.;)
[Nexus One Themes and Apps] dame71:
Thanks, that really helped.
[Nexus One Themes and Apps] js931:
+1, not working with CM9 and Galaxy S2.

Any solutions?
[Nexus One Themes and Apps] mrahmanda:
thanks dude for your information :D
[Nexus One Themes and Apps] :
hi, on galaxy s scl there is the sinc problem,and the program read the internal memory,not the external sd :/ solutions?however great job!!o yes,i'm with cm9 rom ;)
[Nexus One Themes and Apps] Bexton:
Yes, there's a solution and actualy a version 1.2 is almost ready since a few weeks. but last weeks has been that busy that i didn't managed to finalize it. that version fixes all sync issues and can handle multiple partitions properly.

Since many asked now, i promise i will post the updated version within the next 3 days. :)
[Nexus One Themes and Apps] Bexton:
Pre-Release of version 1.2.0

Okay, a small update: I created a new "dev" branch in my GitHub repo, which includes the latest progresses (such as the sync fix). https://github.com/eyecatchup/net.bexton.android.UsbMassStorageToggle/tree/dev

Also i'll attach a pre-release of version 1.2.0 to this post. For a preview, check this post: http://xdaforums.com/showpost.php?p=20654180&postcount=45.

However, note that the version attached is not finished yet. It fixes the sync issue, but doesn't let you do all the things that you'll find in the settings menu (since the functions are just not there yet). So please don't report any bugs for this version.
[Nexus One Themes and Apps] spunker88:
Does this only work for physical SD cards or will it do virtual SD Cards (a partition mounted) like in the HP Touchpad. I have CM9 and connected via MTP and it still wouldn't let me switch to mass storage, it said USB was not connected when it was.

I know the Touchpad isn't supported but figured it was worth a try.
[Nexus One Themes and Apps] Bexton:
In general it will work with virtuals as well. that issue occurs most probably due to the persist.sys.usb.config property. Have you checked if this works with the new version http://xdaforums.com/showpost.php?p=20542980&postcount=36 ?
[Nexus One Themes and Apps] spunker88:
In default.prop I already have "persist.sys.usb.config=adb". I have MTP turned on under Storage Settings as this is the only way I can access files at the moment, but toggling that setting does nothing to help the mass storage program work.
[Nexus One Themes and Apps] letsgoflyers81:
This isn't working on my Galaxy Nexus running a rooted, deodexed, but otherwise mostly stock 4.0.2. It installs, asks for root, and says it enables UMS, but my PC continues to show the phone as a media device instead of storage device. :(
[Nexus One Themes and Apps] chizzy58:
Same here. Stock, rooted and unlocked...I miss it. Need it on my galaxy nexus!! :(
[Nexus One Themes and Apps] ken_nexus:
Car hifi and nexus

Hi guys,

I have a total lack with my Samsung Galaxy Nexus ICS. I can't control the file system with my car radio Kenwood KDC-BT60U any more.

If I can help somehow I will do. I rooted already and I got your mass storage app.
[Nexus One Themes and Apps] miland:
You cannot enable UMS without a usb connection.

on my Kindle Fire with latest Kindle Fire Zone ROM. :-(

tried both version from the 1st page.
[Nexus One Themes and Apps] z1022:
I cannot install "USB Mass Storage for ICS 1.20 pre" on P500 Beta 2. Anyon can help.

error message "An existing package by the same name with a conficting signature is already installed"
[Nexus One Themes and Apps] fiddlefaddle:
I am currently running Cyanogenmod 7 and I am a TOTAL noob so please be patient with me. :D

when I downloaded the USB apk I try to open it it says 'there is a problem parsing package' is it supposed to do that? I am using opera mobile..... thanks in advance...
[Nexus One Themes and Apps] gryffindor:
Great! Hope for a better ICS on Nexus One.
[Nexus One Themes and Apps] dezz:
same here +1 :(
[Nexus One Themes and Apps] darkpalosx:
does this work on Galaxy s2? how to i install this? i cant see an apk, only zip file.
[Nexus One Themes and Apps] hm_dreamware:
good work it's helped :D
[Nexus One Themes and Apps] geomerlin:
I have installed MIUI.us on Kindle fire but I have a problem with UMS: "Failure you cannot enable UMS without a USB connection"

how can i solve it?thank you!