New IT forum
13 August 2022, 12:29:24 pm *
Welcome, %1$s. Please login or register.

: PiHub now in stock.
 
Pages: [1] 2 3

Author Topic: Backing up nand system  (Read 27312 times)

truehl

  • Jr. Member
  • **
  • Posts: 58
Backing up nand system
« on: 20 December 2009, 01:54:05 pm »

Hi,
first of all I want to thank the people from newIT. Very good support an very friendly, tanks.

And now to my questions:
1. How can I make a backup of the system from the nand (UBIFS) to a sd-card?
2. I want the System to boot from the SD-card by default. Only if there is no card inserted, than the system shall boot from the nand. As systems I want to use debian on the SD-card. (I know how to build it)
3. Best the system boots first from sd-card, second from a usb-stick an third form the nand.

I'm no linux expert so it would be nice if you would answer for "dummys".

Thanks a lot,
Greetings, thomas
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #1 on: 20 December 2009, 04:47:31 pm »

Hi,
first of all I want to thank the people from newIT. Very good support an very friendly, tanks.

And now to my questions:
1. How can I make a backup of the system from the nand (UBIFS) to a sd-card?
2. I want the System to boot from the SD-card by default. Only if there is no card inserted, than the system shall boot from the nand. As systems I want to use debian on the SD-card. (I know how to build it)
3. Best the system boots first from sd-card, second from a usb-stick an third form the nand.

I'm no linux expert so it would be nice if you would answer for "dummys".

Thanks a lot,
Greetings, thomas

(1) and (2). See here. The only thing I'm not certain of is whether there are issues of synchronisation between different files, and whether there are any files that may not be copied from an active root filesystem. But I've seen the same command detailed elsewhere, so I'd guess it's a practical method:

In addition, regarding point (2), see our forum thread detailing suitable U-Boot environment variables for multi-booting. We haven't tested booting from USB stick, but the principle can be extended to incorporate USB booting. If you need more information, or clarification, let us know.



Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #2 on: 20 December 2009, 07:05:14 pm »

Hi Marcus,
thanks a lot for your very quick answer on a sunday!!!


I read the link in your post an found the following:
 
"Changes for Alpha6 Beta
this tutorial doesn't quite work out of the box for the Alpha6 system. Namely, the printenv bootargs will not work, and will say variable not found. Instead you can see ... "

Is this section is relevant for me??? Or do I use only the first section???

Thanks a lot!!!

Greetings Thomas
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #3 on: 20 December 2009, 07:18:12 pm »

Alpha6 is the original version of the installer. Your proposed procedure doesn't involve use of the installer; you can change the environment variables to your needs and follow the instructions for partitioning and placing a file system on the SD card without having to use it.

Read both links before you make any changes. You should be able to apply our multi-boot environment variable changes in just a few minutes. That would give you (1) SD boot and (2) NAND boot if there is no SD card. Once you get that working, you can start work on copying the file system to SD card. Once you've got that working and bootable, you can proceed to the USB element. You should have a good idea about how it all fits together by the time you get to that stage.
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #4 on: 21 December 2009, 10:07:46 pm »

Hi Marcus, today I got my Plug, thanks for shipping!!!

I used the documentation to backup the nand to a sd-card. So far everythins works fine. Till the part

Marvell>> printenv bootargs
## Error: "bootargs" not defined
Marvell>>

What shall I do to boot from the sd-card?

Thanks a lot!!!

Greetings Thomas
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #5 on: 22 December 2009, 07:01:42 am »

Hi Marcus,
additionaly I did the following:

Changes for Alpha6 Beta
This tutorial doesn't quite work out of the box for the Alpha6 system. Namely, the printenv bootargs will not work, and will say variable not found. Instead you can see:

 printenv bootargs_root
 bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
it seems to work for me if you change this bootargs_root variable to be the following:

 setenv bootargs_root root=b301

that also don't work!

