Welcome! Log In Create A New Profile

Advanced

how to backup/restore your NAND patitions and full device

Posted by ElMariachi 
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 09:58AM
Thanks.. I was going over this forum and found you saying there is a work a round for bad block in mtd0. I have bad address 0x0. What can I do?

Is it ok to go ahead with "Bad eraseblock 571 at 0x000004760000"

root@new-host-3:/# flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete
root@new-host-3:/# nandwrite /dev/mtd0 uboot.2016.05-tld-1.pogo_v4.mtd0.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000


root@new-host-3:/# fw_printenv
Warning: Bad CRC, using default environment
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
est $nc_ready -eq 1; then run start_netconsole; fi'nv nc_ready 1; fi; done; if t
Warning: Bad CRC, using default environment
root@new-host-3:/# fw_setenv preboot 'run preboot_nc'
root@new-host-3:/# fw_printenv
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
preboot=run preboot_nc
ipaddr=172.27.35.82
serverip=172.27.35.1
root@new-host-3:/#



Edited 3 time(s). Last edit at 09/09/2016 01:34PM by Chuck99.
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 03:57PM
Chuck99 Wrote:
-------------------------------------------------------
> Thanks.. I was going over this forum and found
> you saying there is a work a round for bad block
> in mtd0. I have bad address 0x0. What can I do?
>

When you flash it, post the log and I'll tell you if it went OK. The "work around" is really no trick. Just depending on the NAND space available, and determine that the flashing have successfully skip bad blocks. Even with bad block in 0x0, u-boot image can be flashed, but I have to see it to know if it works. Since you have kwboot, it is OK to try,


> Is it ok to go ahead with "Bad eraseblock 571 at
> 0x000004760000"

Yes.

>
> root@new-host-3:/# flash_erase /dev/mtd0 0 4
> Erasing 128 Kibyte @ 60000 -- 100 % complete
> root@new-host-3:/# nandwrite /dev/mtd0
> uboot.2016.05-tld-1.pogo_v4.mtd0.kwb
> Writing data to block 0 at offset 0x0
> Writing data to block 1 at offset 0x20000
> Writing data to block 2 at offset 0x40000
> Writing data to block 3 at offset 0x60000
>
>

OK. Looks good.

> root@new-host-3:/# fw_printenv
> Warning: Bad CRC, using default environment

You have not flashed the u-boot envs image, so the CRC error is expected when running fw_printenv.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 05:57PM
I think I messed it up. uboot seems ok but I selected boot from sata. I thought it was ok since I want to boot from sata when

done. Is that why it cannot sync. device 0:0? This on my V4-A3. My V4A1 mobile works great!

Is this my problem? ** File not found /boot/uEnv.txt **



Edited 2 time(s). Last edit at 09/09/2016 07:09PM by Chuck99.
Attachments:
open | download - no debian boot.odt (26.2 KB)
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 07:45PM
Chuck,

Please post the entire serial console log. It is OK with the default envs to boot SATA, should be no problem. So it might be problem in how you created the HDD rootfs.


And if you could, use txt file. Sometime people read this forum on portable devices that can't read .odt.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 08:13PM
I was using the SSD on a USB interface. I plugged it into the top HDD slot on the V4-A3 and does not work. It did not work after the boot the original way with USB. It seems the log buffer fills up to fast with gtkterm. I will try. It does boot without kwboot and will stop with PPV4 > prompt.



Edited 1 time(s). Last edit at 09/09/2016 09:31PM by Chuck99.
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 09:43PM
Here is boot log via serial interface. I plugged in the HDD. I see it shows that.
Attachments:
open | download - boot serial log.txt (9.6 KB)
Re: how to backup/restore your NAND patitions and full device
September 09, 2016 10:28PM
Chuck,

1. Some of your u-boot envs are not correct in this box. That's why you have kernel booting probelm. Boot SATA again, and this time, interrupt serial console when it counts down and get the listing of envs

printenv
and then
boot
Please capture serial console log again and post here.


2. Your rootfs still have the goflexnet DTB embedded inside uImage. You need to restore the orignal uImage came with the rootfs tarball in /boot. I've pointed this out before in this tread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 11:14AM
I had to cut and paste to capture it all with Gtkterm. I think it is correct. thanks.
Attachments:
open | download - boot1.txt (15.7 KB)
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 04:02PM
Chuck,

