[Q] Internal Memory Recovery -- help please - Verizon Samsung Galaxy S III

Hi,
I have a Verizon Samsung Galaxy S3 SCH-I535.
I have rooted it using this guide. I realize there was probably an easier way to root it, but regardless it worked fine, I have root access.
The phone is returned to factory condition, pretty much, but I need to recover data from it. There is no microSD card.
I have tried to follow this guide for recovering the internal memory without being able to transfer the internal memory to my computer. I'm stuck at the data transfer point.
I've followed the guide to the letter, except I'm trying to recover memory block /dev/block/mmcblk0p23 (and I've also tried simply /dev/block/mmcblk0), so I've modified the commands to the following:
Code:
adb forward tcp:5555 tcp:5555
adb shell
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0p23
And in the other Cygwin terminal:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p23.raw
Screenshots attached. I'm not sure why, but the data stays at 0 B/s no matter how long I let it run.
Am I missing something? Am I doing something wrong? I've installed Busybox on the phone (it's in xbin, not bin, hence the modified syntax). Cygwin (with pv and util-linux), Netcat, and ADB on the computer. USB debugging mode is enabled on the phone (ADB connection works).
I really need to pull the internal data off of this phone soon... can anyone help me get this figured out please? Thanks.

mastercsmc said:
Hi,
I have a Verizon Samsung Galaxy S3 SCH-I535.
I have rooted it using this guide. I realize there was probably an easier way to root it, but regardless it worked fine, I have root access.
The phone is returned to factory condition, pretty much, but I need to recover data from it. There is no microSD card.
I have tried to follow this guide for recovering the internal memory without being able to transfer the internal memory to my computer. I'm stuck at the data transfer point.
I've followed the guide to the letter, except I'm trying to recover memory block /dev/block/mmcblk0p23 (and I've also tried simply /dev/block/mmcblk0), so I've modified the commands to the following:
Code:
adb forward tcp:5555 tcp:5555
adb shell
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0p23
And in the other Cygwin terminal:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p23.raw
Screenshots attached. I'm not sure why, but the data stays at 0 B/s no matter how long I let it run.
Am I missing something? Am I doing something wrong? I've installed Busybox on the phone (it's in xbin, not bin, hence the modified syntax). Cygwin (with pv and util-linux), Netcat, and ADB on the computer. USB debugging mode is enabled on the phone (ADB connection works).
I really need to pull the internal data off of this phone soon... can anyone help me get this figured out please? Thanks.
Click to expand...
Click to collapse
Are you running cygwin as an administrator? Are you requesting superuser access by typing su after adb shell?

