[Q] how to imitate double mount sd card via adb ? - Android Q&A, Help & Troubleshooting

Hi,
I want to mount my sdcard to the PC and to the phone in one time, but i want to do it by the adb shell script.
Dual mount SD and similiar apps works well, but i think that script+tasker will make it better.
And there is my question, what ADB commands i must type to do that ?
what i must mount to what ?
i tried mounting /dev/block/mmnclk0p1 to some places and /dev/block/vold/179:1 but it dont work
I think that think might be usefull, because we can add this script to init.d and always have access to our SD cards from pc, when we plug in the phone.
Im on P.A.C. 4.3 Neo V ( haida) based on cm 10.2
Sorry for my bad english, still learning...

Related

[Q] Dual mount SD card

Hi users and devs of XDA
i got a question there is an widget that dual mount you SD card to the computer and to the computer
my question is there a script that does this
any mod we can add to vold file or ramdisk
so we dont need the widget but when you plug in your phone and you'll touch the mount button it mount on your pc but you can get to sd on phone too (or even auto mount to pc)
thanks
Owain94
owain94 said:
Hi users and devs of XDA
i got a question there is an widget that dual mount you SD card to the computer and to the computer
my question is there a script that does this
any mod we can add to vold file or ramdisk
so we dont need the widget but when you plug in your phone and you'll touch the mount button it mount on your pc but you can get to sd on phone too (or even auto mount to pc)
thanks
Owain94
Click to expand...
Click to collapse
am a noob.. but I know of this program https://play.google.com/store/apps/d...rd.widget.free maybe it might help. thanku.
EDIT : OMG.. I just saw the POST DATe now.. its sooo old.. lolz.. I came here thru google.. if someone else does. that's the link for Multi Mount.

[Q] Sync mount for usb connection

