Omega Backup / Restore Instructions
-
It took me a few hours today but I figured it out and wanted to share how to backup an Onion Omega 2+ and restore the image on another device.
BACKUP INSTRUCTIONS
-Plug in Flash Drive
-Mount Flash Drive
mount /dev/sda1 /mnt-Create backup folder in flash drive
mkdir /mnt/backup-Read / Verify mtd#
cat /proc/mtd(Printout looks something like this)
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 01fb0000 00010000 "firmware"
mtd4: 00140404 00010000 "kernel"
mtd5: 01e6fbfc 00010000 "rootfs"
mtd6: 01910000 00010000 "rootfs_data"-Copy mtd# to bin files on flash drive
(Command to copy mtd0)
dd if=/dev/mtd0 of=/mnt/backup/uboot.bin(Command to copy mtd1)
dd if=/dev/mtd1 of=/mnt/backup/ubootenv.bin(Command to copy mtd2)
dd if=/dev/mtd2 of=/mnt/backup/factory.bin(Command to copy mtd3)
dd if=/dev/mtd3 of=/mnt/backup/firmware.bin(Command to copy mtd4)
dd if=/dev/mtd4 of=/mnt/backup/kernel.bin(Command to copy mtd5)
dd if=/dev/mtd5 of=/mnt/backup/rootfs.bin(Command to copy mtd6)
dd if=/dev/mtd6 of=/mnt/backup/rootfsdata.binfirmware.bin and rootfsdata.bin could take up to a few minutes to completely copy over. Do not stop this process.
For a general backup the only thing that really matters to copy is firmware.bin. The other bin files are optional backups and only needed in special cases. Better to have and not need then need and not have
RESTORE INSTRUCTIONS
-Plug in Flash Drive
-Mount Flash Drive
mount /dev/sda1 /mnt
(sometimes the flash drive is not "sda1", you can verify number in debug terminal as you plug it in)-Run Recovery Command
mtd -r write /mnt/backup/firmware.bin firmwareThis will take a few minutes to complete. After the Omega Onion will reboot and you should see an imaged / recovered Omega Onion! Hope this helps someone.
-
well, now i'm confused. i was not aware that dd could be used with mtd. or mtd would work with usb flash. so, you're saying that this method makes a clone of a omega2[+] on a usb flash drive?
-
the USB flash drive is only used to store the .bin files / images. I use "dd" to copy and "mtd" to re-flash the omega 2(+).
I tried the above and it worked, if you have the time, try it to and let me know how it goes!
-
@brolly759 yeah, i know. but, the usb is a block device whereas the flash on the omega is eraseblock. two different technologies and i had thought that software for flash would not work on block devices and software for block devices would not work with eraseblock. learn something new each day.
-
I followed these instructions loosely from this youtube video:
-
@brolly759 said
I tried the above and it worked, if you have the time, try it to and let me know how it goes!
Well, perhaps you can backup your uboot, but it seems that
you can't write it back this way:# mtd write u-boot.bin mtd0 Could not open mtd device: mtd0 Can't open device for writing!
[edit]
You can, but it's not as trivial, so it requires some hoop jumping to get it done.# mtd write u-boot-env.bin u-boot-env Unlocking u-boot-env ... Writing from u-boot-env.bin to u-boot-env ... # mtd write u-boot.bin u-boot Unlocking u-boot ... Writing from u-boot.bin to u-boot ...
[/edit]