billard412 said:
Are you running cygwin as an administrator? Are you requesting superuser access by typing su after adb shell?
Click to expand...
Click to collapse
Hi billard, thank you for the response.
I have tried using su (# prompt instead of $ appears, so yes it is working) after adb shell, with no change in results.
I hadn't tried running Cygwin as administrator, but just made that change as well to see if it would make a difference. Still no dice.
I've also ensured NTFS permissions in the /nexus folder (C:\Cygwin\nexus) are "full access", and there are no issues there, either. Screen shot attached of latest attempt (Cygwin is "run as administrator"/su command used).

mastercsmc said:
Hi billard, thank you for the response.
I have tried using su (# prompt instead of $ appears, so yes it is working) after adb shell, with no change in results.
I hadn't tried running Cygwin as administrator, but just made that change as well to see if it would make a difference. Still no dice.
I've also ensured NTFS permissions in the /nexus folder (C:\Cygwin\nexus) are "full access", and there are no issues there, either. Screen shot attached of latest attempt (Cygwin is "run as administrator"/su command used).
Click to expand...
Click to collapse
Don't know why I didn't catch this sooner. But what lead you to believe it was mmcblk0p23 you needed to use? I'm not sure exactly what that partition is(if it exists) but the data partition is mmcblk0p15 I believe on the US S3's. Try that

billard412 said:
Don't know why I didn't catch this sooner. But what lead you to believe it was mmcblk0p23 you needed to use? I'm not sure exactly what that partition is(if it exists) but the data partition is mmcblk0p15 I believe on the US S3's. Try that
Click to expand...
Click to collapse
I was guessing it was the highest numerical memory block, and /system/dev/block ls lists 23 as the highest number.
I just tried with mmcblk0p15 and have the same exact frustrating 0 B/s indefinite results. -_-

Related

[GUIDE] How to make a nandroid backup directly to your computer without using sdcard

INFORMATION
This guide is intended to make a full backup of your android phone (the entire memory block with all partitions) or a single partition (including sdcards, etc) directly to your computer, in either
Block level (with dd): for single partitions or whole memory block (all partitions in one piece). The backup always has the same size which is the size of the partition.
File level (with tar): only for individual partitions. This only includes files and folders, so occupies much less space, depending on how much filled is the partition.
It can be done with the phone powered on or from ClockWorkMod Recovery (from both ADB works, while in Fastboot doesn't so won't apply). Unless specified the commands meant to be used from Windows. For Linux and Unix is similar.
REQUIREMENTS
Rooted Android Phone
Busybox installed on your phone
If you are using Linux / OS X you have native tools, for Windows download Cygwin, and install with it netcat, pv and util-linux. Get them from Cygwin's setup.exe
ADB installed.
Make sure adb.exe is in your windows' path. See here and here, or use Path Manager.
Android phone with USB Debugging enabled, and the proper drivers installed on Windows so the phone is recognized. Typing 'adb devices' on a terminal should show your device.
PARTITION IDENTIFICATION
You now have to identify the partition or block device that you want to backup. For a single partition you can use either tar or dd, while for the entire memory block you can only use dd.
For example, on Galaxy Nexus you have the list of partitions here and for Galaxy S2 here.
Usually on android, the entire block containing all partitions is located at /dev/block/mmcblk0 and the data partitions is a subpartition of it. You can push parted with GPT support to your device and see all information on a partition or block.
Whole phone memory -> /dev/block/mmcblk0 (may vary, in some phones this is the sdcard)
Subpartitions -> depends on each device. Usually at /dev/block/platform/dw_mmc/by-name/ there are listed by name linking to the real device.
Back up of the whole memory block (via adb)
Connect the phone in ADB mode and unlock the screen.
Open one Cygwin Terminal and enter (replace mmcblk0 if needed):
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition.
With further linux tools you could edit or extract single partitions from the whole block.
You can use adb via wifi as well with applications like WiFi ADB.
Back up of the whole memory block (via wifi)
Original post: [Q] Nandroid directly to computer w/o sdcard
We need to install a FTP server on the computer or the other device, configure a user with a password if we want to, and set some port. It uses by default 21 but this example uses 40. We must set a home dir for the user with write permissions.
Usually is a good idea to put myfifo in /cache not in /data because we may overwrite sensitive data in case we want to use that raw image for data recovery.
Open one Cygwin terminal
Code:
adb shell
su
mkfifo /cache/myfifo
ftpput -v -u user -p pass -P 40 COMPUTER_IP block.raw /cache/myfifo
Open another Cygwin terminal
Code:
adb shell
su
dd if=/dev/block/mmcblk0p12 of=/cache/myfifo
Tips:
- Fifos only can be made on linux native filesystems, for example on a FAT partition is not possible.
- Reading from a partition does not modify it.
Now check on Filezilla Server the speed
Back up of the whole memory block (USB tethering, Wifi tethering)
To use tethering you have to disconnect the computer from all networks and connect it only to the phone with the type of connection you want.
Once you connect it, you can view the IP of the computer and the IP of the phone from connection properties. The ip is the computer ip and the gateway is the phone's ip.
Wifi Tethering: Computer <---Wifi---> Phone <---3G---> Internet
USB Tethering:
Computer <---USB---> Phone <---Wifi---> Internet
Conputer <---USB---> Phone <---3G---> Internet
This is exactly the same as via wifi, except that the transfer speed is much higher because the computer and the phone are directly connected, instead of using a router as a gateway. In this case, the gateway is the phone. USB tethering has the highest transfer rate.
Back up of a single partition (raw = every bit of the partition)
It is exactly the same as the the previous but replacing mmcblk0 by the corresponding partition. You can use in this particular case several software to read the partition from windows, depending on partition filesystem: DiskInternals Linux Reader, Ext2Read, Ext2 File System Driver for Windows, Ext4Explore, plugin for Total Commander and ImDisk Virtual Disk Driver. You can also use recovery software on individual partitions like Recuva in combination with VHD Tool or command line tools included with operating systems.
Back up of a single partition (tar = only files and folders)
In this case, you need the partition mounted. To see the list of mounted partitions type on Cygwin Terminal
Code:
adb shell mount
Now you need to know where is mounted the partition you want to backup, for example the firmware is mounted on /system, which is the ROM.
In this case you will have to open three terminals, because of android limitations:
Open one Cygwin terminal and create a fifo, in /cache, for example, and redirect the tar there
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox mkfifo /cache/myfifo
/system/xbin/busybox tar -cvf /cache/myfifo /system
We have to do it this way because redirecting the tar to stdout (with - ) is broken on android and will corrupt the tar file.
Open a second Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox cat /cache/myfifo
Open a third Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > system.tar
You can browse the tar file with Winrar, Total Commander, PeaZip and almost any compression tool. Note that you shouldn't extract files or edit it since the tar format saves the permission and owner data for each file, that is lost when extracted to FAT / NTFS partitions and you will mess things when restoring.
LINKS
[GUIDE] Internal Memory Data Recovery - Yes We Can!
How to Create and Attach a Virtual Hard Disk in Windows 7
[Guide] Types of Android backups
mohsyn said:
On newer android versions (Im on 7.2) data folder has a folder media which is link to sdcard and one ends up backing up entire sd card. I had a 64gb backup which wasn't necessary
In order to avoid skipping the media folder i had to do some trial and error because busybox tar command is not completely the same as GNU tar.
Would appreciate if you can mention it in the mail guide to use the following command to backup /data folder without copying sdcard files
In first terminal
tar cv --exclude data/media/0 -f /cache/myfifo /data
in 3rd terminal
nc 127.0.0.1 5555 | pv -i 0.5 > data.tar
no change in second terminal
Cheers
Click to expand...
Click to collapse
Umm...how to restore back from computer?
Sent from MARVEL
I am a little new to this, I have installed Android sdk and i am able to see my device by using "adb devices" , i have also installed Cygwin, now i want to backup whole phone memory block so i tried executing the first line on cygin "adb forward tcp:5555 tcp:5555" i get an error saying -bash: adb :command not found.
I am sorry if i am missing any thing, please guide me, and also what do you mean by "download Cygwin, and install with it netcat, pv and util-linux"
Thanx a ton !!
aunriz said:
I am a little new to this, I have installed Android sdk and i am able to see my device by using "adb devices" , i have also installed Cygwin, now i want to backup whole phone memory block so i tried executing the first line on cygin "adb forward tcp:5555 tcp:5555" i get an error saying -bash: adb :command not found.
I am sorry if i am missing any thing, please guide me, and also what do you mean by "download Cygwin, and install with it netcat, pv and util-linux"
Thanx a ton !!
Click to expand...
Click to collapse
You've done almost everything! But you skipped the section "make sure adb is in your path"
Probably you have adb.exe in the path
Code:
C:\Program Files (x86)\android-sdk\platform-tools\adb.exe
So you have to just add it to the Cygwin's path (would be better if you had added it earlier to the windows' path and cygwin will import it automatically but it is ok)
Code:
export PATH="/cygdrive/c/Program Files (x86)/android-sdk/platform-tools":$PATH
Remember to backup the path previously if you want.
Code:
echo $PATH > mypathbackup.txt
scandiun said:
You've done almost everything! But you skipped the section "make sure adb is in your path"
Probably you have adb.exe in the path
Code:
C:\Program Files (x86)\android-sdk\platform-tools\adb.exe
So you have to just add it to the Cygwin's path (would be better if you had added it earlier to the windows' path and cygwin will import it automatically but it is ok)
Code:
export PATH="/cygdrive/c/Program Files (x86)/android-sdk/platform-tools":$PATH
Remember to backup the path previously if you want.
Code:
echo $PATH > mypathbackup.txt
Click to expand...
Click to collapse
Thanks for replying but i cant seem to run the 3rd line , see this
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ adb shell
$ /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
reloc_library[1311]: 10182 cannot locate 'android_reboot'...
CANNOT LINK EXECUTABLE
i hav sucessfully installed busybox v1.14.3, i am not sure what is causing the problem
EDIT:
i found that my directory ws system/bin instead of xbin
so i changed it and first part worked correctly, now i cant seem to get the second part
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ cd c:/
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
-bash: nc: command not found
-bash: pv: command not found
aunriz said:
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
-bash: nc: command not found
-bash: pv: command not found
Click to expand...
Click to collapse
You don't have installed pv and netcat on cygwin. Run the setup.exe and install them.
If you run
Code:
whereis pv
whereis nc
should give you some path (in cygwin) but applies similar inside android.
scandiun said:
You don't have installed pv and netcat on cygwin. Run the setup.exe and install them.
If you run
Code:
whereis pv
whereis nc
should give you some path (in cygwin) but applies similar inside android.
Click to expand...
Click to collapse
Now i hav installed cv and nc and commands run sucessfully, but i get the raw file as just 1kb
First terminal:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
adb shell
[email protected] ~
$ adb shell
$ /system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0
$
second terminal:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ cd c:/
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
55 B 0:00:00 [10.7kiB/s] [<=> ]
[email protected]
No idea what you may be doing wrong
Listen, I appreciate the guide, and it being basically the only one which popped up in google results, I can't gripe too much, but... you really, really need to make it more clear.
The point of a guide is to help a large group of people with varying degrees of knowledge (and if it's a guide targeted at a specific group of people, i.e tech savvy, then it needs to be indicated as such).
With that working definition in place, it follows that you should be as specific as possible; think of *everything*. By doing so, you not only avoid headaches for the people reading the guide, but for yourself as well since you don't have to reply to comments which might've otherwise been avoided.
I would post a question, but I'll probably have figured this out (with a good 1+ hours of searching no doubt) before anyone responds.
Here are some examples of what could be more specific:
"ADB installed." - what is ADB? Where's the link? It's not reasonable to assume people use these tools on a regular basis or remember them.
"You can push parted with GPT support to your device and see all information on a partition or block." - okay, so we know what it does but not how to install it or use it.
"ADB mode" - is this important? What is it? Not sure because it was glossed over.
These are just some examples. It's not the most horrendous trespass ever committed, but definitely annoying. Just spell it out from one step to the next, it works far better than topics with subheadings and unintuitive concepts being assumed as general knowledge on the behalf of noobs like me.
Edit: I'm just going to take everything off my SD card, use nandroid, and then copy the nandroid backup to computer as well. Please improve the guide, thanks.
Greatly appreciate this!
For me, a long-time UNIX and Linux administrator, this little guide was a breath of fresh air. Scandiun, *Thank You* for putting it together. It makes perfect sense to me -- just treat the phone as the linux machine it is. I'm becoming convinced that most of the more recent "developers" hanging around the android community have never used a linux machine before -- they don't seem to know what's going on, they go way out of their way to write overkill tools to do things clumsily that can already be done cleanly and quickly from the command line, and then they wrap those tools in so much mystery, black magic, and script-kiddie terminology that I can't figure out what they do either, and I certainly don't trust them doing things to my phone.
For example, I've got a new Galaxy S3, and just wasted a whole day digging around on xda, reviewing all of the "kewl rooting mods" until I got sick of it. Why the *heck* are people flashing entire partitions just to install a setuid /system/xbin/su on these devices? The rooting method I wound up using was dirt simple -- just find an rc exploit and use it to install an 'su' binary, by typing a few commands via adb. I used a variation of the exploit mentioned in http://seclists.org/fulldisclosure/2012/Aug/171, and elaborated in http://forum.xda-developers.com/showthread.php?t=1790104, http://forum.xda-developers.com/showthread.php?t=1792342, http://galaxys3root.com/galaxy-s3-root/how-to-root-u-s-canadian-dual-core-galaxy-s3-on-mac-osx/, and http://forum.xda-developers.com/showthread.php?t=1827518. If you are a UNIX person, you'll recognize what's going on with that exploit and be able to come up with something that suits your own needs. If you aren't a UNIX person, then you'll be completely lost. Sorta like this guide.
For anyone who doesn't yet know what adb is, or who's never used standard UNIX/Linux tools like dd, netcat, gparted, or busybox, I agree that this guide is not only not going to help you, but may actually aid you in shooting yourself in the foot with extreme efficiency. But please don't criticize or nag the OP in return for helpful advice freely given. You won't learn much about UNIX tools on an Android-related web site in any case. I recommend starting with a Linux systems administration book -- the Nemeth series is always good. But if you do take that route, you need to expect to take time to learn the basics.
Absolutely beautiful!
Thank you for this work. I was able to recover deleted files from my Galaxy Nexus' internal memory using this technique. I made a [GUIDE] using most of what you accomplished here: http://forum.xda-developers.com/showthread.php?p=34185439
Thank you, thank you, thank you! It can't be said enough. I had family photos that I would not have been able to reproduce. Much love to you and yours!
:good: :highfive: :victory:
so did anyone dare to restore the drive (all of storage, everything !)? without bricking the thing ?
mai77 said:
so did anyone dare to restore the drive? w.o bricking the thing ?
Click to expand...
Click to collapse
What drive? A partition?
scandiun said:
If you are using Linux / OS X you have native tools, for Windows download Cygwin, and install with it netcat, pv and util-linux. Get them from Cygwin's setup.exe
Click to expand...
Click to collapse
netcat is obsolete (mark to even find it) install net / nc instead
---------- Post added at 01:03 PM ---------- Previous post was at 01:03 PM ----------
scandiun said:
What drive? A partition?
Click to expand...
Click to collapse
all of storage I mean. the full monty ...
----------------------
parted seems to not work fully with Samsung galaxy Y = SGY proprietary rfs filesystem
on SGY mmcblk0 gives you the sd card, not internal storage with android.
backing up my sd card was a thing I could even do before I read this (lol)
mai77 said:
netcat is obsolete (mark to even find it) install net / nc instead
Click to expand...
Click to collapse
nc is an abbreviation for netcat. On Cygwin, you choose to install either, but for the original, written by the *Hobbit*, that allows direct execution of commands with -e and -t, you have to uncheck "Hide obsolete packages" on Cygwin's setup.exe.
The two of them are here:
Netcat 1.10 (netcat.traditional): http://www.netgull.com/cygwin/release-legacy/netcat/
Netcat 1.107 (netcat.openbsd): http://www.netgull.com/cygwin/release/nc/
mai77 said:
parted seems to not work fully with Samsung galaxy Y = SGY proprietary rfs filesystem
on SGY mmcblk0 gives you the sd card, not internal storage with android.
backing up my sd card was a thing I could even do before I read this (lol)
Click to expand...
Click to collapse
Can you post where is your whole memory block then or even the PIT file for that phone? You have an example here:
[Info] List of Samsung Galaxy S2 GT-I9100 devices and partitions
scandiun said:
Can you post where is your whole memory block then or even the PIT file for that phone? You have an example here:
[Info] List of Samsung Galaxy S2 GT-I9100 devices and partitions
Click to expand...
Click to collapse
I don't know where the "whole memory block" is or what it is. is it internal storage = NAND ?
here is the pit file:
mai77 said:
I don't know where the "whole memory block" is or what it is. is it internal storage = NAND ?
Click to expand...
Click to collapse
Yes it is the NAND. See your pit analysis here:
[INFO] Samsung Galaxy Y GT-S5360 PIT File Analysis
OK
scandiun said:
Yes it is the NAND. See your pit analysis here:
[INFO] Samsung Galaxy Y GT-S5360 PIT File Analysis
Click to expand...
Click to collapse
very interesting tool.
but how do I backup NAND in one piece on SGY ?
mmcblk0 = sd card
???blk0 = NAND
it must be somewhere ...
mai77 said:
but how do I backup NAND in one piece on SGY ?
mmcblk0 = sd card
???blk0 = NAND
it must be somewhere ...
Click to expand...
Click to collapse
Is almost sure that is under /dev/block. Please post the output of
Code:
ls -lR /dev/block

New root metod for NEW version : Sprint US 7.7.1Q-6_SPR-125_ASA-14

This is a work metod for root your not unlocked phone !
I find a solution after update to last new version
Download this : http://forum.xda-developers.com/showthread.php?t=2143437
After download and share fail with samba windows or mac sharing, you need to mount from file manage > remote storage
After fix permission go to adb folder and type :
"adb shell"
"cd /mnt/rfs0"
"./su"
"cd /"
"ln -s /mnt /storage"
Next step go to console and type :
adb kill-server
adb shell /storage/rfs0/pwn
Next : Install apk package from phone , Reboot Phone and now your phone is rooted!
Update from Play Market SuperSu and go.
Best regards,
m.
micron said:
This is a work metod for root your not unlocked phone !
I find a solution after update to last new version
Download this : http://forum.xda-developers.com/showthread.php?t=2143437
After download and share fail with samba windows or mac sharing, you need to mount from file manage > remote storage
After fix permission go to adb folder and type :
"adb shell"
"cd /mnt/rfs0"
"./su"
"cd /"
"ln -s /mnt /storage"
Next step go to console and type :
adb kill-server
adb shell /storage/rfs0/pwn
Next : Install apk package from phone , Reboot Phone and now your phone is rooted!
Update from Play Market SuperSu and go.
Best regards,
m.
Click to expand...
Click to collapse
lol if i saw this earlier i might not have unlocked my boot loader today. =) hope someone can try this
I gave this a try earlier today. I scoured through the forum to find that the new Ubuntu doesn't install ADB drivers by default, so you need to do this manually.
Anyway, I attempted to do it and got all the way to ./su. It then prompted me with the message "./su cannot execute - Permission denied". Obviously from there I can't link /mnt to /storage and I can't run pwn because it looks for the /storage folder.
If you have any suggestions how to get ./su running, let me know.
rykin said:
I gave this a try earlier today. I scoured through the forum to find that the new Ubuntu doesn't install ADB drivers by default, so you need to do this manually.
Anyway, I attempted to do it and got all the way to ./su. It then prompted me with the message "./su cannot execute - Permission denied". Obviously from there I can't link /mnt to /storage and I can't run pwn because it looks for the /storage folder.
If you have any suggestions how to get ./su running, let me know.
Click to expand...
Click to collapse
This method works but not all intructions are here.
First, you need to change permissions of su:
chown root:root su
chmod 6755 su
then run adb shell and remount / filesystem ro rw:
mount -o rw,remount /
now you can create symbolic link and run the exploit.
You can also perform rooting manually (without creating symlink and running pwn):
remount /system partition to rw: mount -o rw,remount /system
and copy su to /system/xbin, make sure that it has correct permissions (rwsr-sr-x) and that's it.
Now you can remount partitions back to ro.
Install supersu or superuser (whatever makes you happy, just check if it works correctly, superuser didn't work for me, it didn't prompt about root permission for any app, it just gave it, no matter how configured it was), Then install busybox, if you need one.
And you're done.
YES! Glad I waited!
Sent from my XT897 using xda premium
ujoty said:
This method works but not all intructions are here.
First, you need to change permissions of su:
chown root:root su
chmod 6755 su
then run adb shell and remount / filesystem ro rw:
mount -o rw,remount /
now you can create symbolic link and run the exploit.
You can also perform rooting manually (without creating symlink and running pwn):
remount /system partition to rw: mount -o rw,remount /system
and copy su to /system/xbin, make sure that it has correct permissions (rwsr-sr-x) and that's it.
Now you can remount partitions back to ro.
Install supersu or superuser (whatever makes you happy, just check if it works correctly, superuser didn't work for me, it didn't prompt about root permission for any app, it just gave it, no matter how configured it was), Then install busybox, if you need one.
And you're done.
Click to expand...
Click to collapse
Thank you. I just tried this and it worked. Confirmed with Root Checker. :>
micron said:
This is a work metod for root your not unlocked phone !
I find a solution after update to last new version
Download this : http://forum.xda-developers.com/showthread.php?t=2143437
After download and share fail with samba windows or mac sharing, you need to mount from file manage > remote storage
After fix permission go to adb folder and type :
"adb shell"
"cd /mnt/rfs0"
"./su"
"cd /"
"ln -s /mnt /storage"
Next step go to console and type :
adb kill-server
adb shell /storage/rfs0/pwn
Next : Install apk package from phone , Reboot Phone and now your phone is rooted!
Update from Play Market SuperSu and go.
Best regards,
m.
Click to expand...
Click to collapse
Thanks, I think this is exactly what I am looking for per this thread. Unfortunately, I don't quite have the knowledge (yet) to completely understand what you mean. I've rooted several phones, but never had to use ADB before so am unfamiliar with it. Also, what do you mean by this: "After download and share fail with samba windows..."?
cscotti said:
Thanks, I think this is exactly what I am looking for per this thread. Unfortunately, I don't quite have the knowledge (yet) to completely understand what you mean. I've rooted several phones, but never had to use ADB before so am unfamiliar with it. Also, what do you mean by this: "After download and share fail with samba windows..."?
Click to expand...
Click to collapse
By reading this link you will know hot to setup samba installation on a UBUNTU live cd. After doing that on your phone you should go to your FILE MANAGER --> remote storage and add the samba share to your phone. On the UBUNTU live cd, on your samba folder you should do this:
Code:
cd /path/to/share
wget http://vulnfactory.org/public/motoshare.tgz
tar xvf motoshare.tgz
sudo chown root:root pwn
sudo chmod 6755 pwn
After that you should put your phone in USB debugging mode and connect it to your PC. On your PC your should download the platform-tools folder of the Android SDK. The platform-tools folder contains adb (MAC) adb.exe (Windows) file. After you have adb, on your WIndows/MAC PC you should type:
Code:
./adb shell
cd /mnt/rfs0
./su
mount -o rw,remount /
cd /
ln -s /mnt /storage
exit (to exit the ADB shell)
adb kill-server
adb shell /storage/rfs0/pwn
Next you should copy eu.chainfire.supersu.apk on your phone storage and install it with file manager.
Reboot your device! Congratulations, your phone is rooted
desyncron said:
By reading this link you will know hot to setup samba installation on a UBUNTU live cd. After doing that on your phone you should go to your FILE MANAGER --> remote storage and add the samba share to your phone. On the UBUNTU live cd, on your samba folder you should do this:
Code:
cd /path/to/share
wget http://vulnfactory.org/public/motoshare.tgz
tar xvf motoshare.tgz
sudo chown root:root pwn
sudo chmod 6755 pwn
After that you should put your phone in USB debugging mode and connect it to your PC. On your PC your should download the platform-tools folder of the Android SDK. The platform-tools folder contains adb (MAC) adb.exe (Windows) file. After you have adb, on your WIndows/MAC PC you should type:
Code:
./adb shell
cd /mnt/rfs0
./su
mount -o rw,remount /
cd /
ln -s /mnt /storage
exit (to exit the ADB shell)
adb kill-server
adb shell /storage/rfs0/pwn
Next you should copy eu.chainfire.supersu.apk on your phone storage and install it with file manager.
Reboot your device! Congratulations, your phone is rooted
Click to expand...
Click to collapse
Wow, thanks for this. I was considering trying to condense down the instructions myself before I did this, but you beat me to it, and did a better job than I would have, considering I'm a novice at this stuff.
So your method uses a linux boot for samba, but then the rest is done on windows. Question: could you do the adb stuff on Linux? Seemed like some of the posts in the atrix threads were doing it that way, and I was just curious. I have mint 14-64 bit on a couple of my machines, as well windows, and was thinking this would be an opportunity to learn it a little better.
Sent from my XT897 using xda premium
Hello,
and what if I have unlocked bootloader? Is there any other way to root this phone?
desyncron said:
By reading this link you will know hot to setup samba installation on a UBUNTU live cd. After doing that on your phone you should go to your FILE MANAGER --> remote storage and add the samba share to your phone. On the UBUNTU live cd, on your samba folder you should do this:
Code:
cd /path/to/share
wget http://vulnfactory.org/public/motoshare.tgz
tar xvf motoshare.tgz
sudo chown root:root pwn
sudo chmod 6755 pwn
After that you should put your phone in USB debugging mode and connect it to your PC. On your PC your should download the platform-tools folder of the Android SDK. The platform-tools folder contains adb (MAC) adb.exe (Windows) file. After you have adb, on your WIndows/MAC PC you should type:
Code:
./adb shell
cd /mnt/rfs0
./su
mount -o rw,remount /
cd /
ln -s /mnt /storage
exit (to exit the ADB shell)
adb kill-server
adb shell /storage/rfs0/pwn
Next you should copy eu.chainfire.supersu.apk on your phone storage and install it with file manager.
Reboot your device! Congratulations, your phone is rooted
Click to expand...
Click to collapse
well that sounds a bit intimidating but thanks for spelling it out. I'll try to work up the nerve and make some time to give this a try.
Just curious, but why can't this be compressed into a one click batch file like before?
vangelm said:
Hello,
and what if I have unlocked bootloader? Is there any other way to root this phone?
Click to expand...
Click to collapse
If your bootloader is unlocked, you can easily root. You don't need any exploits etc.
Install TWRP, it will automatically root the device. Or, install CWM and then install SuperSU afterwards, which will root the device.
arrrghhh said:
If your bootloader is unlocked, you can easily root. You don't need any exploits etc.
Install TWRP, it will automatically root the device. Or, install CWM and then install SuperSU afterwards, which will root the device.
Click to expand...
Click to collapse
It works, thank you, have a nice day.
vangelm said:
It works, thank you, have a nice day.
Click to expand...
Click to collapse
Can you share what you did? Instructions seem to say that I need to install GooManager? The summary of GooManager says I need root to use it. TIA.
micron said:
This is a work metod for root your not unlocked phone !
I find a solution after update to last new version
Download this : http://forum.xda-developers.com/showthread.php?t=2143437
After download and share fail with samba windows or mac sharing, you need to mount from file manage > remote storage
After fix permission go to adb folder and type :
"adb shell"
"cd /mnt/rfs0"
"./su"
"cd /"
"ln -s /mnt /storage"
Next step go to console and type :
adb kill-server
adb shell /storage/rfs0/pwn
Next : Install apk package from phone , Reboot Phone and now your phone is rooted!
Update from Play Market SuperSu and go.
Best regards,
m.
Click to expand...
Click to collapse
**** I wish I saw this before i went to Motorola for my warranty voiding unlock code
---------- Post added at 05:01 PM ---------- Previous post was at 04:50 PM ----------
arrrghhh said:
If your bootloader is unlocked, you can easily root. You don't need any exploits etc.
Install TWRP, it will automatically root the device. Or, install CWM and then install SuperSU afterwards, which will root the device.
Click to expand...
Click to collapse
I like TWRP but CWM in my opinion is better (more supported).
amateurhack said:
Question: could you do the adb stuff on Linux? Seemed like some of the posts in the atrix threads were doing it that way, and I was just curious. I have mint 14-64 bit on a couple of my machines, as well windows, and was thinking this would be an opportunity to learn it a little better.
Sent from my XT897 using xda premium
Click to expand...
Click to collapse
Yes. This can be done in Linux. I did it entirely with a LIVE USB. However, adb might not be installed by default (on mine it was not). To install it, do the following:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
Click to expand...
Click to collapse
This will prevent you from running into errors when you start typing: adb shell
swintec said:
Can you share what you did? Instructions seem to say that I need to install GooManager? The summary of GooManager says I need root to use it. TIA.
Click to expand...
Click to collapse
Either use GooManager or the fastboot flash method. I think you do need to be rooted in order for GooManager to get the permissions it requires to flash recovery... So in that case, the only way initially to flash might be fastboot flash... Sorry.
alexwoellhaf said:
I like TWRP but CWM in my opinion is better (more supported).
Click to expand...
Click to collapse
Not even sure what this means. Any zip you can flash with CWM, you should be able to flash with TWRP. No?
They're both recoveries. One is touch-based, one isn't.
Having trouble with abd
Im running Ubuntu 12.04 full install (not live CD)
When I connect my phone, dmesg see the new device, and so does lsusb
dmesg
Code:
[ 290.617377] usb 2-1: USB disconnect, device number 2
[ 295.476023] usb 2-1: new high-speed USB device number 4 using ehci_hcd
[ 295.611624] scsi9 : usb-storage 2-1:1.0
[ 296.610626] scsi 9:0:0:0: Direct-Access motorola XT897 0001 PQ: 0 ANSI: 2
[ 296.611152] sd 9:0:0:0: Attached scsi generic sg3 type 0
[ 296.613548] sd 9:0:0:0: [sdc] Attached SCSI removable disk
lsusb:
Code:
Bus 002 Device 004: ID 22b8:2e36 Motorola PCS
However no matter what, when I run "adb devices", the phone does not show up.
51-android.rules
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
This is what I get with adb
Code:
[email protected]:/tmp/share# adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
[email protected]:/tmp/share#
What else can I do???
desyncron said:
By reading this link you will know hot to setup samba installation on a UBUNTU live cd. After doing that on your phone you should go to your FILE MANAGER --> remote storage and add the samba share to your phone. On the UBUNTU live cd, on your samba folder you should do this:
Code:
cd /path/to/share
wget http://vulnfactory.org/public/motoshare.tgz
tar xvf motoshare.tgz
sudo chown root:root pwn
sudo chmod 6755 pwn
After that you should put your phone in USB debugging mode and connect it to your PC. On your PC your should download the platform-tools folder of the Android SDK. The platform-tools folder contains adb (MAC) adb.exe (Windows) file. After you have adb, on your WIndows/MAC PC you should type:
Code:
./adb shell
cd /mnt/rfs0
./su
mount -o rw,remount /
cd /
ln -s /mnt /storage
exit (to exit the ADB shell)
adb kill-server
adb shell /storage/rfs0/pwn
Next you should copy eu.chainfire.supersu.apk on your phone storage and install it with file manager.
Reboot your device! Congratulations, your phone is rooted
Click to expand...
Click to collapse
I am trying to run through these steps. For starters, when I enter the 'adp shell' I do not have a /mnt/rfs0 directory. The shared samba directory actually mounts at /storage/rfs0. No biggie. I go to that directory to run ./su. The su command runs, and I can see a pop up notification on my phone indicating the adb shell has been granted admin rights. The problem is that the ./su command never returns. As a matter of fact, if I just left it sit there, I get the admin rights pop up notification on my phone about once per minute so it seems like the su command is in some loop.
At this point I am stuck. I cant remount my file system as read/write without SU. I can run the ./su command in a different process, either in another adb shell or with the ./su& command but that does me no good as I cant execute any root commands in that same process.
Is there something that needs to change with the su command for the newer version my phone is running? I am running 9.8.2Q-122_XT897_FFW-5.
Thanks.
Use 'motochopper', search for it on xda then root is just one click away
Sent from my XT897 using xda app-developers app