I've cecked wether the system is on the sd-card, it is! so the only thing is: How to boot from sd-card?
Greetings,
Thomas
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #6 on: 22 December 2009, 09:36:44 am »

You could try applying the environment variables that we have listed for our multi-boot configuration. All our configurations are detailed here: http://www.newit.co.uk/forum/index.php/board,9.0.html
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #7 on: 22 December 2009, 01:09:33 pm »

Hi Marcus,
thanks again for answering. Sorry, but I'm totaly confused in setting up the Plug the right way. Therefore I'll try it once more:

Yesterday I got a new Plug from you as an replancement for an other one that had a problem with the sd-card reader.

It's an Multi-Boot System NAND= Ubunti, UBIFS, Boot Seq = SD then NAND

The sd-card reader from the new one works well I think. Before doing any other things I want to backup the nand to an sd-card.

1. I used the dokumentation you told me: http://www.plugcomputer.org/plugwiki/index.php/SD_Card_As_Root_File_System. So far everythink word fine, I have the system on the sd-card. Only booting the sd-card doesen't work. From the fact my systems is setup as multiboot I thought it should work out of the box?!

2. I would like to install a debian System on a second card like this: http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html. I haven't try it right now, but I'm affraid that it don't work because of the changes iof the environment variables. "Finally, start the installer: setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
bootm 0x400000 0x0800000".

Sorry but I'm not able to understand all the suffisticated stuff around the u-boot environment. Is there a straight foreward solution? Greetings, Thomas
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #8 on: 22 December 2009, 06:39:06 pm »

Hi Marcus,
thanks again for answering. Sorry, but I'm totaly confused in setting up the Plug the right way. Therefore I'll try it once more:

Yesterday I got a new Plug from you as an replancement for an other one that had a problem with the sd-card reader.

It's an Multi-Boot System NAND= Ubunti, UBIFS, Boot Seq = SD then NAND

The sd-card reader from the new one works well I think. Before doing any other things I want to backup the nand to an sd-card.

1. I used the dokumentation you told me: http://www.plugcomputer.org/plugwiki/index.php/SD_Card_As_Root_File_System. So far everythink word fine, I have the system on the sd-card. Only booting the sd-card doesen't work. From the fact my systems is setup as multiboot I thought it should work out of the box?!

You should be able to boot from the SD card that we supplied. If "booting the sd-card doesen't work", please tell us exactly what happens instead - copy & paste your U-Boot environment variables and the U-Boot log so we can take a look at it. (What operating system was supplied on the SD card - Ubuntu?).

The part of the documentation that I wanted you to refer to was ONLY the part about copying files from NAND to SD card, not the complete preparation of an SD card. You are using a fresh SD card for the data backup, right, not the one we supplied with the O/S?

Backing up / copying the contents of the NAND drive to the SD card will not prepare the file system on the SD card in a way that is suitable for booting. The partitioning and locations of a number of files is important.

2. I would like to install a debian System on a second card like this: http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html. I haven't try it right now, but I'm affraid that it don't work because of the changes iof the environment variables. "Finally, start the installer: setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
bootm 0x400000 0x0800000".

Sorry but I'm not able to understand all the suffisticated stuff around the u-boot environment. Is there a straight foreward solution? Greetings, Thomas

If the environment variables are different, it may not be so easy to prepare a multi-boot environment, i.e. if U-Boot tries to load Ubuntu from in one way but debian in a different way. I never managed to get debian working from the instructions at cyrius.com. So I'm not clear on the implications of trying to use the method described there alongside our method. You could create a debian SD card the same way I did: http://plugcomputer.org/plugforum/index.php?topic=878.0 (that means creating a rootfs on your SD card, then transferring the rootfs (compressed as rootfs.tar.gz) to a USB stick, then running the installer).

No, there isn't a "straightforward" solution. Use of the installer isn't obvious, mainly because there are 1 or 2 errors in the readme, but we can advise, and once you have worked through it, it will seem very easy. Are there any instructions regarding the installer on the German Sheevaplug forum?