One of the questions that has arisen a lot with Team-B CM7 for NT is the query about why the internal storage no longer shows as a mount point when connect via USB to a computer.
This is a valid question and one that curently I am unsure how to answer and to correct with the system. In Our latest build that we are using within the team the internal media partition is mounted but it doesn't show when connected via USB.
Does anybody know where the settings to enable this are hidden?
When issuing a mount command in the stock rooted rom terminal it shows media as having 'dirsync' which I'm assuming is how it shows in usb sync but I'm unsure at the moment how and where this is set.
So rather than spend a long time looking I thought it may speed us the process if I just asked because chances are that somebody else already know the answer
Thanks in advance for you help and advice.
Celtic.
I don't know if this is of any use, but with my modified vold.fstab internal storage is showing up via USB on my computer. But my real SDcard is not showing up on my PC now. It is mounting to /sd-ext though so I copied the Android folder from /sd-ext to /mnt/sdcard to make my apps happy. Anyway here is my vold.fstab.
dev_mount sdcard /mnt/sdcard 10 002 /devices/platform/usb_mass_storage/lun0 /devices/platform/mmci-omap-hs.1/mmc_host/mmc0
dev_mount sd-ext /sd-ext auto auto /devices/platform/usb_mass_storage/lun1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
tselling said:
I don't know if this is of any use, but with my modified vold.fstab internal storage is showing up via USB on my computer. But my real SDcard is not showing up on my PC now. It is mounting to /sd-ext though so I copied the Android folder from /sd-ext to /mnt/sdcard to make my apps happy. Anyway here is my vold.fstab.
dev_mount sdcard /mnt/sdcard 10 002 /devices/platform/usb_mass_storage/lun0 /devices/platform/mmci-omap-hs.1/mmc_host/mmc0
dev_mount sd-ext /sd-ext auto auto /devices/platform/usb_mass_storage/lun1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
Click to expand...
Click to collapse
it seems that unless told otherwise the system only shows whichever partition is showing as sdcard, which your changes prove, it lost the real sd but is showing the internal which you mojnted as sdcard. We need to work out how to make it show the media partition and the sd card. In current build we have the internal is mounting the media to mnt/media and it's mounting sdcard to mnt/sdcard wbut it only shows sdcard on usb sync mount. It going to be something in ramdisk thast quite obvious once we realise I'm sure!
I just had an idea... what about mounting an internal partition as an sd card and mount the external as "sd_ext" or something similar? We had to do that with another device I worked on.
I'll hit you up on gtalk
Celtic i have been looking in the Nook Color forums and there i found:
[APP][02/26] Nook Color USB Mass Storage utility - Mount any partition to your PC so possibly it can be modified for the nook tablet? . I don't know how different they might be in this scenario, just posting what i've found.
~ Veronica
darthvince said:
I just had an idea... what about mounting an internal partition as an sd card and mount the external as "sd_ext" or something similar? We had to do that with another device I worked on.
I'll hit you up on gtalk
Click to expand...
Click to collapse
I'm wondering something similar, I was wondering if this could cure the market install problem .... you never know
I'm aroudn so grab me on Gtanl
lavero.burgos said:
Celtic i have been looking in the Nook Color forums and there i found:
[APP][02/26] Nook Color USB Mass Storage utility - Mount any partition to your PC so possibly it can be modified for the nook tablet? . I don't know how different they might be in this scenario, just posting what i've found.
~ Veronica
Click to expand...
Click to collapse
Thanks I'll look into it and see if it can help
CelticWebSolutions said:
Thanks I'll look into it and see if it can help
Click to expand...
Click to collapse
There is also a IMEI generator in development section too that it might help with some apps not working like the free version of XDA which looks for an IMEI when it starts .
~ V
lavero.burgos said:
Celtic i have been looking in the Nook Color forums and there i found:
[APP][02/26] Nook Color USB Mass Storage utility - Mount any partition to your PC so possibly it can be modified for the nook tablet? . I don't know how different they might be in this scenario, just posting what i've found.
~ Veronica
Click to expand...
Click to collapse
Thanks
I didn't use the app but it showed what I needed to know
I now have media mounting automatically and then you can choose to mount sd card
Thanks again
CelticWebSolutions said:
Thanks
I didn't use the app but it showed what I needed to know
I now have media mounting automatically and then you can choose to mount sd card
Thanks again
Click to expand...
Click to collapse
grrrrrrreat, you're very welcome pal!
~ V
CelticWebSolutions said:
Thanks
I didn't use the app but it showed what I needed to know
I now have media mounting automatically and then you can choose to mount sd card
Thanks again
Click to expand...
Click to collapse
Can it mount both automatically?
tselling said:
Can it mount both automatically?
Click to expand...
Click to collapse
Yes tahst currently how I have mine set. Just testing a few things with it
CelticWebSolutions said:
Yes tahst currently how I have mine set. Just testing a few things with it
Click to expand...
Click to collapse
excellent!
Unfortunately while it allowed us to manually mount drives to sync to computer it didn't work when we entered them into a script in boot, it would work once , then oif you disconnected the usb cable and tried again nothing would mount at all.
So if anybody has any further ideas that would be great
Thanks again!
CelticWebSolutions said:
Unfortunately while it allowed us to manually mount drives to sync to computer it didn't work when we entered them into a script in boot, it would work once , then oif you disconnected the usb cable and tried again nothing would mount at all.
So if anybody has any further ideas that would be great
Thanks again!
Click to expand...
Click to collapse
I hope you don't mind if I speculate; I'm no programmer but I have a crazy idea that may or may not work.
I also acknowledge that what I'm about to suggest might seem obvious and you may have already tried it, but I'm doing what I can here!
When you say script, do you mean something resembling a shell script? Because if so, it sounds like it's listening for a USB connection and then the script finishes once it's connected, so it doesn't loop back to the start of the script and listen for a USB connection to mount the other partitions after it's already done it once.
If it is indeed a script of that nature, you could create a separate mounting script that does the work and then infinite loops back to the beginning after all of the operations are complete. Then you would call this mounting script in boot (something resembling sh mounting-script.sh &) and voila - you have a script that will continue listening for a USB connection after disconnect like it should.
Once again, this is all speculative, but shell scripts are very powerful things. Here's a full, detailed page on looping in Bash, including infinite loops:
http://www.cyberciti.biz/faq/bash-for-loop/
lavero.burgos said:
There is also a IMEI generator in development section too that it might help with some apps not working like the free version of XDA which looks for an IMEI when it starts .
~ V
Click to expand...
Click to collapse
Eehm that's odd, the FREE version of xda installed and works fine for my on CM7, but the PAID version doesn't install at all. Not from titanium backup nor from the market..
CelticWebSolutions said:
Unfortunately while it allowed us to manually mount drives to sync to computer it didn't work when we entered them into a script in boot, it would work once , then oif you disconnected the usb cable and tried again nothing would mount at all.
So if anybody has any further ideas that would be great
Thanks again!
Click to expand...
Click to collapse
Firstly huge thanks to the CM7 team for this excellent release.
Here is a script I wrote to automount the internal storage to the PC.
1. rename 10mountmedia.zip to 10mountmedia (can't upload non zip file)
2. Use root explorer to copy it to /system/etc/init.d and set permission to 755 (all read, top write, all execute)
3. reboot
Working /media mount
lavero.burgos said:
Celtic i have been looking in the Nook Color forums and there i found:
[APP][02/26] Nook Color USB Mass Storage utility - Mount any partition to your PC so possibly it can be modified for the nook tablet? . I don't know how different they might be in this scenario, just posting what i've found.
~ Veronica
Click to expand...
Click to collapse
It Works
just did this :
1.)mounted /media using :
Code:
mount -w -t vfat /dev/block/vold/179:10 /mnt/media
ln -s /mnt/media /media
2.)used the trick by samuelhoff in his post .
In terminal :
[Edit:]
Code:
echo /dev/block/mmcblk0p10 > /sys/devices/platform/usb_mass_storage/lun1/file
Use of lun1 seems to allow both to mount . However this indicates a deeper pathology because the vold .fstab file has :
Code:
dev_mount sdcard /mnt/sdcard auto auto /devices/platform/usb_mass_storage/lun1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
dev_mount media /mnt/media 10 002 /devices/platform/usb_mass_storage/lun0 /devices/platform/mmci-omap-hs.1/mmc_host/mmc0
The lun0 and lun1 are interchanged ??? I'm guessing this file has become redundant in CM7 ?
Anyways my updated batch file in attached zip file now works. only, It has to be done every time. Mayhap its possible to put this in autorun.inf script of the sdcard root ? (will try now)
@cobrato : maybe try using lun1 in your script
@daedricgeek
I've tried both but settled with lun0. Sdcard mount will take lun1 so both can be used at the same time.
Sent from my LT18i using Tapatalk
This doesn't solve the problem but may be of some help to diagnosing the problem. I found that when I plug in the USB cable and tell the tablet to turn on USB storage, the file /sys/devices/platform/usb_mass_storage/lun0/file gets populated with: /dev/block/vold/179:10
but the file /sys/devices/platform/usb_mass_storage/lun1/file is still empty.
Doing the mount command shows:
...
/dev/block/vold/179:10 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:17 /sd-ext vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /sd-ext/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
So I figured the empty file should be populated with: /dev/block/vold/179:17
So I echoed that into the file with the USB cable connected and I got the popup on my PC for lun1 (in my case the external sd card since I swapped them in vold.fstab). And both lun0 and lun1 were mounted on my PC. **** Note that the dev/block/vold entry differs on my two nook tablets... its /dev/block/vold/179:17 on one and /dev/block/vold/179:16 on anoher.... not sure why ****
So it appears to me that whatever process triggers the lun0/file to be populated isn't setup to do it for lun1. (It also it not clearing the file when I turn off USB storage for lun1.) I don't know if this is just useless information or not but I thought I would share it just in case it helps.
I also have to eject and reinsert my SD-card before it gets mounted to the NT after every reboot. Don't if thats unrelated or not.