Backup your EFS-partition using tar and dd

This guide has been made with and for the i9505, but will most likely also work on other Galaxy S4-models.
Please be extra careful on models other than i9505 as the 'mmcblkXpXX' partition numbers might differ on your device. How to check this is written in the procedure.
As I could not find a procedure in this forum yet, I have made one myself.
Of course all of the below is 'USE AT YOUR OWN RISK'.
Requirements before you start
Install KIES software (and included driver) and connected your S4 atleast once (to see if it works)
Have ADB-executable available. It can be found in the ADT Bundle from Google. There are also much smaller packages with ADB-only which will work. I might create one myself later on and attach it to this thread..
Device is rooted and has busybox-installed (default with motochopper root method). Applications with a similar name in Play Store will allow you to install busybox manually.
Enable developer mode, go to Settings - More - Device-info - Tap 7 times on 'Build number' to unlock 'Developer options' in the previous screen. Then go to 'Developer options' and thick 'USB debugging'
Connect USB cable to your computer and smartphone with 'USB debugging' enabled
Preparations for both backup methods
Now open a ADB-shell, in Windows this would be: 'cmd' in Start-menu (or CTRL+R).
Change the directory to the ADT directory: sdk\platform-tools. In my case:
Code:
cd C:\Android\sdk\platform-tools
Then start the shell using adb:
Code:
adb shell
If you get the error:
'error: device offline'
Then, check your device and allow USB debugging for the presented device. Now try again the command 'adb shell'
If all goes well, you will see the following:
[email protected]:/ $
Now switch to root-user:
Code:
su -
It is possible that the phone now asks you to permit or deny root access. Of course, please permit.
When the switch succeeds, the '$' changes to '#', but you can also verify it by the id-command:
Code:
[email protected]:/ # id
id
uid=0(root) gid=0(root) context=u:r:shell:s0
If it shows root, all is fine.
Then, check with the following command if /efs is available and mounted:
Code:
mount | grep efs
It should show something like:
Code:
mount | grep efs
/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 rw,seclabel,nosuid,nodev,no
atime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,errors=panic
,data=ordered 0 0
Backup method using TAR
NOTE: In case you left the ADB shell, please return to it using command 'adb shell' and switch to root again via 'su -' as described above.
Run the folowing command to backup the whole efs-partition (all the files available on the system):
Code:
tar -cvf /data/media/0/efs.tar /efs
Your output will look like this:
Code:
[email protected]:/ # tar -cvf /data/media/0/efs.tar /efs
tar -cvf /data/media/0/efs.tar /efs
tar: removing leading '/' from member names
efs/
efs/imei/
efs/imei/mps_code.dat
efs/wifi/
efs/wifi/.mac.info
efs/FactoryApp/
efs/FactoryApp/test_nv
efs/FactoryApp/hist_nv
efs/FactoryApp/fdata
efs/FactoryApp/serial_no
efs/FactoryApp/factorymode
efs/FactoryApp/keystr
efs/FactoryApp/hw_ver
efs/FactoryApp/baro_delta
efs/FactoryApp/prepay
efs/FactoryApp/earjack_count
efs/FactoryApp/batt_cable_count
efs/bluetooth/
efs/bluetooth/bt_addr
efs/gyro_cal_data
efs/00000000.authtokcont
efs/carrier/
efs/carrier/HiddenMenu
efs/drm/
efs/drm/widevine/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/D3qpp0bxmJhbiZwIsCbXJ1434rc_
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/RXFABDUxyT6Q+Zwx9ZhPGOq2Bq8_
efs/drm/playready/
efs/drm/playready/00004.PRV
efs/drm/playready/playready0.dat
efs/drm/playready/playready1.dat
efs/drm/playready/playready.hds
efs/wv.keys
efs/log/
efs/log/boot_cause
efs/.files/
efs/.files/.dx1/
efs/.files/.dm33/
efs/.files/.mp301/
efs/ss_data
efs/h2k.dat
efs/hw_offset
This will add all files in /efs to the tar archive located on your internal memory as 'efs.tar'.
Now, the permissions of this tar are incorrect (for this location) so we have to correct them:
Change owner and group:
Code:
chown media_rw:media_rw /data/media/0/efs.tar
And the file permissions:
Code:
chmod 664 /data/media/0/efs.tar
Now, your tar-backup is ready and can be copied via MTP towards your computer or you can use adb to copy it over. First type 'exit' twice to exit the adb shell. CTRL+C is an alternative to leave the 'adb shell'.
Code:
adb pull /mnt/shell/emulated/0/efs.tar .
This will copy the efs.tar to your current directory, which is in my case C:\Android\sdk\platform-tools. You can also replace the last . with the directory where you would like to put the file in.
Backup method using 'dd'
NOTE: In case you left the ADB shell, please return to it using command 'adb shell' and switch to root again via 'su -' as described above.
From the output of the earlier executed command 'mount | grep efs', you can get the path of the EFS partition. It start with '/dev/block/..' is the part which you can use to find the original partition on your device.
As you can see, in my case this is, and I do not expect it to be any different on your device:
/dev/block/platform/msm_sdcc.1/by-name/efs
To check which 'mmcblk' partition it is, we should check out this link:
Code:
ls -al /dev/block/platform/msm_sdcc.1/by-name/efs
This will show you the mmcblk which is the EFS-partition:
Code:
ls -al /dev/block/platform/msm_sdcc.1/by-name/efs
lrwxrwxrwx root root 1970-01-05 23:39 efs -> /dev/block/mmcblk0p10
As you can see, the actual partition in my case is:
Code:
/dev/block/mmcblk0p10
I expect that this is the same for all i9505-devices, but it's better safe to check it. On i9500-devices this might be a different number as they have a different partition-layout, that's why we're checking this. It is very important to save this location, also for future restores.
Now, to backup the partition using dd, run the following command, please make sure that the part directly after 'if=' is the partition you found using the 'ls -l' command. In my case '/dev/block/mmcblk0p10':
Code:
dd if=/dev/block/mmcblk0p10 of=/data/media/0/efs.img
When it finishes, it will show you something like:
Code:
27904+0 records in
27904+0 records out
14286848 bytes transferred in 1.195 secs (11955521 bytes/sec)
This command reads the efs-partition, byte-by-byte to your internal memory, which you can transfer later on to your PC using ADB or MTP.
As the file created is owned by root:root and doesn't have the default permissions used for files at this location, it can be corrected with the following 2 commands:
Change owner and group:
Code:
chown media_rw:media_rw /data/media/0/efs.img
And the file permissions:
Code:
chmod 664 /data/media/0/efs.img
Now, your DD-backup is ready and can be copied via MTP towards your computer or you can use adb to copy it over. First type 'exit' twice to exit the adb shell. CTRL+C is an alternative to leave the 'adb shell'.
Code:
adb pull /mnt/shell/emulated/0/efs.img .
This will copy the efs.img to your current directory, which is in my case C:\Android\sdk\platform-tools. You can also replace the last . with the directory where you would like to put the file in.
To restore the files
Now to restore the files, in case there is really a need to, like imei-number ****up or something with the MAC-address of your wifi, or whatever.. the following commands can be used:
Of course, once again. USE AT YOUR OWN RISK!!!! Do not use this if not really necessary, as there are risks involved in doing this.
To restore the tar-backup, open 'adb shell' and switch to root using 'su -'. Now, first switch to the root directory, which is most likely not needed, but just to make sure the files will be extracted to the right location:
Code:
cd /
Before executing the next command, I assume that you have the efs.tar file in the root-directory of your internal SD-card.
Now, extract the tar file:
Code:
tar -xvf /data/media/0/efs.tar
This will extract the efs.tar file back to it's original location. It will show you something like:
Code:
[email protected]:/ # tar -xvf /data/media/0/efs.tar
tar -xvf /data/media/0/efs.tar
efs/
efs/imei/
efs/imei/mps_code.dat
efs/wifi/
efs/wifi/.mac.info
efs/FactoryApp/
efs/FactoryApp/test_nv
efs/FactoryApp/hist_nv
efs/FactoryApp/fdata
efs/FactoryApp/serial_no
efs/FactoryApp/factorymode
efs/FactoryApp/keystr
efs/FactoryApp/hw_ver
efs/FactoryApp/baro_delta
efs/FactoryApp/prepay
efs/FactoryApp/earjack_count
efs/FactoryApp/batt_cable_count
efs/bluetooth/
efs/bluetooth/bt_addr
efs/gyro_cal_data
efs/00000000.authtokcont
efs/carrier/
efs/carrier/HiddenMenu
efs/drm/
efs/drm/widevine/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/D3qpp0bxmJhbiZwIsCbXJ1434rc_
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/RXFABDUxyT6Q+Zwx9ZhPGOq2Bq8_
efs/drm/playready/
efs/drm/playready/00004.PRV
efs/drm/playready/playready0.dat
efs/drm/playready/playready1.dat
efs/drm/playready/playready.hds
efs/wv.keys
efs/log/
efs/log/boot_cause
efs/.files/
efs/.files/.dx1/
efs/.files/.dm33/
efs/.files/.mp301/
efs/ss_data
efs/h2k.dat
efs/hw_offset
Then reboot your phone normally and see if it works again as you would expect.
If you restored the TAR-backup succesfully, you do not need to restore the dd-image. But in case your tar did not work or your /efs is not mounted due to corruption (in recovery) you can try the dd-recovery instead.
PLEASE BE AWARE THAT YOU SHOULD BE SURE ABOUT THE LOCATION OF THE EFS-PARTITION. THIS LOCATION WAS FOUND USING the 'ls -al /dev/block/platform/msm_sdcc.1/by-name/efs'-COMMAND EARLIER DESCRIBED. If you do not know this location, there's a risk you are overwriting other partitions (MODEM, SYSTEM, RECOVERY, ETC).
If you are sure about the original location, /dev/block/mmcblk......, then use this path just straight after 'of='. On my device the partition is /dev/block/mmcblk0p10.
Code:
dd if=/data/media/0/efs.img of=/dev/block/mmcblk0p10
Output will be similar to:
Code:
27904+0 records in
27904+0 records out
14286848 bytes transferred in 1.195 secs (11955521 bytes/sec)
This will read the efs.img and put it back in the original location.
NOTE 1: This thread gives you two options of backupping the EFS-partition. It is preferred to do both, better safe than sorry.
NOTE 2: Luckily, I have never had to restore any of the backups myself (not on this phone and not on earlier phones). This means that I was never able to test the restores, which counts for the most of us.
NOTE 3: DO NOT RESTORE unless you are really sure this will solve your issue. This will never resolve any lag or other problems with your rom.
NOTE 4: It is normal that the DD-file is much larger (10MB in size) as it also copies unused space and other meta-data of the partition.
NOTE 5: USE AT YOUR OWN RISK! Although the backup part is nearly riskless.
Note X: Feel free to thank me for this post.
Reservation for second post, just in case.
Isn't rooting and using rootexplorer to zip de efs folder to external SD card and just copying that with a microSD cabel way easier?
johan81 said:
Isn't rooting and using rootexplorer to zip de efs folder to external SD card and just copying that with a microSD cabel way easier?
Click to expand...
Click to collapse
Yes, zipping is easier but you will lose your permissions (owner and file permissions (changed via chown/chmod)) so it is actually not a good backup. The permissions/ownerships are backupped with the tar- and dd-backup.
The dd-file includes more than just the file; it also contains the partition meta-data, in case your filesystem got corrupted and it is not possible to recovery it.
Good job man.
EFS Professional v2.0.35 is now support S4. You can also use this:
http://forum.xda-developers.com/showthread.php?t=1308546
shaq1907 said:
EFS Professional v2.0.35 is now support S4. You can also use this:
http://forum.xda-developers.com/showthread.php?t=1308546
Click to expand...
Click to collapse
dont seem to work crashes out while backing up
working now with new update
anybody knows how to adb read the the entire partition table of the galaxy s4?

