[Q] Redirect mount point of External SD.. - Acer Iconia A500

Can I change the mount point of the External SD card (microsd) from
/mnt/external_sd
to
/mnt/sdcard/MicroSD
I tried changing the entry in vold.fstab to no help. it wasn't mounted to /mnt/external_sd but it also wasn't mounted to the MicroSD folder i made on /mnt/sdcard
This would let any program that doesn't have the ability to handle the external SD card to be able to access it as it wouldn't know where it was. I could then do this to USB drives plugged in as well.

Nova5 said:
Can I change the mount point of the External SD card (microsd) from
/mnt/external_sd
to
/mnt/sdcard/MicroSD
I tried changing the entry in vold.fstab to no help. it wasn't mounted to /mnt/external_sd but it also wasn't mounted to the MicroSD folder i made on /mnt/sdcard
This would let any program that doesn't have the ability to handle the external SD card to be able to access it as it wouldn't know where it was. I could then do this to USB drives plugged in as well.
Click to expand...
Click to collapse
This might not exactly be the route you wanna take, but have you tried adding a symlink? Might do the trick, then again, I'm having a little issue with the same thing right now. Looks like this has been a popular subject lately

symlinks seem to be inoperable in HC.
Found this on another forum
Have you tried "bind" mounting?
Doesn't wok for me as I have a stock (unrooted) transformer...
cd /mnt/sdcard
mkdir MicroSD
mount -o bind /mnt/external_sd /mnt/sdcard/MicroSD
Click to expand...
Click to collapse
Works fairly well. Doesn't effect the storage count for the internal memory however. if we could actually mount it to a folder inside the scdard mount then it may show up as extra space, but i kinda doubt that bit.

Those system files are overwritten on each reboot so you have to "mount -o bind" on every reboot.
If you find a way to make this mount point permanent let me know, I am looking for a way as well.

If you're rooted, I think USB Mount All did this.

powercat_ said:
Those system files are overwritten on each reboot so you have to "mount -o bind" on every reboot.
If you find a way to make this mount point permanent let me know, I am looking for a way as well.
Click to expand...
Click to collapse
What system files? Its simply a mount point created and handled in memory. its never added to a file. I forget what the start up command file is in linux that is the sister of DOSs Autoexec.bat. It would need to be added to that as the last command. Now i have read this is a risky command to run as it can create a endless loop if something attempts to scan the directories it can run into a recursive loop. Now I believe this is because most instances of this command tend to be used to bring a directory onto the desktop thats a few steps above it. Considering that the way I am using it is to link a directory that is outside the scope of another, it shouldn't ever cause this and be a pretty safe way to do it. The BIND command creates a hard link between the two locations. the /mnt/sdcard/MicroSD is a directory I created. when I bind it to the /mnt/external_sd directory the files appear in both places at the same time as MicroSD is simply a... tunnel as it were into External SD. But the programs are convinced its MicroSD. So those that can't use the external sd slot now can through this "tunnel". The same trick can also be applied to the directory for the USB thumb/flash drives.
Just create a directory for it on /mnt/sdcard

fermunky said:
If you're rooted, I think USB Mount All did this.
Click to expand...
Click to collapse
why pay when you can enter a command and its done?