Actaully... there is one straightforward solution, and that is for you to copy an image from a USB stick to your SD card. You can do that from the Sheevaplug, booting it from the NAND. I'll tell you more after you confirm:

(A) That you can boot from NAND
(B) What was the original O/S supplied on your SD card?
(C) What size and make of SD card are you attempting to use for your debian install?
(D) The state of your environment variables. Have you modified them in any way?
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #9 on: 23 December 2009, 02:05:13 pm »

Hi Marcus.
thanks again for your quick answer. I'm a litte bit in christmas stress!

Ok, now to the problem once more:

I got an replacement for my plug witch was not shiped with an sd-card. The new Plug is set up as multi-boot i think but I've got no sd-card from you. You asked me about my environment: I have nothing changed yet, it's still like you shipped it. I did a printenv, here it is:
Code: [Select]
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (Nov  4 2009 - 12:58:36) Marvell version: 3.4.23

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0
Marvell>>
Marvell>>
Marvell>>
Marvell>>
Marvell>>
Marvell>>
Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200 mtdparts=nand_mtd:[email protected](uboot)ro,[email protected](root)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
mtdpartitions=mtdparts=orion_nand:[email protected](uImage),[email protected](rootfs)
ethaddr=00:50:43:01:69:9B
bootargs_console=console=ttyS0,115200
recover1=setenv mainlineLinux yes; setenv arcNumber 2097; setenv bootcmd run recover2; saveenv; reset
recover2=run recover3; setenv bootcmd $(real_bootcmd); saveenv; setenv bootargs $(bootargs_console) $(mtdpartitions) root=/dev/ram0 rw ramdisk=0x01100000,8M install_type=nand; bootm 0x00800000 0x01100000
recover3=run recover4; nand erase clean 0x00100000 0x00400000; nand write.e 0x00800000 0x00100000 0x00400000
recover4=usb start; fatload usb 0 0x00800000 uImage; fatload usb 0 0x01100000 initrd
bootargs_root_nand=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
bootcmd_nand=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root_nand); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000
bootargs_root_mmc=root=/dev/mmcblk0p2 rootdelay=5
bootcmd_mmc=setenv bootargs $(bootargs_console) $(bootargs_root_mmc); mmcinit; ext2load mmc 0:1 0x800000 /uImage; bootm 0x00800000
real_bootcmd=run bootcmd_mmc; run bootcmd_nand
arcNumber=2097
filesize=32D62A
bootcmd=run bootcmd_mmc; run bootcmd_nand
stdin=serial
stdout=serial
stderr=serial
nandEnvBase=a0000
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no

Environment size: 2260/131068 bytes
Marvell>>

> The part of the documentation that I wanted you to refer to was ONLY the part about copying files from NAND to SD card, not the complete preparation of an SD card. You are using a fresh SD card for the data backup, right, not the one we supplied with the O/S?
I used a new sd-card and copying the content from the NAND was successfull. Even the card don't boot. What else do I have to do to make it bootable?

I would be quite happy if something like this would work: I want to leave the system on the NAND untouched. The System should boot Ubuntu or debian (I prefer debian) form the sd-card. If somthing goes wrong with the sd-card I want to to able to start the System on the NAND. I've no problem to change some varibles by hand for this option.

Maybe it would be better not to have the UBIFS-System installed, so I could use for example the dokumentation for the debian installation. http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html. If this would be the solution how can I install the original system?

Thanks an Greetings.
Thomas.

Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #10 on: 23 December 2009, 06:18:44 pm »

Thomas -

When you started this thread, I posted some information that related to copying the filesystem from NAND onto an SD card, for backup purposes.

Now you are talking about preparing a bootable SD card.

These are two very different concepts.

Please be clear that you are now intending to prepare a bootable SD card. The procedure will involve:

1. Partitioning the SD card in an appropriate fashion
2. Placing a suitable root file system onto the SD card
3. Placing a suitable kernel onto the SD card.
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #11 on: 23 December 2009, 07:55:06 pm »

Hi Marcus,
o.k. I wanted to backup the system on the NAND becuase of two reasons:
1. I want to have a backup from the system and
2. I want to boot this backup and modify it to my needs. I need more space on the system because I wont to install the Squeezeboxserver with a big mysql database so the original space on the NAND is not enough.
3. Additionly it would be very nice to have an sd-card with debian squeeze on it. I've installed an usb-stick on the old sheevaplug with the non working sd-card reader that runs debian and squeezeboxserver very well. But from that fact it runs on an usb-stick I can't connect an usb-hard drive.

Greetings,
Thomas
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Backing up nand system
« Reply #12 on: 23 December 2009, 08:25:25 pm »

Hi Marcus,
o.k. I wanted to backup the system on the NAND becuase of two reasons:
1. I want to have a backup from the system and
2. I want to boot this backup and modify it to my needs. I need more space on the system because I wont to install the Squeezeboxserver with a big mysql database so the original space on the NAND is not enough.
3. Additionly it would be very nice to have an sd-card with debian squeeze on it. I've installed an usb-stick on the old sheevaplug with the non working sd-card reader that runs debian and squeezeboxserver very well. But from that fact it runs on an usb-stick I can't connect an usb-hard drive.

Greetings,
Thomas


Your first task is to prepare the SD card for booting. After you have this prepared correctly, you can consider procedures for copying the file system to the SD card.

The most straightforward way to prepare a bootable SD card is to use the installer. If you modify uboot-mmc-custom.txt; if you use the environment variables that we use for our multi-boot configurations then your existing system will be preserved.

If you choose to prepare the SD card manually, you need uImage on partition #1 and the rootfs on partition #2.

The installer may be used to install debian, see here. If the environment variables are significantly different from your current settings, you should change:

Code: [Select]
bootargs_root_mmc=root=/dev/mmcblk0p2 rootdelay=5
bootcmd_mmc=setenv bootargs $(bootargs_console) $(bootargs_root_mmc); mmcinit; ext2load mmc 0:1 0x800000 /uImage; bootm 0x00800000
Logged

truehl

  • Jr. Member
  • **
  • Posts: 58
Re: Backing up nand system
« Reply #13 on: 23 December 2009, 08:39:04 pm »

Marcus,
did I got you right that I can use the installation Guide from Martin Michlmayr and only have to change the environment settings?

Greetings Thomas
Logged

akc42

  • New IT customer
  • Newbie
  • *
  • Posts: 19
Re: Backing up nand system
« Reply #14 on: 24 December 2009, 02:30:53 pm »

I'll just jump into this thread and tell truehl that I have Debian squeeze running on an SD card, having left the NAND how it came, AND making things so I can multiboot - if the SD card is in place then it boots from it, if that fails it goes on to boot the nand.

To get the SD set up, I followed the instructions from http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html, but just remember that you can boot the installer from a USB stick, and once it is running install the system it builds directly onto the SD card.  Don't think just because you boot of a USB stick that is where you install the system.

I initially also followed the instructions for modifying the environment variables to boot of the SD card, but then tweeked it using the principals but not the actual instructions. Unfortunately - unless someone can help me print out the environment variables from a running system - I can't explain precisely how I did the dual boot thing - because the Sheeva play is now my home firewall, gateway, dns and dhcp server, mail server, web server and running both Postgres and Mysql databases and has been running 10 days without stopping.  If I do stop it, my whole household can no longer access the internet, so I would rather not.

You can backup the nand how you like once you have the SD running - just mount it and copy the data - onto the SD card, or across the network somewhere else.  You can't just copy the system on the nand to the sd card and use it (at least I assume not, because of different modules etc needed).

Logged
Pages: [1] 2 3
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!