[GUIDE] How to mount ext4 formatted MicroSD card on Android 4.2.2 Phone/Tablet.

Why?
MicroSD cards are traditionally formatted using ExFAT filesystem. The trouble is that while universally compatible, ExFAT is rather primitive filesystem prone to data loss, and poor speed. Linux ext4 on the contrary is highly reliable and very fast.
Trouble is that, and I quote, "Android supports devices with external storage, which is defined to be a case-insensitive and permissionless filesystem." (see http://source.android.com/devices/tech/storage/)
Well that pretty much narrows it down to dumb stuff like ExFAT.
Note: As of JB (Android 4.1) default umask is 077, which means that files created by apps on the ext4 formatted SD card will only be readable by the same apps, unless you manually update permissions. See this thread for more: http://forum.xda-developers.com/showthread.php?t=889471&page=5​
The good news is that Android has Linux at its core, which naturally supports ext4, and actually all of the internal storage is (or will be in near future) formatted this way. The design limitation mentioned above is somewhat artificial and is enforced by
restricted functionality of funky little daemon, called vold. The sole purpose of vold is not monitor external storage,
detect filesystem on it, mount it as specified in /etc/vold.fstab (or vold.xxx in Android 4.3), and then report to the Volume Manager.Volume Manager in turn notifies the MTP application, and all other apps, displays icons and handles rest of user-visible stuff.
Stock Android vold only supports ExFAT/vfat filesystem. It has been improved in Cyanogenmod to support ext4 and NTFS filesystems, but for those of us stuck with OEM Android this goodness in unavailable. In my experience simply re-building vold from CM as part of AOSP,
while yields an executable, this executable results in a boot loop for an unclear reason.
All hope lost seemingly, yet there is a silver lining.
Silver Lining?
If MicroSD card is mounted manually in the way that vold can see it, re-running vold will properly report it to the Volume Manager and it will be recognized and utilized by apps.
In theory this is easy to accomplish on any rooted device, in practice there are a number of obstacles:
On a locked device, it is not possible to update init script to run the commands at system bootup.
Since Android 4.2, mount propagation no longer work (as described here http://forum.xda-developers.com/showthread.php?p=36889027),
so if sdcard is mounted in terminal, vold will still not see it. Hence the mount operation has to be done in adb.
Furthermore in Android 4.2.2, running adb on localhost is broken as a result of it loosing its private key.
See here https://code.google.com/p/android/issues/detail?id=48126 for more.
The solution?
Pre-requisites:
Rooted device (don't have to be unlocked) with USB debugging enabled.
MicroSD card formatted as ext4 (inserted)
Terminal app, such as Android Terminal Emulator https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en
Familiarity with adb.
Step 1 - Fix adb localhost.
Open terminal and type the commands:
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
start adbd
HOME=/sdcard adb start-server
adb connect localhost
adb -s localhost:5555 shell
exit
stop adbd
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
Step 2 - Install scripts.
Please note that the script msd2.sh has to be modified if your device uses different partition names.
To get list of partition names available run command:
Code:
adb shell cat /proc/partitions
There are 3 (very simple) scripts:
sd.sh is just a convenience so that you don't have to type su everytime.
It calls msd1.sh which takes care of starting localhost adb in a reliable way.
It then executes msd2.sh in adb shell, which actually does the mounting trickery.
To install scripts, download the zip file below, open terminal, unzip the archive and change into msd directory.
Then connect your phone to your PC and run the following commands:
Code:
adb push sd.sh /sdcard/sd.sh
adb push msd1.sh /sdcard/msd1.sh
adb push msd2.sh /sdcard/msd2.sh
adb shell
su
mount -o rw,remount /system
cp sd.sh /system/xbin/
cp msd1.sh /system/xbin/
cp msd2.sh /system/xbin/
chmod 755 /system/xbin/*.sh
mount -o ro,remount /system
exit
exit
Step 3 - Profit.
In terminal app run command:
Code:
sd.sh
There will be some messages in notifications bar and then you will be asked if it is ok to restart MTP application. Click Ok.
That should be it.
Note that this last command will have to be executed every time device reboots (see obstacle #1).
You can automate it using Script Manager app from marketplace. In this case, ask Script Manager to run msd1.sh instead, marking it as Root script.
Disclaimers
I've developed and tested this procedure on Samsung Galaxy S4 Active phone from ATT.
Should work for any other Android 4.2 device.
The steps outlined are non-destructive if done properly and should not affect any other functionality, yet obviously I do not assume any responsibility for you damaging your device in the process.
It is a good idea to read the linked articles before performing the procedure, to get a better understanding of what is actually going on.
Motorola Droid 4 (xt894)
Hello!
if you have a Motorola Droid 4 you need to change the third row in "msd2.sh" from
"mount -t ext4 /dev/block/mmcblk1p1 /storage/extSdCard && sleep 5 && /system/bin/vold" to
"mount -t ext4 /dev/block/mmcblk0p1 /storage/sdcard1 && sleep 5 && /system/bin/vold"
in order to get it to work, thanks for the guide!
Best Regards
/ Rasmus
It works well on TW based MIUI
It works well on TW based MIUI, so many many thanks!!!
But I still have the permission problems mentioned.
AOSP based MIUI is ext4 compatibile out of the box, and without permission problems.
This trick is amazing, but the permission issue make it useless ...
I can not shot a picture and than have to manually change the permission of tehf ile in order to view it on the gallery ...
Is there a definititive solution?
My lg l3 e400..sd card not mounted
to sashavasco:
sir, pls help configuring my phone...the codes u've given at the top part seems to work accordingly..but after when i entered the command
"cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys"
it says: "no such file or directory"
can you point out the problem of the device plss...
i appriciate your response..
my phone s LG L3 E400..CYANOGENMOD 9..external sd wont mount on my device
sashavasko said:
Why?
Step 1 - Fix adb localhost.
Open terminal and type the commands:
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
start adbd
HOME=/sdcard adb start-server
adb connect localhost
adb -s localhost:5555 shell
exit
stop adbd
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
Click to expand...
Click to collapse
I am getting an error here: adb -s localhost:5555 shell stating device offline. I've done this 6 times now, and it's always the same error
Galaxy S4 i337 NC1 Rooted
kevp75 said:
I am getting an error here: adb -s localhost:5555 shell stating device offline. I've done this 6 times now, and it's always the same error
Galaxy S4 i337 NC1 Rooted
Click to expand...
Click to collapse
the same for me...
same error "unable to connect to local host:5555"
rooted Asus memo-7 build ME173X_US_user_4.2.404152_20140714 release-keys. But thanks for the heads up on Cyanogenmod.
>>If MicroSD card is mounted manually in the way that vold can see it, re-running vold will properly report it to the Volume Manager and it will be recognized and utilized by apps.
Re-running vold crashes it ("Segmentation fault") if sdcard is already mounted in ext4. If not, it restarts gracefully.
Stock android 4.4.2. AFAIK, vold must inform userspace stuff that sdcard is available, without it, android do not see any sdcard at all...
What can be done here?
p.s. Is there anywhere patched or recompiled vold which supports ext4?
Gigionaytor said:
the same for me...
Click to expand...
Click to collapse
same here too. Please help.
ZeroBubble said:
same here too. Please help.
Click to expand...
Click to collapse
Same error!
I had to modify terminal commands a bit to allow me to connect properly. Only moving the "start adbd" command down because the key needed to be appended to "adb_keys" before starting the service back up.
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
HOME=/sdcard adb start-server
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
adb connect localhost
adb -s localhost:5555 shell
exit
I'm also still dealing with the "msd1.sh" script execution consistently asking about my fingerprint and not remembering it. If I don't press "continue" quick enough it claims the resource is busy, which prompted me to also change the msd1.sh script sleep from 2 to 5. I have gotten the notification that msd2.sh has been elevated, which seems like it ran, but my partition still doesn't get mounted, even though I've got the right one from the /proc/partitions output.
Another note, because I had BusyBox installed, I needed to prepend "busybox" (no quotes) to the mount command in the msd2.sh or else that wouldn't work either.
Anyone have thoughts?
I followed DemisesAngel suggestion. There was no error this time but nothing happens when running any of the 3 scripts. I tried mmcblk1 and mmcblk1p1, also changed microsd path to match, /MicroSD, but nothing works. Even with manual ext4 mount command ...
Clicking mount in settings still results in incompatible storage and file explorer shows no sdcard.
Edit: Set permissions, script will run but nothing mounts unsupported file system ...
Error directory already exist
I folllow the steps but i.think I meaaes up.
When u run through DemiseAngel scripts
At:
car /sdcard/.android/adbkey.pub >> /
Error:tmp-mkish:cant create /:Is a directory
To I attempt to find and rm it, or would that mess something up
Rca RCT677W22
I dont know if this thread is closed but I have one simple question, can I somehow partition sdcard and have a little space for music and other stuff, and to use ext4 partition alongside with this, lets say "visible" partition ( I mean on windows).
WrathBand said:
I dont know if this thread is closed but I have one simple question, can I somehow partition sdcard and have a little space for music and other stuff, and to use ext4 partition alongside with this, lets say "visible" partition ( I mean on windows).
Click to expand...
Click to collapse
First, I have been able to create a formatted partition of less than the full size of an SD card. I did this because my Android seems to have issues with anything larger than 16GB and all I had lying around was a 64GB. I did not try to do anything with the remaining space. Maybe it could work, maybe not. I would have my doubts.
Second, thanks for this discussion. Here is what "kind of" works on my Android 5.1 TV computer:
su -mm -c mount -t ext4 -o noatime /dev/block/mmcblk0p1 /storage/sdcard1 && sleep 5 && /system/bin/vold
chown -R root:sdcard_r /storage/sdcard1
chmod 771 /storage/sdcard1
I say "kind of" because this is still not seen as a true, external storage card by Android or file manager apps (and the like). However, all apps can read/write/traverse the folder tree and do what they need to. You do NOT have to be root except to do this. As things stand for me now, I have to re-issue this upon every re-start of Android. But using Tasker makes this pretty easy to accomplish.
long as a problem remains so do this thread ! . Well i am on 7.x and wonder if the op would post a method or even approach for getting a
Code:
ext4
partitioned sdcard so that vold is well aware of that and will mount sdcardfs on that giving all apps access to the partitions. I have 3 of these on my card .
Is there a method to auto mount ext4 partition on external SD that works on lineageOS 17.1 on S4 i9506?

How do I adb pull root directories (like "/system"?) to my Windows PC??

Hi there, I'm trying to pull root directories like /system and /data without any luck. My purpose it to have them on my PC as a backup, and be able to browse them to pull out apps and pieces of data as necessary if it ever becomes necessary.
Device: Nexus 6P (North American version)
ROM: Stock 6.0.1 Rooted, using Wugfresh Nexus Root Toolkit and SuperSU
PC OS: Windows 7 PC (64 bit)
Adb is working properly and I can easily pull non-root directories like "/sdcard" and so on. I'd like to be able to backup the entire root directory ("/") or at least the child directories (like "/system" and "/data", etc.) Unfortunately, when I try
Code:
adb pull -p "/system" "C:\somewhere"
it skips a bunch of files, so I need to come up with a better method.
I've tried
Code:
adb root
and it tells me it's already running in root mode.
I try
Code:
adb remount
and it does this properly, but doesn't change the effects of all the commands I've tried.
When I run
Code:
adb shell
it enters shell and gives me # by default, so seemingly it is giving me su permission by default?
*** Oddly, when I enter "su" while in shell, it tells me "/sbin/sh: su: not found" which seems odd to me. I think it's possibly that SuperSU is installed as systemless root, or there's something else screwy here, so I guess I'm not sure how to proceed. Still, if that were case, why would adb already be running as root, and why would shell automatically give me the #?
Any help is appreciated!!
Thanks!

Categories

Resources