[Q] Can't see sdcard in recovery mode.

Hey,
I've flashed Omega 33.2 and Siyah 1.8 kernel.
I used 5.5.0.4 CWM recovery (didn't change the recovery, just flashed Omega and right after Siyah).
I then flashed something from Omega kitchen that I guess made some problems with the ROM, so I got in a bootloop. Not a problem - I will just flash the rom again and everything will be ok, but unfortunately I deleted the rom from my phone memory. In those situations I just go inside recovery and mount the sdcard, so I went into mounts and storage -> mount /sdcard, I connected to my computer (windows 7) but nothing happened. So I tried to install kies, but it didn't help too. I also tried the same in Ubuntu (maybe it's mass storage and not MTP because from what I know linux doesn't support MTP), but it didn't worked.
I end up taking my external sd card, putting the rom on it, and flashed the zip from the external sd card.
I don't want to do it every time I want to put something in my phone through recovery. How can I fix this problem? (Yes, I tried more than one USB slot and cable).
Thanks in advance!
TRY
http://forum.xda-developers.com/showthread.php?t=1943592
jje
JJEgan said:
TRY
http://forum.xda-developers.com/showthread.php?t=1943592
jje
Click to expand...
Click to collapse
Thanks for your reply.
Tried TWRP, CWM touch 6, but it didn't work. I tried to mount external sd card and it didn't work also. Tried windows7, ubuntu (I think it's mass storage so it should work), and another computer with windows7, but didn't work in neither of them.
Also, tried 'adb devices' when the phone is plugged in in recovery and it didn't see the device too. Does adb suppose to work when I'm in recovery? (I'm developing Android apps so I'm sure that adb is 100% working when the phone is on).
In CWM 6, I press mount /sdcard and after I press the text is still mount /sdcard (doesn't change to unmount), and when I press mount /ex-sdcard it change to unmount /ex-sdcard but doesn't appear on the computer also.
Does anybody else is facing the same problem? very annoying :S
Nobody faces this problem too..? :/
same issue here!!! trying to get some help as I don't have an SD card available right now

[Q] Can see but cant access files via USB cable?

Hi,
I have an issue and cant seem to find anything on the forums.
I use Linux ubuntu and when I connect via my USB dock I can see the folders on my external storage but cant access them.
Its a 32GB card formatted to FAT 32. When I take the card out of the phone and connect directly via SD card slot it works no problem.
I have spoken to somone about this and they think that when I rooted the device as I did not put in a password this is why I cant see whats in the folders. Its something to do with security does anyone know if that is correct?
Thanks
Mathew
mm tried:
run "fdisk -l" command. Here you'll see the USB and it's path.
Create and directory name /mnt/usb/ then use the command
"mount -t ext3 /dev/sda1 /mnt/usb" and then, "cd /mnt/usb"
?
That does not work
If I re rooted the device when I re root will it allow my to put a password on it? Which would mean each time I connect my via USB would my Ubuntu machine ask for the password and give me access to the files?
trahedy... phone don`t want to flash firmwares... Odin always stuck and heimdall too... WTF ?! what l need to do now?
Does anyone one have any idea do I just need to reroot my phone?

can "format as internal storage" be restored to sony's MM

can "format as internal storage" be restored to sony's MM?
I know MM has just arrived. but I was hyped for MM because of this feature so you can understand my disappointment. I actually downgraded to LP since they even removed Stamina!
The main problem is that the 16gb internal are not enough. And if you have many photos and videos, the thumbnail data can be large in size, reached 5gb with me! And you can not change its directory. And it regenerates if deleted.
In my former Xperia p, I think I overcame this issue by making the thumbnail data file a dummy one then read-only it (i'm not sure whether I did that on Xperia p or another former phone) . I wasn't able to do this trick in LP
I use z2 d6502 rooted LP now.
My SD card is Kingston 64gb class 10
Well, that's something that disappointed me, too. So I tried it different ways f.e. here, but ended without result.
fireheart2008 said:
can "format as internal storage" be restored to sony's MM?
I know MM has just arrived. but I was hyped for MM because of this feature so you can understand my disappointment. I actually downgraded to LP since they even removed Stamina!
The main problem is that the 16gb internal are not enough. And if you have many photos and videos, the thumbnail data can be large in size, reached 5gb with me! And you can not change its directory. And it regenerates if deleted.
In my former Xperia p, I think I overcame this issue by making the thumbnail data file a dummy one then read-only it (i'm not sure whether I did that on Xperia p or another former phone) . I wasn't able to do this trick in LP
I use z2 d6502 rooted LP now.
My SD card is Kingston 64gb class 10
Click to expand...
Click to collapse
if you want to get your game obb files from your internal storage to your sd card for example i can reccomand the xposed module "OBB TO SD"
it`s simple to use, just inable it and then you can move your obb files from sdcard0\Android\obb to sdcard1\Android\obb!
if you want a rooted mm with xposed and a working twrp recovery check out this thread: id did it this way
http://forum.xda-developers.com/xperia-z2/general/6-0-1-d6503-23-5-0-570-prerooted-t3364817
in default , there is no setting to format as internal sdcard.
but you can enable it by usin adb command.
connect the phone to pc with usb debugging on..
open windows command prompt and type "adb shell sm list-disks" (ignore the quotes)
notice the output, it will be something like ---> disk:179,64 (179,64 is ID for sdcard)
now , parting the sd card.
* type .-->> adb shell sm partition disk:179,64 private (if you want to use the whole sdcard as internal storage)
* type --->> adb shell sm partition disk:179,64 mixed 70 (if you just want to use 30% of sdcard as internal storage)
** I found this way when i was googling, this is not a work of mine **
Thank you for your reply. I think I will try that
chax_84 said:
in default , there is no setting to format as internal sdcard.
but you can enable it by usin adb command.
connect the phone to pc with usb debugging on..
open windows command prompt and type "adb shell sm list-disks" (ignore the quotes)
notice the output, it will be something like ---> disk:179,64 (179,64 is ID for sdcard)
now , parting the sd card.
* type .-->> adb shell sm partition disk:179,64 private (if you want to use the whole sdcard as internal storage)
* type --->> adb shell sm partition disk:179,64 mixed 70 (if you just want to use 30% of sdcard as internal storage)
** I found this way when i was googling, this is not a work of mine **
Click to expand...
Click to collapse
This works for me. But I have camera issue. Cannot take picture, said "Memory unavailable." Don't know if it associated with adoptable storage. Am I the only one?
I have no problem in saving picture.
Or , just try to set sdcard ss default in camera.
Or , if you install xposed and use xinternal module, just remove it. It'll give so much trouble.
chax_84 said:
in default , there is no setting to format as internal sdcard.
but you can enable it by usin adb command.
connect the phone to pc with usb debugging on..
open windows command prompt and type "adb shell sm list-disks" (ignore the quotes)
notice the output, it will be something like ---> disk:179,64 (179,64 is ID for sdcard)
now , parting the sd card.
* type .-->> adb shell sm partition disk:179,64 private (if you want to use the whole sdcard as internal storage)
* type --->> adb shell sm partition disk:179,64 mixed 70 (if you just want to use 30% of sdcard as internal storage)
** I found this way when i was googling, this is not a work of mine **
Click to expand...
Click to collapse
i have turned on the usb debugging but when ever i type this in cmd it displays the message -
"adb " is not recognised as internal or external command
i have installed the adb drivers too! help low on storgae
arnavfoxtrot said:
i have turned on the usb debugging but when ever i type this in cmd it displays the message -
"adb " is not recognised as internal or external command
i have installed the adb drivers too! help low on storgae
Click to expand...
Click to collapse
Change folder to where adb.exe is and enter adb.exe instead of adb.
Or, add adb.exe to you path variable (see here http://stackoverflow.com/questions/...u-can-run-it-from-any-command-line-in-windows)
You get that error as adb is not into $PATH so you need to specify it or add it to $PATH.
Sent from my D6503 using Tapatalk

Categories

Resources