[Q] How to format Internal SD Card? - Android Q&A, Help & Troubleshooting

Hello there. I have a MyPhone A888 (4.0.4) and I was planning to wipe the Internal SD Card. How exactly do I do this? I have not rooted my phone yet also so if anyone can provide a link or tutorial as to how to root this phone, then that would be great. But really, my main question is as to how to format the internal sd card. I am not very sure yet if TWRP or CWM supports my phone since I haven't used them yet. Thanks!

Likach said:
Hello there. I have a MyPhone A888 (4.0.4) and I was planning to wipe the Internal SD Card. How exactly do I do this? I have not rooted my phone yet also so if anyone can provide a link or tutorial as to how to root this phone, then that would be great. But really, my main question is as to how to format the internal sd card. I am not very sure yet if TWRP or CWM supports my phone since I haven't used them yet. Thanks!
Click to expand...
Click to collapse
To wipe all your internal sdcard using adb (see attachment for adb folder), toggle usb debugging mode in your device then connect device to pc by usb cable and go to adb folder and open linux terminal or windows command prompt there (by right-click on any empty space while holding shift button) and enter these commands:
Code:
adb shell
rm -f /mnt/sdcard/*.*
adb kill-server
Make sure to remove your external sd card first, since in android 4.0.4 the external sd card is a part of internal sdcard

majdinj said:
To wipe all your internal sdcard using adb (see attachment for adb folder), toggle usb debugging mode in your device then connect device to pc by usb cable and go to adb folder and open linux terminal or windows command prompt there (by right-click on any empty space while holding shift button) and enter these commands:
Code:
adb shell
rm -f /mnt/sdcard/*.*
adb kill-server
Make sure to remove your external sd card first, since in android 4.0.4 the external sd card is a part of internal sdcard
Click to expand...
Click to collapse
I don't need to be rooted for this right? And I open the adb folder right then open command prompt?

Likach said:
I don't need to be rooted for this right? And I open the adb folder right then open command prompt?
Click to expand...
Click to collapse
Technically no root needed since it is not system partition that you are going to manipulate.
Open adb folder, put mouse cursor on any empty space, hold shift key, and press mouse right-click, choose open command window here and then enter the commands mentioned.

majdinj said:
Technically no root needed since it is not system partition that you are going to manipulate.
Open adb folder, put mouse cursor on any empty space, hold shift key, and press mouse right-click, choose open command window here and then enter the commands mentioned.
Click to expand...
Click to collapse
This is what appears when I do it. Is this what is supposed to show up?
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell
rm -f /mnt/sdcard/*.*
adb [email protected]:/ $ rm -f /mnt/sdcard/*.*
rm failed for -f, No such file or directory
255|[email protected]:/ $

Likach said:
This is what appears when I do it. Is this what is supposed to show up?
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell
rm -f /mnt/sdcard/*.*
adb [email protected]:/ $ rm -f /mnt/sdcard/*.*
rm failed for -f, No such file or directory
255|[email protected]:/ $
Click to expand...
Click to collapse
This message means wrong directory or verbose action.
Try to type this one:
Code:
adb shell "rm -r /mnt/sdcard/*"
If still, then can you check your device in which directory the internal sdcard is on?

majdinj said:
This message means wrong directory or verbose action.
Try to type this one:
Code:
adb shell "rm -r /mnt/sdcard/*"
If still, then can you check your device in which directory the internal sdcard is on?
Click to expand...
Click to collapse
This is what I got:
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell "rm -r /mnt/sdcard
/*"
adb server is out of date. killing...
* daemon started successfully *
rm failed for /mnt/sdcard/*, Permission denied
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>
What is the name of the folder of the Internal SD card? There is a folder here called App2SD. Is that it?

Likach said:
This is what I got:
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell "rm -r /mnt/sdcard
/*"
adb server is out of date. killing...
* daemon started successfully *
rm failed for /mnt/sdcard/*, Permission denied
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>
What is the name of the folder of the Internal SD card? There is a folder here called App2SD. Is that it?
Click to expand...
Click to collapse
Yes, the command now is correct, but you had been welcomed by "Permission denied" message. and since you are not rooted, nor cwm recovery installed (with emmc format function), so you will not be able to do it through these commands, because we will need to have mounting command to overcome the "Permission denied" message.
So what is left to do, is to do it manually (manual deleting by going to sdcard folder and delete what you can delete after showing all hidden folders)

wow this is an old thread hahah thanks for the help from July 2020

Related

[EXPANDSD] Join your external SD with internal SD!

WARN: For developer only.
attachment is the EXPANDSD script.
Why use it?
So many applications use /sdcard for mass data storage(gameloft, navigation...),
but I9100's internal_sd size is limit to 11G, so we need external_sd's space.
But these applications dosen't know how to use external_sd, old method is hack the apk for external_sd, but this will change apk's signature, and need smali/baksmali to work. My method work in system level, don't need change any apk file.
How to use:
1.make expandsd.ownhere dirctory in external_sd root directory.
2.move internal_sd's directory(for example:/gameloft) to expandsd.ownhere
3.run init_expandsd.sh
Theory:
use 'mount --bind' feature, bind external_sd's dir to internal_sd.
Because the sd card using fat32 partition format, the 'ln -s' command does not work, so the "mount --bind" is the only way to dynamically change the directory content.
Hi mate,
Thks for your shares. I have a question. How run init_expandsd.sh?
I tried gscript and init.d, but doesn't seem to be working
woohoo a great dev has come. glad you got here mate! love your work on Desire section.
harrynghiem said:
Hi mate,
Thks for your shares. I have a question. How run init_expandsd.sh?
Click to expand...
Click to collapse
you can try to use terminal emu, just type su then navigate to folder where the script located, then type sh init_expandsd.sh then enter. this might do the trick to execute .sh
dexterdave said:
you can try to use terminal emu, just type su then navigate to folder where the script located, then type sh init_expandsd.sh then enter. this might do the trick to execute .sh
Click to expand...
Click to collapse
Does it work for you?
It's a great idea thanks a lot for your work. I was wondering why ln was not working.
But too bad it does not work for me, i get the following error :
[1] Segmentation fault
Do you have any idea why ?
Thanks again
problems when connecting phone to pc
hi,
tried the "mount --bind" in order to try your script.
works fine. the directory contents is shared between the 2 path's,
but i have a problem when i connect the phone to a pc.
when i try to disconnect, the sdcard and external_sd are not
available anymore until i reboot the phone
note: the commands that i have executed are:
Code:
mkdir /mnt/sdcard/external_sd/foo
echo "test" > /mnt/sdcard/external_sd/foo/test
mkdir /mnt/sdcard/foo
mount --bind /mnt/sdcard/external_sd/foo /mnt/sdcard/foo
Can this script be placed in init.d folder for autorun at boot?
Edit: sorry, already answered above: no, it cannot.
Sent from my GT-P1000 using Tapatalk
Seems abandoned by @ownhere
Sent from my GT-I9100
Idan73 said:
Seems abandoned by @ownhere
Sent from my GT-I9100
Click to expand...
Click to collapse
too bad, it could be very useful..
TheFirstBen said:
It's a great idea thanks a lot for your work. I was wondering why ln was not working.
But too bad it does not work for me, i get the following error :
[1] Segmentation fault
Do you have any idea why ?
Thanks again
Click to expand...
Click to collapse
got the same problem please help
How to use?
ownhere said:
WARN: For developer only.
attachment is the EXPANDSD script.
Why use it?
So many applications use /sdcard for mass data storage(gameloft, navigation...),
but I9100's internal_sd size is limit to 11G, so we need external_sd's space.
But these applications dosen't know how to use external_sd, old method is hack the apk for external_sd, but this will change apk's signature, and need smali/baksmali to work. My method work in system level, don't need change any apk file.
How to use:
1.make expandsd.ownhere dirctory in external_sd root directory.
2.move internal_sd's directory(for example:/gameloft) to expandsd.ownhere
3.run init_expandsd.sh
Theory:
use 'mount --bind' feature, bind external_sd's dir to internal_sd.
Because the sd card using fat32 partition format, the 'ln -s' command does not work, so the "mount --bind" is the only way to dynamically change the directory content.
Click to expand...
Click to collapse
thanks,
this is genius
I'm not using your script (have myself some ux & scripting skills) but did not know about the -bind option on android
Ridiculously simple and efficient
Did it my own way and it works great
Thanks a lot for this
dawabz94 said:
thanks,
this is genius
I'm not using your script (have myself some ux & scripting skills) but did not know about the -bind option on android
Ridiculously simple and efficient
Did it my own way and it works great
Thanks a lot for this
Click to expand...
Click to collapse
Then why not share with us please !
Let us know how you did
Yes I'd like to know another method also.!
Sent from my GT-I9100 using XDA
Chairmansaab said:
Then why not share with us please !
Let us know how you did
Click to expand...
Click to collapse
Hi,
it's very easy indeed, once you got the point.
I do most of my stuff using an "adb shell" session so I'll post here my steps to get it working.
Also I like simple implementation so my script is the strict minimum needed to mount necessary folders
I assume you have a rooted device with working busybox and a kernel that supports /etc/init.d/
I suggest you do the test on a dummy folder before applying on a real folder.
So start by creating a folder called /sdcard/dummy
Do it the way you want , I do it with an "adb shell" session
Code:
cd /sdcard
mkdir dummy
Then copy some files in it (photos for examples)
Code:
cd /sdcard
cd DCIM
cd Camera
cp `ls -1 |tail -5` /sdcard/dummy
From now on, we consider we want to move transparently /sdcard/dummy to the external SD
1. move the folder to the external sd
CAUTION : I'm running a CM9 rom => my external sd is mounted on /mnt/emmc
Standard samsung sdcard mount is /sdcard/external_sd
The path might be different according to your brand and rom
Moving the folder code
Code:
cd /sdcard
mv dummy /mnt/emmc/
2. Create the mount point in the indernal SD
Code:
cd /sdcard
mkdir dummy
3.a Check the mount is successful by manually doing it
Code:
mount --bind /mnt/emmc/dummy /sdcard/dummy
3.b Check you see exactly the same thing on both folders
Both commands should return exactly the same output
Code:
ls -l /sdcard/dummy
Code:
ls -l /mnt/emmc/dummy
If everything is fine, then you're good to go
4. Automate mount at boot time
Create a script in /etc/init.d to automate the mount at boot time
I personally use "vi" but most people prefer graphical UIs, I can't recommend any here, do it your own way
So basically you would go root,remount /system in read/write mode and create the file
Code:
su
mount -o remount,rw /dev/block/mmcblk0p9 /system
cd /etc/init.d
vi 90binds
Insert following lines, save and exit
Note that the "sleep 60" is to let the system boot up before mounting partitions (thanks to the initial script shared here)
Code:
#!/system/bin/sh
sleep 60
mount --bind /mnt/emmc/dummy /sdcard/dummy
Change owner and permissions, flush disk cache and remount /system in read only
Code:
su
mount -o remount,rw /dev/block/mmcblk0p9 /system
cd /etc/init.d
chown root:shell
chmod 6755 90binds
sync
mount -o remount,ro /dev/block/mmcblk0p9 /system
To check, run
Code:
su
cd /etc/init.d
ls -l 90binds
The output should look like this :
Code:
-rwsr-sr-x 1 root shell [I]0 MMM D HH:MM[/I] 90binds
5. Now you can reboot and check - after reboot - that the mount is done
Both commands should return exactly the same output (always ran in an "adb shell" session)
Code:
ls -l /sdcard/dummy
Code:
ls -l /mnt/emmc/dummy
6. Now you're good to move other folders
Basically, you move the folder to external SD
Create the mount point on the internal SD
Append the mount command in the 90binds script
And that's it
Hope this helps
---------- Post added at 11:09 AM ---------- Previous post was at 11:04 AM ----------
benc88 said:
Yes I'd like to know another method also.!
Sent from my GT-I9100 using XDA
Click to expand...
Click to collapse
Just posted
Take time to read and understand the idea

[Q] How to mount internal storage through ADB?

A few days ago I cracked my phone screen and I can't see anything, but I want to access the internal storage, can I do this through ADB command?if possible, HOW?
Please! can someone help me!
Thanks!
alex26aly said:
A few days ago I cracked my phone screen and I can't see anything, but I want to access the internal storage, can I do this through ADB command?if possible, HOW?
Please! can someone help me!
Thanks!
Click to expand...
Click to collapse
1. Connect your device to your pc
2. Open command prompt from Adb folder. (hold shift key, then right click on a blank space, select open command window here)
3. #check if your device is connected via adb by typing in the command window: adb devices
4. #copy all the content of your sdcard by typing in the command window:
adb pull /mnt/sdcard \mysdcard
wait for the process to finish
Check you C: drive for a folder named "mysdcard". all the files and folders in your internal storage will be there.
Good luck
Jokesy said:
1. Connect your device to your pc
2. Open command prompt from Adb folder. (hold shift key, then right click on a blank space, select open command window here)
3. #check if your device is connected via adb by typing in the command window: adb devices
4. #copy all the content of your sdcard by typing in the command window:
adb pull /mnt/sdcard \mysdcard
wait for the process to finish
Check you C: drive for a folder named "mysdcard". all the files and folders in your internal storage will be there.
Good luck
Click to expand...
Click to collapse
It says:
0 files pulled.0 files skipped.
All the files I have are on the internal memory of the SGS2 - I have around 7-8gb that I want to recover
alex26aly said:
It says:
0 files pulled.0 files skipped.
All the files I have are on the internal memory of the SGS2 - I have around 7-8gb that I want to recover
Click to expand...
Click to collapse
is your phone turned on normally or booted to recovery?
Thanks a lot!!
I found a solution
adb pull / - it copied everything from the phone
Now how can I format the memory?? to delete the files from the phone, I found someone that wants the phone
alex26aly said:
Thanks a lot!!
I found a solution
adb pull / - it copied everything from the phone
Now how can I format the memory?? to delete the files from the phone, I found someone that wants the phone
Click to expand...
Click to collapse
type as follows in adb
adb shell
cd /mnt/sdcard
ls
### ls lists all the directories/folders. so it will list all the directory in your internal storage
### you have to delete the folder type the name of each folder in front of this command:
rm -r "folder name"
### repeat the above command for all the folders you wish to delete
### for example, to delete DCIM, then i just type: rm -r dcim
done
Jokesy said:
type as follows in adb
adb shell
cd /mnt/sdcard
ls
### ls lists all the directories/folders. so it will list all the directory in your internal storage
### you have to delete the folder type the name of each folder in front of this command:
rm -r "folder name"
### repeat the above command for all the folders you wish to delete
### for example, to delete DCIM, then i just type: rm -r dcim
done
Click to expand...
Click to collapse
I tried, but I have this problem:
adb shell
~ # cd /mnt/sdcard
cd /mnt/sdcard
/mnt/sdcard # Is
Is
/sbin/sh: Is: not found
/mnt/sdcard #
__________________________________________________
DCIM is here \storage\sdcard0\DCIM
In that folder is now on PC after I used adb pull/ and copied everything from the phone
Sorry, this is the first time I use adb...
alex26aly said:
I tried, but I have this problem:
adb shell
~ # cd /mnt/sdcard
cd /mnt/sdcard
/mnt/sdcard # Is
Is
/sbin/sh: Is: not found
/mnt/sdcard #
__________________________________________________
DCIM is here \storage\sdcard0\DCIM
In that folder is now on PC after I used adb pull/ and copied everything from the phone
Sorry, this is the first time I use adb...
Click to expand...
Click to collapse
Ok. then change /mnt/sdcard to /storage/sdcard0
everything should be fine now.
Can someone please help me!
How to connect my SGS2 into MassStorage mode using adb??
Or how to delete files from the internal memory of the phone???
Thanks!
alex26aly said:
Can someone please help me!
How to connect my SGS2 into MassStorage mode using adb??
Or how to delete files from the internal memory of the phone???
Thanks!
Click to expand...
Click to collapse
did you face any other error?
The only way you can help yourself is by reporting error/success instead of making the person that's helping you look stupid!
Swyped from my Samsung Galaxy SII
Supercharged ParanoidAndroid 2.12
Dorimanx kernel 5.76B
GT I9100
Next phone: Galaxy NOTE II
Jokesy said:
did you face any other error?
The only way you can help yourself is by reporting error/success instead of making the person that's helping you look stupid!
Swyped from my Samsung Galaxy SII
Supercharged ParanoidAndroid 2.12
Dorimanx kernel 5.76B
GT I9100
Next phone: Galaxy NOTE II
Click to expand...
Click to collapse
Sorry!
C:\android-sdk-windows>adb sh
~ # cd /storage/sdcard0
cd /storage/sdcard0
/storage/sdcard0 # Is
Is
/sbin/sh: Is: not found
/storage/sdcard0 # rm -r dcim
rm -r dcim
it didn't give any information about the forder to say if is deleted or not
C:\android-sdk-windows>adb shell
~ # cd /storage/sdcard0
cd /storage/sdcard0
/storage/sdcard0 # rm -r SmartStay
rm -r SmartStay
/storage/sdcard0 # rm -r SmartStay
rm -r SmartStay
rm: can't remove 'SmartStay': No such file or directory
/storage/sdcard0 # rm -r TitaniumBackup
rm -r TitaniumBackup
/storage/sdcard0 # rm -r TitaniumBackup
rm -r TitaniumBackup
rm: can't remove 'TitaniumBackup': No such file or directory - This means it works, the folder has been deleted
/storage/sdcard0 #
Can you confirm that it works, I'm not 100% sure?
alex26aly said:
Sorry!
C:\android-sdk-windows>adb sh
~ # cd /storage/sdcard0
cd /storage/sdcard0
/storage/sdcard0 # Is
Is
/sbin/sh: Is: not found
/storage/sdcard0 # rm -r dcim
rm -r dcim
it didn't give any information about the forder to say if is deleted or not
Click to expand...
Click to collapse
The command to list directory is LS (small cap = ls) not IS.
When you delete a folder using rm -r you can then check if the folder is deleted using ls.
If you don't miss anything everything should be fine now
Swyped from my Samsung Galaxy SII
Supercharged ParanoidAndroid 2.12
Dorimanx kernel 5.76B
GT I9100
Next phone: Galaxy NOTE II
Jokesy said:
The command to list directory is LS (small cap = ls) not IS.
When you delete a folder using rm -r you can then check if the folder is deleted using ls.
If you don't miss anything everything should be fine now
Swyped from my Samsung Galaxy SII
Supercharged ParanoidAndroid 2.12
Dorimanx kernel 5.76B
GT I9100
Next phone: Galaxy NOTE II
Click to expand...
Click to collapse
The command to list directory is LS (small cap = ls) not IS. - I'm such a noob
Thanks a lot!!! works!:good:
if i cant turn on the phone, can i mount the internal storage?
No, you can't. Think about it. What you just asked is illogical.
alex26aly said:
Thanks a lot!!
I found a solution
adb pull / - it copied everything from the phone
Now how can I format the memory?? to delete the files from the phone, I found someone that wants the phone
Click to expand...
Click to collapse
I found this post googling for answers as I'm trying to copy photos off a gs2 that freezes when it boots up. I can boot it into recovery(stock recovery...not rooted everything is bone stock).
I was having the same issue as you and the only thing that works for me is adb pull and the cmd prompt scrolls like its doing something but I have no clue where it pulled the files.
ls with a small L
alex26aly said:
I tried, but I have this problem:
adb shell
~ # cd /mnt/sdcard
cd /mnt/sdcard
/mnt/sdcard # Is
Is
/sbin/sh: Is: not found
/mnt/sdcard #
__________________________________________________
DCIM is here \storage\sdcard0\DCIM
In that folder is now on PC after I used adb pull/ and copied everything from the phone
Sorry, this is the first time I use adb...
Click to expand...
Click to collapse
i know this topic is too much old but for new with this problem , i noticed he wrote "Is" with a big "i"
it should be "ls" with a small "L"
besides i just registrerd to xda , it was a big lost to me i didnt join earlier
Jokesy said:
1. Connect your device to your pc
2. Open command prompt from Adb folder. (hold shift key, then right click on a blank space, select open command window here)
3. #check if your device is connected via adb by typing in the command window: adb devices
4. #copy all the content of your sdcard by typing in the command window:
adb pull /mnt/sdcard \mysdcard
wait for the process to finish
Check you C: drive for a folder named "mysdcard". all the files and folders in your internal storage will be there.
Good luck
Click to expand...
Click to collapse
This works for me : adb pull /sdcard/ mysdcard
euh im a root user and i have delete systems apps on my arnova tablet the rest of apps are settings kingroot and the calculator
i try to install some apps via adb .. fail using apk installer
on now i can not use it please help me i dont know what to do now i cannot use my tablet ....
please help respond me on [email protected] please neeeeed help

[Q] usb connectivity

Hi guys.
I was editing the vold.fstab file using root explorer. When i restarted my phone i got a message "Unfortunately Usb connectivity has stopped working." when i open settings i got message "Unfortunately, Settings has stopped working". I still have my original vold.fstab file left in my sd card but sd card is not working too. I have an Xperia M rooted and unlocked bootloader Please help.
Please tell me if there is a way to reset everything and reinstall the firmware.
Thanks.
Zexter21 said:
Hi guys.
I was editing the vold.fstab file using root explorer. When i restarted my phone i got a message "Unfortunately Usb connectivity has stopped working." when i open settings i got message "Unfortunately, Settings has stopped working". I still have my original vold.fstab file left in my sd card but sd card is not working too. I have an Xperia M rooted and unlocked bootloader Please help.
Please tell me if there is a way to reset everything and reinstall the firmware.
Thanks.
Click to expand...
Click to collapse
You could try to use adb to restore the original vold.fstab to your /system/etc/ folder if your usb debugging is still working:
Code:
adb push vold.fstab /system/etc/vold.fstab
adb shell
su
chmod 755 /system/etc/vold.fstab
exit
adb reboot
If it doesn't work try an other way:
Code:
adb push vold.fstab /data/local/tmp/vold.fstab
adb shell
su
mv /data/local/tmp/vold.fstab /system/etc/vold.fstab
chmod 755 /system/etc/vold.fstab
exit
adb reboot
If any of these ways doesn't work and you have a cwm recovery try to give these commands while you are booted to recovery.
You could also make a flashable zip and you flash it from recovery.
**If you double mounted your sdcard may be corruped and you have to use a partition manager to recreate the partition of your sdcard on PC**
Thanks for the reply.
Well the usb debugging is still working. So i tried the both adb push command, it says "cannot stat 'vold.fstab': no such file or directory" . EDIT: Tried it again, says "failed to copy vold.fstab to '/system/etc/vold.fstab': Read only file system.
I also tried that chmod command but doesn't works, says "cannot chmod system/etc/vold.fstab: Read only file system.".
And about that cwm, i can't get into cwm recovery. I tried all that vol up and down things. I tried using sd card with a card reader, it works fine. Please help.
Thanks in advance.
Zexter21 said:
Thanks for the reply.
Well the usb debugging is still working. So i tried the both adb push command, it says "cannot stat 'vold.fstab': no such file or directory" . EDIT: Tried it again, says "failed to copy vold.fstab to '/system/etc/vold.fstab': Read only file system.
I also tried that chmod command but doesn't works, says "cannot chmod system/etc/vold.fstab: Read only file system.".
And about that cwm, i can't get into cwm recovery. I tried all that vol up and down things. I tried using sd card with a card reader, it works fine. Please help.
Thanks in advance.
Click to expand...
Click to collapse
To apply these changes to system partition you have to make your system partition rewritable.Try to make it rw from Root Explorer or try some adb command:
Code:
adb remount
adb shell
su
mount -o remount,rw /system
If this doesn't work try something like:
mount -o remount,rw -t {your partition type} /dev/block/{your partition name and number} /system
* To see your partition table give the command cat proc/mtd or cat /proc/emmc *
Example:
mount -o remount,rw -t ext3 /dev/block/mmcblk0p25 /system
Then try to push the file in the system (Give the "exit" command to quit the shell before try to push the file).
Gatosbil said:
To apply these changes to system partition you have to make your system partition rewritable.Try to make it rw from Root Explorer or try some adb command:
Code:
adb remount
adb shell
su
mount -o remount,rw /system
If this doesn't work try something like:
mount -o remount,rw -t {your partition type} /dev/block/{your partition name and number} /system
* To see your partition table give the command cat proc/mtd or cat /proc/emmc *
Example:
mount -o remount,rw -t ext3 /dev/block/mmcblk0p25 /system
Then try to push the file in the system (Give the "exit" command to quit the shell before try to push the file).
Click to expand...
Click to collapse
Okay here's what i did.
I pushed the vold.fstab that i backed up before editing. After that i copied the vold.fstab into /system/etc in R/W Mode.
Then i restarted my phone, and finally everything worked fine.
Thanks for the help mate. You've been big help to me. I couldn't have done it without you.
hello i have a problem similar to this.i edit my vold.fstab file on my emdoor em63 tablet and when i rebooted the sdcard didnt work i was switching the internal to external, I tried to push the file with adb but it says device not found adb works fine for everything else but not for my sdcard i can remount, mount, reboot, but i cant push or pull and on the table when i got to settings/apps or settings/storage force close on me what can i do?

ADB push alternative from Android device itself (non-rooted)

I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
idoit said:
I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
Click to expand...
Click to collapse
No there isnt, not if you try using /data partition. ADB can read this partition (and that too was added around android kitkat itself for purpose of adb backup
etc). So ADB can read this partition, but terminal emulator and such cannot.
Assuming that you have a great reason to simply not copy the sh file to user-usable internal memory, /system partition is the one place where you can copy things without actually having root (and even access them with terminal emulator, but not manipulate them), and this isn't that simple either. Rather, the method will be device dependent. For instance, if you have a phone like Nexus phones, simply download stock firmware, open/extract it depending on what format it is (img or tar), add your sh file and repack the firmware, then flash it into the phone. The firmware should be same as your current installed so your applications dont mess up. But this method is not only long (and messy if your device has integrity checks on firmware files), but also not possible on some phones (as far as I know).
You can also try copying the sh file with adb to /data/data/com.android.terminal. Then you should be able to access this with terminal emulator (since an app has permissions inside its own data folder). However I have not tested this method and I am not sure it will work.
Besides this, every app (including terminal emulator) runs in a sandbox and does not have access to anything except /system (read-only access), emulated user-storage and its own data inside /data/data/. So in phone itself, you cannot read the file unless you copy it to /system or user-memory. And this finally implies that except above two methods, there is no other way to copy file to some other place except user-memory and be able to read it using some app inside phone itself without rooting.
Thanks for your comprehensive reply. I resolved the problem. Yes, it's right, I can simply run the shell script without even moving it to /data/local/tmp... so now I can conveniently running it directly from my phone without having to turn a computer on and do it over ADB.
thankx

[Solved] How to adb pull to any other directory than platform-tools?

Hi there,
The device is rooted.
I tried
Code:
adb pull /dev/block/mmcblk0p43 > /users/wenyuan/desktop/android/43.img
(mmcblk0p43 is userdata partition).
But the command was just stuck there and did not produce any results.
Would it be possible to adb pull partition (ex. userdata) to any other location than under platform-tools directory?
Would it be possible to adb pull partition even to an external disk?
Thanks.
-- Solution for internal disk--
The right code:
Code:
adb pull /dev/block/mmcblk0p43 /users/wenyuan/desktop/android/43.img
Remove ">"
do not use ">" in the command
CXZa said:
do not use ">" in the command
Click to expand...
Click to collapse
Thanks. It worked.
But would it be possible to adb pull a partition to an external disk?
I tried
Code:
adb pull /dev/block/mmcblk0p43 /Untitled/wenyuan/43.img
Untitled being the name of the external hard disk.
It did not work.
it works like this. maybe the external hard disk is not ready. also take care of fat32 file system only accept files < 4gb
if "Untitled" contains whitespaces you must quote path
aIecxs said:
it works like this. maybe the external hard disk is not ready. also take care of fat32 file system only accept files < 4gb
if "Untitled" contains whitespaces you must quote path
Click to expand...
Click to collapse
Given that,
1. in
adb pull /dev/block/mmcblk0p43 /users/wenyuan/desktop/android/43.img,
/users is under Macintosh HD; and
2. "Untitled", as an external hard disk, has the same status as Macintosh HD,
there should be some code indicating the location to "Untitied" hard disk, (ex. cd).
I tried
Code:
adb pull /dev/block/mmcblk0p43 cd /untitled/android/43.img
and it did not work.
type 'adb help' for usage
Code:
device commands:
adb push <local>... <remote>
- copy files/dirs to device
adb pull [-a] <remote>... <local>
- copy files/dirs from device
(-a preserves file timestamp and mode)
cd is cmd to change dir (unrelated to adb), don't invent fantasy usage.
btw "it did not work" is no meaningful error message. I am pretty sure the shell replied with something you can google for...
CXZa said:
do not use ">" in the command
Click to expand...
Click to collapse
Am I right in saying that
">" can not be used in "adb pull" but should be used in "adb shell su" and "adb exec-out", in case of pulling partitions? Or in any other circumstances?
Oh no, adb help and google search were no help.
https://bash.cyberciti.biz/guide/Standard_output
https://www.cyberciti.biz/faq/redirecting-stderr-to-stdout
aIecxs said:
https://bash.cyberciti.biz/guide/Standard_output
https://www.cyberciti.biz/faq/redirecting-stderr-to-stdout
Click to expand...
Click to collapse
Thanks for the links.
But I meant adb help and Google search did not help on how to adb pull device partition directly to an external disk.
refer to post #6
there is only one exact usage for adb pull
Code:
adb pull [-a] <remote>... <local>
where <local> is valid path to any directory on PC (whatever it is)
in case the command failed it will output meaningful error message. search for that error message (or post here)
what else do you expect to know?

Categories

Resources