Yes, mount -o bind works, but if you reboot, the mount point is no longer there.
Sure, we can add an entry to fstab, but the file is overwritten by a reboot
the autostart file is init.rc, which is overwritten by a reboot as well, so that rules out using it to auto mount this bind.
let me know if you find other information as I would very much like this to work.
FYI I started a thread about this command a few days back but never got any pertinent information:
http://forum.xda-developers.com/showthread.php?t=1287522
(this was before 3.2 when you couldn't access the SD card from usb)

Nova5 said:
why pay when you can enter a command and its done?
Click to expand...
Click to collapse
Because it is only a few bucks, and it will do it for you without having to manually do it. I know it's quite a simple task, but I say best out of sight/out of mind.

its overwrites those huh? that bites..

fermunky said:
Because it is only a few bucks, and it will do it for you without having to manually do it. I know it's quite a simple task, but I say best out of sight/out of mind.
Click to expand...
Click to collapse
Just takes a bit to track where we can stick the commands to get an auto start. I may make a simple script file to leave on the home screens. tap and done.

Okay it seems the location where the init.rc is stored is volatile. I created a test file in there and rebooted the tablet, file is gone. So its less overwriting and simply copying out of its hidden location to a usable one. sdcard in there is just a mount point for the actual hardware address location of the sdcard. So if we want to get the autostart we would have to discover where HC pulls that data from on boot.

Bind will fail if the location that actually holds the data is not present/ready. usb_storage is more affected by this as a user doesn't normally leave a flash drive in the port. Script manager can auto-execute a script on boot. Works well enough.
hmm...
It appears if you remove the usb drive after making the bind, the bind is broken. So while its workable, its not perfect. Of course since the microsd card is rarley removed, this isn't much of an issue. If we could get the script to also run on insertion of the USB drive that would then make it work better.
SCript Manager allows one to create a direct shortcut to execute a specific script. So you can swap USB drives, tap the script icon and then access the script through the bound directory.

I use the following program created by RubberBigPepper from an alternative russian site about android apps and devices.

Any interesting effect I've noticed, any time the script runs it creates a new mount entry for the bind command, even if that bind already exists. OfficePro5 shows this by listing MicroSD for each bind entry. So I had 13 entries of MicroSD as it ran that many times, due to a setting I shouldn't have checked... Run on Net Change. But it pointed out this interesting effect.

I now see the need for this as one of my apps does not natively see the ext sd card.
OK I tried the apk above and it does not seem to work. I get a folder called ex_sdcard but it is empty and does not reflect the sd card contents.
Nova, you found another way yet you could share, or do I just need to manually create symlinks after every boot?

mountmicrosd.sh
Code:
# Note : Super user required. Your Tablet MUST be rooted!
# Removing the card will disrupt the bind. And Require running script again when plugged back in.
echo Breaks any existing Bind mount to avoid creating duplicate Bind entries. a "failed" response is acceptable as is no response.
umount /mnt/sdcard/MicroSD
echo execute Micro SD mount - card must be plugged in or Invalid Argument error will occur.
mount -o bind /mnt/external_sd /mnt/sdcard/MicroSD
Place the above in a text file with the extension .sh Download from the Market a program called Script Manager. Place the sh file in your SD card root. Run script manager, select that file and check two boxes. Run on Boot, Run as Root. Also create the directory of "MicroSD" Just as its typed. Linux is very caps sensitive. now every time you boot it will automatically run the script and bind the ExSD to the MicroSD directory.
This one will do the USB drive.
mountusb.sh
Code:
# Note : Super user required. Your Tablet MUST be rooted!
# Removing the drive will disrupt the bind. And Require running script again when plugged back in.
echo Breaks any existing Bind mount to avoid creating duplicate Bind entries. a "failed" response is acceptable as is no response.
umount /mnt/sdcard/USBDrive
echo execute USB Drive mount - drive must be plugged in or Invalid Argument error will occur.
mount -o bind /mnt/usb_storage /mnt/sdcard/USBDrive
Create a widget with ScriptManager to have a touchable icon on your screen to run this one. Note it must have the folder "USBDrive" created on the sdcard.
It is unimportant if you use the same filename.sh i did. That is just so I knew at a glance what it does. # is a comment and Echo prints the text following it to the screen. I found a way around the mutiple bind entries by simply unmounting it before making the mount bind. You might see a Failed error, this is just fine. it just means there was no mount for it to undo on its first run. this will be more helpful on the USB drive script than the MicroSD card one.

Very cool, Nova5!
Thanks for taking the time to research it further.
I tested your solution and it works fine!

I updated it with a fix to prevent the multiple entries. You'll need to update your files to reflect the changes I made. a reboot will be the simplest way to ensure it starts with a clean slate. Notice I removed the comment about Running it once only, due to the umount command preceeding the mount command. This removes the bind from memory and then when its created again you don't have the problem of 13 entries of MicroSD in OfficePro like I ran into.
Alright, I think its as good it is going to get. You could put them in the same files but for simplicity and being able to swap USB drives without affecting the ExSD card two files is best.
Wait... debug time. I goofed something.
Okay fixed up and working right. Remember what I mentioned about linux and capitals? oops. Echo is not echo.

Shucks, im not rooted.

Related

Partitioning microSD card

After setting up my wife's A7 and using it for three weeks, I have decided to open mine up. I waited because I wanted to see if CES had anything I wanted more. I decided they didn't.
So, I am starting from scratch again.
The main issue I've had with my wife's A7 has been the lack of storage space for apps, especially the big games.
Bazbob seems to have a solution by partioning the microSD card and using Apps2sd.
I took a new Class 10 16GB microSD card.
I downloaded and burned Ubuntu onto a CD from here: http://www.ubuntu.com/desktop/get-ubuntu/download
Put the card in my laptop, restarted it into Ubuntu.
Ran gparted.
Shrunk the Fat32 partition to just under 8GB and added another partion as ext2 primary.
When I restarted my laptop, my sd reader in the laptop doesn't work.
When I put it into the A7, it says the SD card has Total Space of 7.73GB.
At this point, I'm not sure what to do next.
Help is appreciated!
jazzbone said:
After setting up my wife's A7 and using it for three weeks, I have decided to open mine up. I waited because I wanted to see if CES had anything I wanted more. I decided they didn't.
So, I am starting from scratch again.
The main issue I've had with my wife's A7 has been the lack of storage space for apps, especially the big games.
Bazbob seems to have a solution by partioning the microSD card and using Apps2sd.
I took a new Class 10 16GB microSD card.
I downloaded and burned Ubuntu onto a CD from here: http://www.ubuntu.com/desktop/get-ubuntu/download
Put the card in my laptop, restarted it into Ubuntu.
Ran gparted.
Shrunk the Fat32 partition to just under 8GB and added another partion as ext2 primary.
When I restarted my laptop, my sd reader in the laptop doesn't work.
When I put it into the A7, it says the SD card has Total Space of 7.73GB.
At this point, I'm not sure what to do next.
Help is appreciated!
Click to expand...
Click to collapse
You needed to make a second partition EXT2 and format it. You then need to mount the partition. I did this by using the install-recovery.sh that it located in /system/etc. I used the following tutorial and it worked. I got over 12gb of space to install apps.
http://forum.xda-developers.com/showthread.php?t=832799
I did try to mount the new partition to /storage which is also /sdcard and i was still not able to use titanium backup to move apps. The only way i have alot of space is use this method.
I'm also mounting the fat32 partition to location /storage so that when i download apps thats where they are stored until you install them. Also Titanium backup dumps the backups here. This is done with a custom mod of Dexters 1.0c mod.
I did not use adb, i used a app called quicksshd which allows you secure ftp into the tablet and make changes. I suggest using a windows programs called winscp and putty.
Thanks for replying rfisher.
Turns out that my laptop lost the drive letter for the sd card. That's fixed now. When I insert the card into my laptop, it says that you need to format the card in the drive to use it. Any idea why?
I am confused by your instructions.
You said
You needed to make a second partition EXT2 and format it.
Click to expand...
Click to collapse
I did that. First partition is FAT 32, and second partition is EXT2, primary.
Maybe I didn't format the partition? I just created it.
I'll install busybox and see how far I can get with it.
With the other A7, I was never able to work with ADB.
This device really makes me feel like an idiot.
Still can't believe I was the first to get Google Apps working on my wife's tablet!
no adb
Well, the hours of frustration have returned...
I can't get adb running on my laptop.
I installed Android SDK.
When I type adb in the cmd window on my laptop, I get
"adb" is not recognized as an internal or external command, operable program or batch file"
I have tried moving the ADK folder to c:\
and
to:
C:\Users\Bucks HP
No luck.
I added the path c:\android-sdk-windows\platform-tools
to the environment variables in my system properties.
My head is going to explode!
Well, I got adb working, I think...
Problem was in the cmd window. I had to change the path.
Now, I can't install busybox. I followed the instructions from the wiki.
When I type "adb push busybox /data/local"
it returns: cannot stat 'busybox' : no such file or directory.
I pasted the busybox file in the
C:\android-sdk-windows\platform-tools
folder.
Was that the right place for it?
Is the busybox file just a text file?
Also, mine is named busybox-armv6l
Should it be renamed? I tried "adb push busybox-armv6l /data/local"
and got the same result...
I gave up on installing busybox via the wiki instructions.
I installed Titanium Backup and installed busybox through it.
Now, when I type: cd /system
mkdir sd
I get :
mkdir failed for sd, read-only file system
What does that mean and how do I fix it?
Thanks
The saga continues...
With the busybox from Titanium Backup installed,
I needed to type:
adb shell
su
mount -o remount,rw /dev/block/mmcblk3p1 /system
exit
exit
Then, following the tutorial, I am up to step 12:
12) Now comes the tricky part: making Android mount your new partition at boot time. All the hard work would be useless if Android discarded the mount points every time we restarted our phones. To do this we’ll need to create 2 scripts and store then into /system/etc. Obviously the scripts should be started by init.rc and need to run as root. Fortunately Android’s init.rc have a gap that makes this possible. The scripts are named install-recovery.sh and init-sd2.sh.
My question is: How do you create scripts?
You would create them with notepad++ which is a windows program. Then using adb push them to the /system/etc directory.
I used a app called quicksshd and a windows program called winscp to copy the files to the directory. If you used my method you first need to make the /system directory rw before it will let you copy the files. It worked for me, the only thing i did differently is edit init.rc to mount the first partition of the sd card to /storage, but this was creating a modded 1.0c rom. So the result is about 4gb for my sd memory and 12gb for installing apps.
jazzbone said:
The saga continues...
With the busybox from Titanium Backup installed,
I needed to type:
adb shell
su
mount -o remount,rw /dev/block/mmcblk3p1 /system
exit
exit
Then, following the tutorial, I am up to step 12:
12) Now comes the tricky part: making Android mount your new partition at boot time. All the hard work would be useless if Android discarded the mount points every time we restarted our phones. To do this we’ll need to create 2 scripts and store then into /system/etc. Obviously the scripts should be started by init.rc and need to run as root. Fortunately Android’s init.rc have a gap that makes this possible. The scripts are named install-recovery.sh and init-sd2.sh.
My question is: How do you create scripts?
Click to expand...
Click to collapse
Hi rfisher
Thanks for replying!
While waiting, I opened Notepad++, copied the text in the tutorial window into it and saved the file as Unix.
Then, I copied it to a USB drive, put it in the A7, and copied to the system/etc folder.
Is that acceptable?
Then, I followed steps 13-15.
I think I did something wrong. I am not seeing it in Root Explorer. What should I be looking for?
Was I supposed to install Apps2SD already?
I got winscp and quicksshd working. YEAH!
Used them to copy the files as you did.
Restarted A7.
Still don't see the other partition.
PS. I was just rereading your earlier post and you mentioned:
I did try to mount the new partition to /storage which is also /sdcard and i was still not able to use titanium backup to move apps. The only way i have alot of space is use this method.
I'm also mounting the fat32 partition to location /storage so that when i download apps thats where they are stored until you install them. Also Titanium backup dumps the backups here. This is done with a custom mod of Dexters 1.0c mod.
Looking on my A7, I don't see a location that is /storage
My tablet is fresh out of the box, without any firmware updates yet.