Everything looks good, except this problem I mentioned above

2. Your rootfs still have the goflexnet DTB embedded inside uImage. You need to restore the orignal uImage came with the rootfs tarball in /boot. I've pointed this out before in this tread.

Mount this HDD on another Linux box (assuming it's mounted as /media/sdb1)

cd /media/sdb1/boot
mv uImage uImage.goflexnet
mv uImage.orig uImage
sync

Take this back to the Pogo and boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 06:12PM
That did it! Is there a way to copy the whole NAND from one Pogoplug mobile to another? I still have a problem with one that has a bad address 0x0 in NAND.
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 07:01PM
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 07:21PM
It is booting fine.has one error can not find uEnv.txt on boot. Other problem now is no ssh access.
Re: how to backup/restore your NAND patitions and full device
September 10, 2016 08:51PM
Chuck99 Wrote:
-------------------------------------------------------
> It is booting fine.has one error can not find
> uEnv.txt on boot.

Ignore this. It is not an error, just warning that you are not using uEnv.txt.

> Other problem now is no ssh
> access.

That is the rootfs mounting problem that I showed you how to fix above.

There is a Search button for this forum in the upper right corner. You should use it from time to time.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 13, 2016 03:10PM
I use search a lot. There is tons of stuff in here. I have one mobile that is running Debian. Has some Goflex e2 mixed in but works. I am leaving it alone. I think it needs new DTB for v4. I have decided to start over on v4-a3. It is a mess. Kwboot is ok. What is best way to get ssh working again so I can get the files needed? I only have orig mtd0-mtd2. env is messed up and no network at all. I was very careful and got no errors. I do know a lot of the pitfalls now. Thank you very much for your help.
Re: how to backup/restore your NAND patitions and full device
September 13, 2016 03:38PM
> I think it needs new DTB for v4.

No, there is no need for new DTB. The DTB file we have is OK. Or perhaps I misundersootd what you said?

> I have decided to start over on v4-a3. It is a
> mess. Kwboot is ok. What is best way to get ssh
> working again so I can get the files needed?

If you have a Pogo Mobile running, then just clone that USB rootfs to another drive and use it for another Pogo Mobile or V4.

> env is messed up and no
> network at all.

If you think the envs are mesed up, then use the env text file uboot.2016.05-tld-1.environment that you downloaded (from the tarball uboot.2016.05-tld-1.environment.bodhi.tar) and copy it to the rootfs /boot. Mount the rootfs to another Linux box. Assuming it is mounted as /media/sdb1:

cd /media/sdb1/boot
cp -a uboot.2016.05-tld-1.environment uEnv.txt
sync

When you boot this rootfs with the uEnv.txt in /boot, u-boot will read it first thing and restore the default envs temporarily to boot. Once you are inside Debian, you can flash the default envs image uboot.2016.05-tld-1.environment.img to restore the default envs for real.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 13, 2016 07:24PM
Boots to Debian but can not connect to network. Complete log attrached. I think I did what you asked.

I looked at Dmesg and it still thinks it is a E02 device. Thanks



Edited 2 time(s). Last edit at 09/14/2016 02:25AM by Chuck99.
Attachments:
open | download - 09132016_1520log.txt (19.5 KB)
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 02:33AM
This is why: the uEnv.txt exists in your rootfs /boot folder. So it was read during u-boot booting, and overwrote your existing envs.

loading envs from usb 0 ...
2773 bytes read in 334 ms (7.8 KiB/s)

no IDE devices available
importing envs ...

Boot into Debian and remove it by rename to someting else, and reboot

cd /boot
mv uEnv.txt uEnv.txt.bak
sync
shutdown -r now

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 02:12PM
Problem stll can not find etho. no ssh connection. I just added that uEnv.txt yesterday to boot directory.
Attachments:
open | download - bootlog.txt (23.4 KB)
open | download - fw_printenv.txt (3 KB)
open | download - uboot_printenv_0914.txt (3.3 KB)
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 02:33PM
Is it the cloned rootfs? Ie. untarred from the working one? There are 2 files need adjustment after cloning.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 03:11PM
This is a clone. what two files are they?

I was just looking at dmesg. Is this why network does not work?

[ 23.193952] mv643xx_eth_port mv643xx_eth_port.0 eth1: renamed from eth0

[ 23.285642] systemd-udevd[319]: renamed network interface eth0 to eth1

when it starts up the RJ-45 lights are both on. activity stops when linux loads. only left side light stays on.



Edited 2 time(s). Last edit at 09/14/2016 04:00PM by Chuck99.
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 06:33PM
Now we are talking :) good troubleshooting Chuck. Here is the instruction:

http://forum.doozan.com/read.php?2,25683,25688#msg-25688

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 14, 2016 08:14PM
That fixed it! Thank you so much.
If you have time could you tell me sequence of recovery for V4-A1 I have messed up. Have serial console only. Do not have all original mtd's that I dumped before starting the Debian project. I was able to get Uboot loaded with your Uboot........kwb file so do not need kwboot.



Edited 1 time(s). Last edit at 09/15/2016 11:22PM by Chuck99.
Re: how to backup/restore your NAND patitions and full device
September 16, 2016 01:03AM
> I was able to get Uboot loaded with your
> Uboot........kwb file so do not need kwboot.

Then the only thing you need to do is to clone another rootfs on USB and boot it. If it does not boot, then copy the default envs text file to that rootfs /boot/uEnv.txt like before (to make sure the envs are good during boot).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 16, 2016 01:11AM
Thanks, I will give it a try.
Re: how to backup/restore your NAND patitions and full device
September 16, 2016 11:58PM
I have a question about NAND. I looks like I could dump the whole 128 MB of NAND at one time with Debian nanddump. Could I ext2load that file at a PPV4> prompt with NAND write and put it back in another Pogoplug? Thank you.

I assume that mtdparts is a software partition not hardware.



Edited 2 time(s). Last edit at 09/17/2016 12:47AM by Chuck99.
Re: how to backup/restore your NAND patitions and full device
September 17, 2016 02:47AM
Chuck99 Wrote:
-------------------------------------------------------
> I have a question about NAND. I looks like I could
> dump the whole 128 MB of NAND at one time with
> Debian nanddump. Could I ext2load that file at a
> PPV4> prompt with NAND write and put it back in
> another Pogoplug? Thank you.
>
> I assume that mtdparts is a software partition not
> hardware.

Of course, mtdparts layout are whatever you want it to be. So you can define it temporarily as 1 partition and dump it. However, there are pitfalls:

1. Both NAND space must be free of bad blocks.
2. Enough RAM

With the Pogo V4, there is not enough RAM to do this in serial console. So this must be done in Linux. Therefore there is no point to do it differently from the current procedure that I've already defined.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/17/2016 02:50AM by bodhi.
Re: how to backup/restore your NAND patitions and full device
September 18, 2016 12:06AM
I got my V4-A1 going today. The one with bad NAND 0x0. Took a new one and dumped mtd's via ssh taking your advice. Then put them back via kwb and PPV4> prompt. Config env and booted. Restarted without USB and got a magic number error. So almost got it going stock. Decided to put in Debian USB and it booted after doing what you said removing the 70 and 75 files. Is there a way to fix magic number or is that a checksum without the oob's not being restored?
Re: how to backup/restore your NAND patitions and full device
September 18, 2016 12:33AM
Chuck99 Wrote:
-------------------------------------------------------
> I got my V4-A1 going today. The one with bad NAND
> 0x0. Took a new one and dumped mtd's via ssh
> taking your advice. Then put them back via kwb and
> PPV4> prompt. Config env and booted.

Great!

> Restarted
> without USB and got a magic number error. So
> almost got it going stock. Decided to put in
> Debian USB and it booted after doing what you said
> removing the 70 and 75 files. Is there a way to
> fix magic number or is that a checksum without the
> oob's not being restored?

I cannot be entirely sure about this "magic number" error. I think I know why. But please post the serial log when you see this (the entire log from restart and to the prompt after the "magic number" error).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: how to backup/restore your NAND patitions and full device
September 18, 2016 11:38AM
here it is.
Attachments:
open | download - magicnumber.txt (1.2 KB)
Re: how to backup/restore your NAND patitions and full device
September 18, 2016 03:11PM
Chuck,

Power on without running kwboot. Your mtd0 now has the stock u-boot on it so it should boot that.

Interrupt serial console,
printenv
And post the entire log here (please remember to blank out the cesvcid and MAC address in the log)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 09/18/2016 03:14PM by bodhi.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: