Full dump for duplicate

avigeilpro
 
Posts: 25
Joined: Wed Mar 22, 2017 5:29 pm

Full dump for duplicate

Sat Apr 15, 2017 8:46 am

Hi,
Is there a way to fully dump de files and configurations of a Vocore2 to duplicate it in another one ?
I would like to develop on the Vocore that i soldered on a breadboard and when all is ready, dump all the files and configuration in another vocore which will go in the final system without needing to reconfigure everything step by step.

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: Full dump for duplicate

Sat Apr 15, 2017 9:29 pm

Lots of ways to do that, here is one.

cat /proc/mtd shows the flash partitions
rootfs contains the last image you flashed, rootfs_data contains the changes since then.

avigeilpro
 
Posts: 25
Joined: Wed Mar 22, 2017 5:29 pm

Re: Full dump for duplicate

Sun Apr 16, 2017 12:03 am

thank you noblepepper, for what i want do, i think the easier way is to generate an archive through the web interface (System > Backup / Flash Firmware > Generate Archive), am I right ? Or is it better to do a backup of mtd4 (rootfs_data) ?

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: Full dump for duplicate

Mon Apr 17, 2017 10:14 pm

If all you need is configuration the Luci web interface option does that. If you install packages, you will need to install them again on a new board. The mtd approach will get both.

I like to configure a image that contains all the packages I want then use uci-defaults to set configurations. This way when you flash the image the only changes that are needed on rootfs_data are the configurations, leaving more "disk" space. It takes a bit more fiddling I look at it as the "right way".

avigeilpro
 
Posts: 25
Joined: Wed Mar 22, 2017 5:29 pm

Re: Full dump for duplicate

Sun May 07, 2017 2:02 pm

Hi,
I want test the mtd approach, so i did this :
Code: Select all
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 00fb0000 00010000 "firmware"
mtd4: 00117d92 00010000 "kernel"
mtd5: 00e9826e 00010000 "rootfs"
mtd6: 00910000 00010000 "rootfs_data"


then this :
Code: Select all
dd if=/dev/mtd6 of=/tmp/rootfs_data.backup


I have my rootfs_data.backup file and saved it on another computer.
My question is how do i do to restore now, i read that i need use the "mtd" command, but i'm not sure about the exact way to do and i dont want do any mistake.

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: Full dump for duplicate

Tue May 09, 2017 8:58 am

Code: Select all
root@vocore2:/# mtd
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>[:<device>...]

The device is in the format of mtdX (eg: mtd4) or its label.
mtd recognizes these commands:
        unlock                  unlock the device
        refresh                 refresh mtd partition
        erase                   erase all data on device
        verify <imagefile>|-    verify <imagefile> (use - for stdin) to device
        write <imagefile>|-     write <imagefile> (use - for stdin) to device
        jffs2write <file>       append <file> to the jffs2 partition on the device
        fixseama                fix the checksum in a seama header on first boot
Following options are available:
        -q                      quiet mode (once: no [w] on writing,
                                           twice: no status messages)
        -n                      write without first erasing the blocks
        -r                      reboot after successful command
        -f                      force write without trx checks
        -e <device>             erase <device> before executing the command
        -d <name>               directory for jffs2write, defaults to "tmp"
        -j <name>               integrate <file> into jffs2 data when writing an image
        -s <number>             skip the first n bytes when appending data to the jffs2 partiton, defaults to "0"
        -p                      write beginning at partition offset
        -l <length>             the length of data that we want to dump

Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards
         mtd -r write linux.trx linux

root@vocore2:/#


So using the example
Code: Select all
mtd -r write /tmp/rootfs_data.backup rootfs_data

Will write the file to the mtd6 section of the flash and reboot when it is done.

avigeilpro
 
Posts: 25
Joined: Wed Mar 22, 2017 5:29 pm

Re: Full dump for duplicate

Tue May 09, 2017 3:36 pm

thank you noblepepper, this worked perfectly :)

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 34 guests