Using B&N Storage normally

One of the biggest issues I had with my nook was the 16/1GB division between content I can load and content from B&N/etc. Not being able to use that 16GB how I wanted was something I set forth to fix. Here is my solution to make this usable to non-rooted apps.
1) Root if not already rooted.
2) Make a directory inside of /data. I chose /data/usrdata.
3) remount / as RW with the command mount -o remount,rw -t rootfs rootfs / (credit to whomever wrote the nook&zergy.bat 1 click root. Sorry, it's been a long night, just let me know who and I'll edit)
4) mkdir /mnt/internal . We need somewhere to mount /data/usrdata/ and /mnt is public enough.
5) busybox mount -o bind /data/usrdata /mnt/internal. Mounts /data/usrdata to /mnt/internal.
6) For good measure, chmod 777 /mnt/internal and chmod 777 /data/usrdata.
Now, /mnt/internal should have whatever free space /data has, and should be read/write accessible from any program. A quick test with touch+terminal emulator shows new files as being created with RW permissions for all.
Alternatives: When I was initially thinking about ways to do this, my first reaction was to just open up /data to be read only to all, then have my usrdata folder be read/write all. However, I know part of android's app security model depends on some of these permissions. While I can't think of anything breaking or sensitive data being leaked, I decided against it. If anyone has any thoughts as to that scenario, I am very interested in hearing about it.
USB support: This will *not* be mountable under USB. Unfortunately you are still limited to transfering the data from a computer to the B&N internal storage or SDcard first, then moving the data internally. The problem that I see with this is similar to my understanding of the galaxy nexus situation, where the system can't unmount its /data partition and let the USB host take over. Another alternative to this could be to write an image file and mount that over usb (I've done this on my Evo, it worked so-so). Problem with that is that it really wouldn't grow/shrink with the storage. I suppose you could do some shell trickery and pipe it through gzip somehow, but that wouldn't help very much.
Let me know what you think and if you have any ways to improve this.
UPDATE: Persistance:
To make this persistant across reboots, run these commands as root:
1) mount -o rw,remount -t ext4 /dev/block/platform/mmci-omap-hs.1/by-name/system /system
2) echo mount -o remount,rw -t rootfs rootfs / >> /system/bin/clrbootcount.sh
3) echo mkdir /mnt/internal >> /system/bin/clrbootcount.sh
4) echo busybox mount -o bind /data/usrdata /mnt/internal >> /system/bin/clrbootcount.sh
5) echo mount -o remount,ro -t rootfs rootfs / >> /system/bin/clrbootcount.sh
All this does is put the following at the end of clrbootcount.sh
mount -o remount,rw -t rootfs rootfs / #Remounts root as RW. Root is regenerated at each reboot, so /mnt/internal is never going exist on a fresh startup
mkdir /mnt/internal #make /mnt/internal, see above
busybox mount -o bind /data/usrdata /mnt/internal #Binds the directory
mount -o remount,ro -t rootfs rootfs / #remounts root as RO. Unsure if this is necessary, but since it runs as RO, its probably better safe than sorry.
Thanks to eded333 for mentioning a good place for the script.
Edit: Doh, can a mod please move this to the nook tablet general forum? I must have failed reading...
This file autostarts each time you boot:
/system/bin/clrbootcount.sh
Add what you want at the end, and it will autoexecute it.
Wouldn't it be easier to just make a symbolic link to any partition you want to use?
Edit:
XD, didn't read you'r edit, , anyway maybe this works also for you.
Out of curiosity, what would symlinking to /sdcard do exactly? I don't think I'm quite following what you're saying. If I'm linking a directory to /sdcard, that would just go to the microsd card slot, which isn't what I was intending to do. The Nook tablet (I accidently posted this in the wrong forum, that much helps too) has 16GB of storage that is internal on /data, and can't be used through normal means. My goal was to be able to use this 16GB of data outside of rooted apps. Maybe I'm not understanding completely as I am a bit sleep deprived at the moment.
Thanks for the recommendation for the startup script though! I will definitely give that a shot and see if that makes this persist across reboots.
Yeah, I though you were talking about the NST which only has 2gb of internal memory and 200 mb left to use if you dont repartition, dont really know how the partitioning is on the nook color but just symlinking (hardlinks) the folder you want on a partition to another folder on another partition which has more space would resolve the issue.
Edit:
If i'm not getting it wrong and you want more space than the nook gives you, to store content. This should work, hope I'm not wrong
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
gameman733 said:
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
Click to expand...
Click to collapse
Don't know if this sounds dumb, but you can try to mount as rw the partition you want to use, then use ln -s + the folders on the partitions you want to link and see if it works, add the commands at the end of the file I showed you and look if it works correctly. Make sure the folders you use have sufficient permissions and that the partition is mounted as rw.
Edit:
You could allways resize the partitions without any inherent problem, make a backup before trying this.
I found it
need help with /mnt/internal please
I have been troubleshooting this for several hours. I have rooted my NT with latest indirects n&Z .bat. Everything is fine with that. I followed the instructions from kenblat for mounting the reserved data space that is now accessible to me through Root Explorer and making it persist through reboot with the new clrbootcount.sh. Here is where things are falling apart for me....a directory called /internal is appearing as it should in /data/mnt, and I created an "audio" directory there, and I have been able to copy a few songs into it.....but, at some point, the whole system freezes, never finishes the "paste" part, and I have to force reboot in order to get anything running again. When reboot, any and all of the material that I did manage to copy/paste into the /mnt/internal directory is GONE. I have tried changing permissions, but so far I have gone through this at least 9 times (I am a very persistent person when it comes to this stuff) and always the system stops functioning in the middle of pasting. My /internal folder is set to RWall, /data is rwxrwx--x, usrdata is rwall. clbootcount.sh is set to ---rwxr-x. I can't imagine that it really is a permmissions problem because of the fact that i am able to copy SOME files, a few at a time, without a problem. Can anyone possibly help me? Thanks.
IT WAS NOT A PERMISSIONS ISSUE. DISCOVERED BUSYBOX WAS NOT INSTALLED. (DON'T KNOW HOW IT GOT UNINSTALLED) I OPENED NINJAMORPH AND IT DID ITS CHECKS AND THERE IT WAS, NO BUSYBOX INSTALLED. SO I REINSTALLED IT, NOW MOUNTS INTERNAL AND PERSISTS UPON REBOOT. NO WONDER I HAD PROBLEMS.
Need help.
I have been trying to everything step by step as it says here but it is not workign for me. I just recently rooted my nook tablet. I was wondering, maybe a video tutorial would more.

howto: mount external sdcard as sdcard0

So, the Note 8.0 is a nice, fast, expensive device that had a big shortcoming for me: as shipped, the SD card is not useful as a place where application data easily lands - it's only intended for storing music and video files, or those chunks of data you manually target to it.
I fixed it, after a fashion, by mounting the card at boot time as sdcard0, which Samsung normally assigns to the (very limited) internal storage. The internal /data/media pool is treated as the external sdcard and very little installation data defaults to it. Apps2SD is still broken, but quite a lot of things simply default to using /sdcard0 as their preferred storage, which I find helpful.
You have to mount it at start time (init.d), and you have to mount it correctly (bind)
I figured out and set my device up this way by setting init.d scripts I learned about from threads by Ryuinferno (init.d) and mattiadj (rebinding in the Note 2) for this. Translation: none of this is my work, I just sounded out how others had done it and am assembling it here, since I know it will help other Note 8 folks.
I think that the init.d script support is very interesting - there are a lot of ROM tweaks that rely on init.d. You do not need a custom kernel for init.d to work the note 8 - which is nice, since we have no custom kernel
The outcome of this mod is that with an sdcard inserted, I get:
/storage/sdcard0 29.7G 3.68G 26.0G 32768
and
/storage/extSdCard 9.87G 1.78G 8.09G 4096
If I remove the card at boot, I still have apps (installed at /data/data) and the media
pool reverts to normal:
/storage/sdcard0 9.78G 1.78G 7.99G 4096
I wrote none of the scripts I'm using and will be the first to admit that I may have set them up stupidly.
Doing this voids your warranty and gives you pimples and a moon tan. But it does mean your sd card expands your storage and I hope that if there are better ways to do any of this, folks will chime in.
tools needed:
- knowledge of ADB and working ADB
- helps if you know how Unix and windows terminate lines differently, and can get your copy of Notepad++ to help you with the script, if you're trying this from Windows
- a note 8 running the 4.1.2 software - this approach is only tested there
- Kies
- Possibly Odin as a replacement for Kies (untested)
- understanding of how to put your device into recovery mode and trigger the Samsung recovery
- the US stock firmware for your device, for use with Odin (unless waiting on 1+ gig downloads if you screw something up is ok by you - the Kies method works, slooooowly.)
- Framaroot, to root your Note 8 (see the thread by tweebee)
- Busybox installed
Steps:
Install Framaroot
Root your device
Install busybox
Easy part done.
Next, you need to be able to run init.d scripts. At first I thought this might require a custom kernel, until I ran into Ryuinferno's excellent tool for enabling init.d without a custom kernel.
the thread I learned this from is by Ryuinferno at http://forum.xda-developers.com/showthread.php?t=1933849
I used term-init.sh from an ADB command line, but the thread has an APK in it called Uni-Init.apk that I would expect to work.
What you're doing is creating an install-recovery.sh script and telling it to go read /etc/init.d and run scripts there at boot.
Next, you want to create a simple script and drop it into /etc/init.d You can do this with an adb push; if you create the file in windows, though, you need to deal with the line endings correctly. You need the script to be executable and to be owned by root.
The one I'm using is this, from Mattiadj of the Note 2 community
in this thread: http://forum.xda-developers.com/showthread.php?t=2036796:
I call the script 07mount on my device, and a copy is attached to this post.
-----------------------script starts next line
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd
#and viceversa. With this you can use default internal sd only for app storage
#and the external sd to store all apps resource and all others stuff. The resut is a very
#big increase of installable apps on gnote2 and note8
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for
#the cmw zip. xda thread url
# at http://forum.xda-developers.com/showthread.php?t=2036796:
sleep 10
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:17 /storage/sdcard0
sleep 30
mount -o bind /data/media /storage/extSdCard
chmod 777 /mnt/extSdCard
sleep 10
chown 1023:1023 /storage/extSdCard
chown 1000:1000 /storage/sdcard0
------------- end script on blank line above
You need /system remounted read/write, either in your favorite file explorer or via adb shell:
#mount -o rw,remount /system
to put the file in and
#chown root:root
the script itself
Now, put a fat32 formatted card into your sdcard, and reboot. When done, you should be able to see that your data storage has been remapped.
If you ever wanted to install a Samsung update, by the way, you'd need to completely unroot the device. I think the following would probably work:
- remove the su binary
- remove superuser from /system
- remove the busybox binaries
- remove install-recovery.sh from /etc and the /etc/init.d folder
If there was someting in an update you really wanted, you might do better to start by using the Samsung firmware downloaded from samfirmware.com, set your device all the way back to a clean install, then check for the OTA - Samsung does look at modifications and blocks updates to devices with changes to /system. My device is ineligible for OTA at this time.
That said, it appears that using Kies in emergency recovery mode can be used to reset your device to an as-shipped condition (I learned this when an early experiment resulted in my device being weirdly screwed up - bootable, but the network was down for the browser, etc. DNS and ping worked from an ADB prompt, though...)
You can download a copy of the script at http://www.mediafire.com/?2wbm439vlapb6om
I'm gonna try this when I have a full afternoon off as I tend to mess things up the first time I do them. But this will be super useful if I get it working. Hopefully when people start developing custom roms they can build this script in and save us all the trouble :highfive:
Haven't tried it yet, but it sounds like a custom recovery is very, very close. Once that happens, making this into a flashable modification will be trivial.
The very active Note II development is incredibly helpful, because our hardware and software are so similar to theirs.
I know this was something that users on the other Galaxy Note 2 threads were doing, and was wondering if at some point this will be an issue with say JB 4.2.2. I recall that Apps2SD would be an issue later on and wouldn't work, but I never got to that point. For me I am really in need of a 32GB tablet and just can't compromise even with a 64GB microSD card. I don't know why this tablet isn't supporting a 128GB microSD card, that would be awesome.
Upgrading internal storage by blending in sdcard
Just to be clear - this mod does not allow app2sd style migration of apps (in /data/app) to the sdcard.
Rather, it puts /data/media on the sdcard. A lot of apps use /data/media as their default for storage, though, so it's a helpful middle ground. Also, your apps are installed whether or not the sdcard is inserted, which is helpful.
I notice that the update includes a script called
install-recovery.sh - the same script that this method is using.
I have tested replacing a backed up copy of install-recovery and also
appending the command
run-parts /system/etc/init.d/ to the new file.
Using just a script to call run-parts or the stock install-recovery.sh works just fine.
I found a much easier way of doing this.
http://forum.xda-developers.com/showthread.php?t=2276193
hi friends & master
please help me
Is there any way to transfer games and apps to the internal storage with app2sd (moving apps & games in from system Rom to SD card(internal) no memory card)?
my system rom There is almost full
1.44 GB (148 MB free)
internal 12.6 GB (5.8 GB free)
SD card 12.5 GB (5.6 GB free)
I do not need to memory card

Mount EXT4 MicroSD Card

I've given up on reformatting the internal memory as EXT4 (my last post). However now, I want to mount an external SD card that is EXT4 (or any file format that has UNIX permissions). I can't get my device to mount the card, it says the filesystem is unsupported. Now, that's bull**** since Android has built in support for EXT. After searching threads here on XDA and Google, and even purchasing EzyMount as recommended, I can't get it to mount. I've tried BusyBox and mount commands (as root), with various errors such as "mount operation not supported on transport endpoint". I'm at my wit's end by now, trying to get some filesystem which has support for symlinks and UNIX permissions... any ideas?
kcattakcaz said:
I've given up on reformatting the internal memory as EXT4 (my last post). However now, I want to mount an external SD card that is EXT4 (or any file format that has UNIX permissions). I can't get my device to mount the card, it says the filesystem is unsupported. Now, that's bull**** since Android has built in support for EXT. After searching threads here on XDA and Google, and even purchasing EzyMount as recommended, I can't get it to mount. I've tried BusyBox and mount commands (as root), with various errors such as "mount operation not supported on transport endpoint". I'm at my wit's end by now, trying to get some filesystem which has support for symlinks and UNIX permissions... any ideas?
Click to expand...
Click to collapse
you fully rooted with custom kernel or only with rdlv etc?
First you gotta figure out how to mount this damn thing, gotta be possible.
Then you need to get this done on bootup, either in init.rc or init.d or smth.
You probably just use wrong commands? But I could be wrong, didnt try that yet but would also be interested. Having the file permissions also on SD would be nice, but it could cause trouble with mtp maybe?
zroice said:
you fully rooted with custom kernel or only with rdlv etc?
First you gotta figure out how to mount this damn thing, gotta be possible.
Then you need to get this done on bootup, either in init.rc or init.d or smth.
You probably just use wrong commands? But I could be wrong, didnt try that yet but would also be interested. Having the file permissions also on SD would be nice, but it could cause trouble with mtp maybe?
Click to expand...
Click to collapse
I am rooted, but stock ROM and kernel. MTP is for connecting to a computer? If it is, I don't need that. I have tried
mount -rw -t ext4 /dev/block/mmcblk1p1 /storage/extStorageCard
and variants switching the flags and options.
Interesting... I just typed that command in to make sure I didn't make any typos.... and my phone crashed and rebooted. I typed it again to see if it would cause another crash and it appears to have mounted the card! Whwn I type "df" at the prompt it now shows a 28.6 GB filesystem at that location, which has to be my sd card.
Why, how, I don't know. It works, it's all I can say.

[Scripts][Root][LP/MM] LG G3 Usb Mass Storage Enabler for SDcard(Ext)

After getting fed up with the slow and stupid MTP mode i started thinking that USB Mass Storage support should still be there underneath even if its not enabled because i dont think 'android' developers would use MTP themselves, even if its imposed on us(yes i know the benefits of MTP but we should still have the option someway)
So i did some research and found a way to mount my LG G3 D850s Ext SDcard as Usb Mass Storage!
DISCLAIMER: USE AT YOUR OWN RISK. i wont be responsible for any harm if any that comes to your device.
Read the whole post before asking questions.
Detailed Info at the end if you need to make any more changes to the script.
Troubleshooting/Requirments:
1) Root Required (select the skull with 'su' written underneath in script manager script window if you are using script manager or run 'su' before running script if you are using terminal emulator)
https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en
2) Busybox needed (available in playstore)
3) Selinux mode should be permissive (before running any other scripts run setpermissive script attached or run 'su' in terminal and then 'setenforce 0' in terminal emulator. Selinux in enforcing mode may give "insert disk error". There is a bit more detail at the end about this)
4) SD card should be portable storage in Marshmallow and not adoptable. (this is not for lollipop)
5) Dont store the scripts in sd card (store them in internal sd or /system or /data )
6) Select 'cancel' if it asks to allow computer to access sd card when connecting mobile to computer, dont select 'allow' (only marshmallow) (Edited)
Marshmallow Instructions:
I am using Fulmics rom (Stock based)
I updated to marshmallow( just a few weeks ago and did get the UMS working after some time(usb related stuff has changed in MM but finally got it working with a trick). The main problem i still havent solved is mounting the SD card back to the phone with the right permissions with just commands. Marshmallow has changed a lot with adoptable and portable storages in marshmallow and how it handles permissions to sd card. I have been trying to find a way but havent found anything on the internet. Maybe ill ask around in XDA to solve this to make everything automated.
Basically the automated MM script does unmount SD card card from phone and mounts it on the computer with UMS but it cant remount the sd card back on the phone. But there is a workaround for now, that is to go into settings->Usb and Storage and eject and remount sd card manually.
The script is automated and you only need to run just this after connecting usb.
make sure you have fulfilled all the requirements given at the start of the post!
The instructions for getting UMS to work on MM are
A) Download:
'[MM]USB Mass Storage Automatic' script here http://www.mediafire.com/download/x5rl47mv9m3zc2z/[MM]USB_Mass_Storage_Automatic.txt
B) Change the script if needed:
You probably wont need to change the script but still follow the next 2 steps
1) run 'mount' command in terminal emulator
2) Locate the line saying "/dev/block/vold/public:179,65 /mnt/media_rw/XXXX-XXXX" (the XXXX-XXXX are your sd card serial number, dont worry about it).
what you need is the "/dev/block/vold/public:179,65"
The line 8 of my script is
sdcarddev="/dev/block/vold/public:179,65"
If "/dev/block..." part is the same as what you got above, dont change the script.
If the path is different, change the script to whatever you got!
so if you got "/dev/block/vold/179:65" change line in script to "sdcarddev="/dev/block/vold/179:65""
Save the script!
If script doesnt work later on, look over the detailed info at the end for any changes or post a comment
C) Normal Use ( i dont think restart is needed) :
1) connect the phone (and select 'cancel' whenever it asks to allow computer to access sd card, dont select 'allow' )
2) run the '[MM]USB Mass Storage Automatic' script using script manager with 'su'
3) The sd card should show up on your computer
4) Unplug usb cable
5) Go to settings->Storage & USB in your phone and under portable storage your sd card should be shown. Click the triangle at the right to eject Sd card then Click Sd card 'name part' again to mount it again.
6) You should be back to normal and should be able to use sd card again as before.
If you want to go back to mtp mode just swipe down the notification area and change usb mode to mtp after connecting usb cable.
Lollipop Instructions:
Read detailed info at end to make changes to scripts.
Either enter the commands manually in terminal emulator or run the scripts with su(root) permissions with Script Managers like
https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en
There are four scripts attached
1) USB mass storage enabler and mount
2) USB mass storage enabler
3) Mount Ext-Sd card
4) MTP enabler
There are mainly two parts for making UMS to work, changing usb config property to UMS and mounting sd card on computer.
When you change the property 'persist.sys.usb.config' you will have to restart the phone(restart might not be necessary). but after restarting Ext-SDcard wont mount automatically when you plug in USB cable.(There will be an drive icon in 'My Computer' but it wont open unless you run mount command.)
So you can either run Script 1 before reboot and again after reboot. No harm.
Or run Script 2 before reboot and Script 3 after reboot.
Script 4 is to revert back to MTP mode. No restart needed but you will have to choose MTP in USB options and maybe enable USB debugging if needed.
Order for enabling USB mass Storage:
1) Run Script 1 or Script 2
2) Restart (might not be necessary)
3) Run Script 1 or Script 3
Plug in usb cable at any time. It should say 'connected as Installer' instead of 'connected as MTP'
Order for enabling MTP:
1) Run Script 4
2) Choose MTP in USB connect option.
command: setprop persist.sys.usb.config mtp,adb
Restart phone if needed.
Automated script for Lollipop:
hassan.siddiqi.14 said:
you could try my new script..i wrote it to automate the whole process.
run script with su when u connect the cable or it wont work...it checks if usb cable connected, then unmounts sd card from phone then mounts it to computer then waits for cable disconnection and then mounts the sd card back to the phone..
before running the script, run the mount command and compare the sd card mount properties with the ones in the script.. also at the end.. should be same i think...make sure u have busybox..if u face a problem with remount, do it from the settings manually...
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/media_rw/external_SD
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/secure/asec
Click to expand...
Click to collapse
run setpermissive script before this script if you have selinux in enforcing mode
Automatic script link
http://www.mediafire.com/?gjdfef0rdajigc5
Detailed Info:
This info is old and was mainly written in relation on lollipop, marshmallow has small changes
There are two parts to mounting as USB Mass Storage:
1) Changing USB config property to USB Mass Storage
command: setprop persist.sys.usb.config mass_storage
2) Mounting ext-SDcard
command: echo /dev/block/vold/179:65 > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
You are going to need root for this.
I own a LG G3 D850 and running Lollipop CloudyG3 2.2 (Stock based ROM)
The scripts attached are according to my partition names(maybe others can confirm if its the same for them)
Instructions to edit scripts if needed:
Confirming ext-SDcard path:
Basically go to /dev/block/vold/ in root explorer and confirm the name of partition. It was 179:65 for me.
There were two files here 179:64 and 179:65. i confirmed my ext-SDcard was 179:65 using 'mount' command in terminal and locating the line /storage/external_SD.
If any changes are needed make them in the script 'USB mass storage enabler and mount.txt' accordingly.
Confirming mass_storage file path:
We are going to mount ext-SDcard to /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
confirm you have this file using root explorer. Although i think this is going to be same for all LG G3.
Or try these
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun_ex/file
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
/sys/devices/platform/msm_hsusb/gadget/lun0/file
If any changes are needed make them in the script 'USB mass storage enabler and mount.txt' accordingly.
Insert Disk Error in computer:
@ahorner mentioned that if you get "insert disk" it might be due to selinux being in enforcing mode.
you can check with command "getenforce" in terminal
you can change it to permissive mode with
"setenforce 0" command in terminal or run the setpermissive script in attachment.
If you want to change back to enforcing after you are done you can run the setenforce script.
hope that helps. thanks to @ahorner
Credits:
http://forum.xda-developers.com/showthread.php?p=29435666#post29435666 @aaki_rocker
http://forum.xda-developers.com/showpost.php?p=51040713&postcount=275 @MetaIIica
Please share your experiences.
I use script on G3 Beat (D722) lollipop, path same as G3 (D850)s. Ext SDcard mount on pc as CD_rom only
Any body get Mass storage working on Lollipop stock rom, pls share
SanjayG said:
I use script on G3 Beat (D722) lollipop, path same as G3 (D850)s. Ext SDcard mount on pc as CD_rom only
Any body get Mass storage working on Lollipop stock rom, pls share
Click to expand...
Click to collapse
did it show the folders of ur memory card?
try it on another computer, it might be a driver problem.
On ls990 stock rom, /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/ is a link to msm_dwc3 which I believe is a cd-rom device. I think phone has window drivers to install, maybe wrong. I use linux.
Code:
lrwxrwxrwx root root 2015-06-09 14:39 lun -> ../../../../msm_dwc3/f9200000.dwc3/gadget/lun0
/sys/devices/virtual/android_usb/android0/f_cdrom_storage should be for cdrom
open up the f_cdrom_storage/lun/file with text viewer...
it should be blank
f_mass_storage/lun/file should have /dev/block/179:65 f_mass_storage/lun/cdrom_usbmode should be 0
not sure about all this btw.
although i think it might be windows driver problem, thats why i asked him to try with a different pc to be sure.
Thanks for your respond. I try on another PC , find on Pic about the two mount drive on the PC
SanjayG said:
Thanks for your respond. I try on another PC , find on Pic about the two mount drive on the PC
Click to expand...
Click to collapse
the first pic is because sd card didnt mount.run the mount script.
the second pic is because sd card mounted but 'file system' was not compatible with windows. sd card should be fat or ntfs.
run 'su' then 'mount' command in terminal emulator.
you should get this
/dev/block/vold/179:65 /mnt/media_rw/external_SD vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
vfat is for 'fat' file system , if yours is ext4 it wont mount on windows. either format sd card in 'fat' or google ext4 mounter for windows..
hassan.siddiqi.14 said:
the first pic is because sd card didnt mount.run the mount script.
the second pic is because sd card mounted but 'file system' was not compatible with windows. sd card should be fat or ntfs.
run 'su' then 'mount' command in terminal emulator.
you should get this
/dev/block/vold/179:65 /mnt/media_rw/external_SD vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
vfat is for 'fat' file system , if yours is ext4 it wont mount on windows. either format sd card in 'fat' or google ext4 mounter for windows..
Click to expand...
Click to collapse
Hi Hassan
Thx for trying to help me. I have two partition on my Ext SD card, Fat32 and Ext4. I use Link2SD in the partition Ext4
I was able to mount my Ext SDcard as mass storage in kitkat ( http://forum.xda-developers.com/showthread.php?t=2740826 )
I loss this useful mean to sync some of apps with my PC when I upgrade to lollipop 5.0.2
I check the path /sys/devices/virtual/android_usb/android0/f_mass_storage/lun and it is link to cdrom_usbmode
Also check the path /sys/devices/virtual/android_usb/android0/f_cdrom_storage/lun and it is link to cdrom_usbmode
Pls see image, is it Ok or need to amend
SanjayG said:
Hi Hassan
Thx for trying to help me. I have two partition on my Ext SD card, Fat32 and Ext4. I use Link2SD in the partition Ext4
I was able to mount my Ext SDcard as mass storage in kitkat ( http://forum.xda-developers.com/showthread.php?t=2740826 )
I loss this useful mean to sync some of apps with my PC when I upgrade to lollipop 5.0.2
I check the path /sys/devices/virtual/android_usb/android0/f_mass_storage/lun and it is link to cdrom_usbmode
Also check the path /sys/devices/virtual/android_usb/android0/f_cdrom_storage/lun and it is link to cdrom_usbmode
Pls see image, is it Ok or need to amend
Click to expand...
Click to collapse
my pleasure..
you didnt understand me
go to /sys/devices/virtual/android_usb/android0/f_mass_storage/lun
and open the file 'file' with text viewer..it should have /dev/block/vold/179:65 written inside..
open the file 'cdrom_usbmode' it should have 0
ext4 partition might be causing problems..
sourceforge. net /projects/ext2fsd/files/Ext2fsd/0.62/Ext2Fsd-0.62.exe/download
go to this link and install it..remove spaces in link...
this is ext4 drivers tool for windows..try mounting after this... btw do u still use link2sd?
also send me your 'mount' command output...
Hi Hassan
I have done some check and mod as you advice
Replace my partition SD Card with another one, single partition and fat32
Re write all script as start of post
Delete /system/usbautorun.iso from f_cdrom_storage/lun/file (now blank)
Check f_mass_storage/lun/cdrom_usbmode should be 0 , Ok
Check /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file ---> Not ok, file blank
Write this /dev/block/vold/179:65 inside file and test see Pic
USB is enable drive mount but can't access "Empty Disk"
Check again /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file ---> file blank
Thx, there is progress awaiting your advice to proceed
did you write yourself or run the script?
run the script and see..
also you did not send 'mount' command output..
and USB mass storage mode is working but the sd card wont mount on pc. thats why you are geting the error.
and it is connecting as removable disk and not as cd rom..like its supposed to be.
also go to settings->storage and unmount sd card and then run script.
Hello Hassan
I run script with SManager
See attached "Mount" output, unmount Card and run script same result
did you check the file 'file', is it still empty?
and go to device manager in your computer, if there are any yellow exclamations when you connect, uninstall those drivers and connect again.
did you try restarting the device and checking?
and use the attached script, and also enable usb debugging in developer options
one thing that i missed, are you using su when running script with script manager?
see attachment
Hi,
Thanks for the scripts! Unfortunately, I can't get USM to work...
First things first, I'm an IT specialist and am familiar with Linux and it's file system. I'm not a developer though.
My phone is the canadian LG G3 (LG-D852) running CM 12.1.
So, when I first used the "set mass storage and mount" script and rebooted, then ran it again after reboot, the computer saw the phone in the device manager as LG-D852, with the exclamation mark stating "no drivers installed". It didn't show up in the Computer. On the phone, it said "Connected as installation" (or something like that, my phone is in french so I don't know the exact english message).
I went back to MTP, and it worked normally. Now when I try to go back to USM, the computer doesn't even detect any new peripheral (Device manager doesn't refresh and no "new device" sound). The phone doesn't show any USB connection either, but the charging LED comes on. I tried different USB cables on different computers, to no avail. The problem resides in the phone. Going back to MTP always works fine.
The "mount" command as SU gives me the /dev/block/vold/179:65 as both /mnt/media_rw/sdcard1 and /mnt/secure/asec like it should, both in vfat, meaning they are the correct numbers and partition format.
I tried disabling and re-enabling USB debugging, running the different scripts with SManager, typing the commands in terminal with su (under root user), unmounting the SD card in the phone's settings.
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file has the proper content (/dev/block/vold/179:65).
The other possible files don't exist:
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun_ex/file
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
/sys/devices/platform/msm_hsusb/gadget/lun0/file
f_cdrom_storage/lun/file is empty.
f_mass_storage/lun/cdrom_usbmode has "0" in it.
f_mass_storage/lun/cdrom also has "0" in it.
f_mass_storage/lun/file has "/dev/block/vold/179:65"
I also tried "mass_storage" alone and "mass_storage,adb" in the setprop command.
Anything else I can try before giving up?
Magzime said:
Hi,
Thanks for the scripts! Unfortunately, I can't get USM to work...
First things first, I'm an IT specialist and am familiar with Linux and it's file system. I'm not a developer though.
My phone is the canadian LG G3 (LG-D852) running CM 12.1.
So, when I first used the "set mass storage and mount" script and rebooted, then ran it again after reboot, the computer saw the phone in the device manager as LG-D852, with the exclamation mark stating "no drivers installed". It didn't show up in the Computer. On the phone, it said "Connected as installation" (or something like that, my phone is in french so I don't know the exact english message).
I went back to MTP, and it worked normally. Now when I try to go back to USM, the computer doesn't even detect any new peripheral (Device manager doesn't refresh and no "new device" sound). The phone doesn't show any USB connection either, but the charging LED comes on. I tried different USB cables on different computers, to no avail. The problem resides in the phone. Going back to MTP always works fine.
The "mount" command as SU gives me the /dev/block/vold/179:65 as both /mnt/media_rw/sdcard1 and /mnt/secure/asec like it should, both in vfat, meaning they are the correct numbers and partition format.
I tried disabling and re-enabling USB debugging, running the different scripts with SManager, typing the commands in terminal with su (under root user), unmounting the SD card in the phone's settings.
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file has the proper content (/dev/block/vold/179:65).
The other possible files don't exist:
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun_ex/file
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
/sys/devices/platform/msm_hsusb/gadget/lun0/file
f_cdrom_storage/lun/file is empty.
f_mass_storage/lun/cdrom_usbmode has "0" in it.
f_mass_storage/lun/cdrom also has "0" in it.
f_mass_storage/lun/file has "/dev/block/vold/179:65"
I also tried "mass_storage" alone and "mass_storage,adb" in the setprop command.
Anything else I can try before giving up?
Click to expand...
Click to collapse
im assuming that you have already installed the right lg g3 drivers otherwise mtp wouldnt have worked..but try reinstalling from here after uninstalling previous ones..
i dont remember where i download from...
http://www.mylgphones.com/download-and-install-the-usb-drivers-for-lg-g3-on-windows-and-mac.html
have you tried to unhide hidden drivers in device manager and uninstalled the devices that installed when u first connect the lg g3 in UMS..there are probably still there in hidden mode... that sometimes causes problem..i have to uninstall mtp drivers when i switch back to mtp..
you could try that..
thirdly you could try my new script..i wrote it to automate the whole process.
run script with su when u connect the cable or it wont work...it checks if usb cable connected, then unmounts sd card from phone then mounts it to computer then waits for cable disconnection and then mounts the sd card back to the phone..
before running the script, run the mount command and compare the sd card mount properties with the ones in the script.. also at the end.. should be same i think...make sure u have busybox..if u face a problem with remount, do it from the settings manually...
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/media_rw/external_SD
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/secure/asec
Neither the phone nor the computer detect any device, none at all, only the LED comes on to indicate charging, as if the phone was in "Charge only" USB setting, so the driver is not my problem, at least not anymore... Maybe it was on the first try, but I can't manage to reproduce that state anymore.
Trying the new automated script right now...........
.............................
Weird, I get an unexpected "else" on line 39, but everything seems in order, I even opened the script in Notepad++ to make sure every "if" has its "fi". I run it with SManager and SU checked.
hassan.siddiqi.14 said:
im assuming that you have already installed the right lg g3 drivers otherwise mtp wouldnt have worked..but try reinstalling from here after uninstalling previous ones..
i dont remember where i download from...
have you tried to unhide hidden drivers in device manager and uninstalled the devices that installed when u first connect the lg g3 in UMS..there are probably still there in hidden mode... that sometimes causes problem..i have to uninstall mtp drivers when i switch back to mtp..
you could try that..
thirdly you could try my new script..i wrote it to automate the whole process.
run script with su when u connect the cable or it wont work...it checks if usb cable connected, then unmounts sd card from phone then mounts it to computer then waits for cable disconnection and then mounts the sd card back to the phone..
before running the script, run the mount command and compare the sd card mount properties with the ones in the script.. also at the end.. should be same i think...make sure u have busybox..if u face a problem with remount, do it from the settings manually...
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/media_rw/external_SD
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,utf8 /dev/block/vold/179:65 /mnt/secure/asec
Click to expand...
Click to collapse
Magzime said:
Neither the phone nor the computer detect any device, none at all, only the LED comes on to indicate charging, as if the phone was in "Charge only" USB setting, so the driver is not my problem, at least not anymore... Maybe it was on the first try, but I can't manage to reproduce that state anymore.
Trying the new automated script right now...........
.............................
Weird, I get an unexpected "else" on line 39, but everything seems in order, I even opened the script in Notepad++ to make sure every "if" has its "fi". I run it with SManager and SU checked.
Click to expand...
Click to collapse
firstly put the script in internal or system folders, because if its in the sd card you wont have access to the script after unmounting the sd card, might cause problems...
you are running the script after connecting the cable right?
go and check this using root explorer when u connect the cable and make sure its changed to 'configured'
/sys/class/android_usb/android0/state
also type getprop persist.sys.usb.config in terminal to check if it changes to mass storage,adb when you run the automated script or my previous UMS enabler script
try something connect the phone.
run the mtp enabler script attached
use the drop down menu to select mtp manually in choose usb mode or something
then run my automated script(not stored in sd card)
now it should say connected as installer
if not then im pretty sure its a driver problem or maybe aosp thing
did u reinstall drivers?
did u select "show hidden devices" in view in device manager and check if any preexisting devices are there..uninstall those...
hassan.siddiqi.14 said:
firstly put the script in internal or system folders, because if its in the sd card you wont have access to the script after unmounting the sd card, might cause problems...
you are running the script after connecting the cable right?
go and check this using root explorer when u connect the cable and make sure its changed to 'configured'
/sys/class/android_usb/android0/state
also type getprop persist.sys.usb.config in terminal to check if it changes to mass storage,adb when you run the automated script or my previous UMS enabler script
try something connect the phone.
run the mtp enabler script attached
use the drop down menu to select mtp manually in choose usb mode or something
then run my automated script(not stored in sd card)
now it should say connected as installer
if not then im pretty sure its a driver problem or maybe aosp thing
did u reinstall drivers?
did u select "show hidden devices" in view in device manager and check if any preexisting devices are there..uninstall those...
Click to expand...
Click to collapse
Found the problem with the "unexpected else" in the script: wrong CRLF from Windows, had to edit with Notepad++ and save as SH script, no the script runs without error. Had to edit it to change the mount point of the SD card to fit what "mount" reports.
I have always run the scripts from the internal memory.
Busybox 1.23.2 is installed.
So, starting from scratch, before running the script.
Plugged in as MTP, can browse both internal and SD from Computer, and I see the free space for each of them. The usual stuff.
mount returns the following:
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0
Note the /mnt/media_rw/sdcard1 instead of /external_SD in your original script, that's what I changed to fit this mount.
With cable plugged, running the script as SU with SManager, script waits at "usb mass storage connected". Looking good, but meanwhile:
Dropdown says "Connected as MTP" and "USB debugging enabled".
getprop persist.sys.usb.config now returns "mass_storage,adb"
/sys/class/android_usb/android0/state contains CONFIGURED
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file contains /dev/block/vold/179:65
I can't see the SD card anymore in root explorer from the phone, but in my computer, I still see the same thing: MTP connected phone, internal memory and SD card can be browsed.
The two previous lines in "mount" have been replaced by the following:
/dev/block/platform/msm_sdcc.1/by-name/userdata /dev/SM_bin ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,resuid=1000,errors=continue,data=ordered 0 0
When unplugging the cable, the scripts resumes and ends, with everything back to normal.
Now, if I reboot the phone, it goes back to the state where neither the phone nor the computer detect a connection, so I run the MTP Enabler script, now the phone shows "Connected as installer", but nothing else shows in Computer. I see the LG-D852 in the devices, yellow exclamation mark "No drivers installed" (I get this status even in regular MTP mode). I can go to the settings from the dropdown and select MTP again to get everything working normally.
Still no UMS though... :crying:
Magzime said:
Found the problem with the "unexpected else" in the script: wrong CRLF from Windows, had to edit with Notepad++ and save as SH script, no the script runs without error. Had to edit it to change the mount point of the SD card to fit what "mount" reports.
I have always run the scripts from the internal memory.
Busybox 1.23.2 is installed.
So, starting from scratch, before running the script.
Plugged in as MTP, can browse both internal and SD from Computer, and I see the free space for each of them. The usual stuff.
mount returns the following:
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0
Note the /mnt/media_rw/sdcard1 instead of /external_SD in your original script, that's what I changed to fit this mount.
With cable plugged, running the script as SU with SManager, script waits at "usb mass storage connected". Looking good, but meanwhile:
Dropdown says "Connected as MTP" and "USB debugging enabled".
getprop persist.sys.usb.config now returns "mass_storage,adb"
/sys/class/android_usb/android0/state contains CONFIGURED
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file contains /dev/block/vold/179:65
I can't see the SD card anymore in root explorer from the phone, but in my computer, I still see the same thing: MTP connected phone, internal memory and SD card can be browsed.
The two previous lines in "mount" have been replaced by the following:
/dev/block/platform/msm_sdcc.1/by-name/userdata /dev/SM_bin ext4 rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,resuid=1000,errors=continue,data=ordered 0 0
When unplugging the cable, the scripts resumes and ends, with everything back to normal.
Now, if I reboot the phone, it goes back to the state where neither the phone nor the computer detect a connection, so I run the MTP Enabler script, now the phone shows "Connected as installer", but nothing else shows in Computer. I see the LG-D852 in the devices, yellow exclamation mark "No drivers installed" (I get this status even in regular MTP mode). I can go to the settings from the dropdown and select MTP again to get everything working normally.
Still no UMS though... :crying:
Click to expand...
Click to collapse
from what i can see your phones drunk!
its doing everything wrong!
but showing connected as installer is good,i mean if you edited the scripts with the right paths.
its the problem on your computer side, i keep telling you.. driver issue!
if we could set up a skype or teamviewer connection, i might be able to do something..
but check this out first...
http://forum.xda-developers.com/galaxy-note-3/general/note-3-usb-mass-storage-t3020854
and try disabling usb debugging, i read that android one devices with cm12 need to disable that for ums to work...
and fyi the 'mount' command lines didnt get replaced...they are mount points for userdata partition...the last two lines didnt show when you unmounted the sd card that belonged to the sd card...
and if there is someone for whom the scripts are working, please comment....for cloudy and cm12 based...

Categories

Resources