Help Please - nanddump goes on forever

Baruch Siach baruch at tkos.co.il
Fri Mar 15 07:47:31 UTC 2013


Hi Steven,

On Thu, Mar 14, 2013 at 07:55:30PM -0700, Steven Hickel wrote:
> Hi, I'm new to this list and to such lists in general, so I apologize
> if I break decorum in some way. I have a specific situation I'm hoping
> someone can shed some light on. I'm making a nanddump of the userdata
> partition on a nexus one with the below commands using two Cygwin
> terminals. But, when I do this, the nanddump seems to go on forever. I
> ended up stopping it at over 8 GB written. I believe the entire
> internal storage is only something like 512 MB. The form of the below
> commands seemed to work for creating nanddumps of the other phone
> partitions. But, it's the userdata partition I'm really looking to get
> so as to potentially recover some important deleted files. Also, note
> that I have removed the external sd card so that there's no
> possibility I'm copying from that.
> 
> Cygwin Terminal 1
> ---------------------------
> adb forward tcp:5555 tcp:5555
> adb shell
> su
> # nanddump [options] /dev/mtd/mtd5 | nc -l -p 5555
> -------------------------------
> 
> 
> Cygwin terminal 2
> -----------------------------
> 
> nc 127.0.0.1 5555 > /nexus/mtd5_userdata.img
> ------------------------------
> 
> This approach is similar to this, but with nanddump instead of dd:
> http://forum.xda-developers.com/showthread.php?t=1994705
> 
> In case it's of use, the proc/mtd file shows the following
> 
> mtd0: 000e0000 00020000 "misc"
> mtd1: 00400000 00020000 "recovery"
> mtd2: 00380000 00020000 "boot"
> mtd3: 09100000 00020000 "system"
> mtd4: 05f00000 00020000 "cache"
> mtd5: 0c440000 00020000 "userdata"
> 
> Also, the df command in adb shell, brings up the following:
> 
> Filesystem             Size   Used   Free   Blksize
> /dev                    192M    32K   192M     4096
> /mnt/asec           192M     0K    192M     4096
> /mnt/obb             192M     0K    192M     4096
> /system              145M    131M    13M    4096
> /data                   196M    80M   116M     4096
> /cache                 95M     1M      93M      4096
> 
> I hope someone can help, so I can get this image and be able to start
> using the phone again. Thank you.

Have you tried running nanddump alone, something like

    nanddump /dev/mtd/mtd5 > /dev/null

Also, having the output of strace on nanddump run might give us a clue.

If you can rebuild busybox for your platform please try doing so with the 
patch below applied, and post its output.

diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index e3f9b56..0d69e4e 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -138,6 +138,8 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
 		if (length < meminfo.size - mtdoffset)
 			end_addr = mtdoffset + length;
 	}
+	fprintf(stderr, "%s: size: %x end_addr: %x\n", __func__, meminfo.size,
+		end_addr);
 
 	/* Pull it into a CPU register (hopefully) - smaller code that way */
 	meminfo_writesize = meminfo.writesize;
@@ -176,6 +178,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
 		int input_fd = IS_NANDWRITE ? STDIN_FILENO : fd;
 		int output_fd = IS_NANDWRITE ? fd : STDOUT_FILENO;
 
+		fprintf(stderr, "%s: mtdoffset %x\n", __func__, mtdoffset);
 		blockstart = mtdoffset & ~(meminfo.erasesize - 1);
 		if (blockstart == mtdoffset) {
 			/* starting a new eraseblock */

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the busybox mailing list