Moving OpenWrt to new device

Is it possible to move a working installation of OpenWrt (x86) to a new device?

If so, how?

if new device is same as the old you can very easily do this

cat /proc/mtd = check your mtd partition 
 dd if=/dev/${mtdn}ro of=~/${mtdn}.backup"

mtdn = mtd partition with firmware on it

the on the second device

> mtd -r write <the backup of mtd from above> . <label of mtd partition with firmware >

I want to move the installation from one disk to another. I'm using a PC.

From one disk to another on same pc . Am I getting you right ?

Doesn't matter... either on the same or another...

oh

then also clone the disks

No user who is not a developer with intimate knowledge of their device at low levels, as well as file systems should follow any of the above advice involving "raw" access to mtd and/or dd, for any device. Doing so may brick a device, or cause other damage, for at least the following reasons:

  • Overwriting device-specific partitions that include calibration data, MAC addresses or the like, is inappropriate and unrecoverable without a backup of the target device
  • An error in writing a boot loader will likely brick the device
  • Use of mtd tools or dd with NAND-based devices will likely result in a corrupt flash
  • Use of low-level disk utilities is generally only appropriate when the source and the target are of exactly the same size and structure

Not to mention, you can't use these tools until OpenWrt or another compatible OS is up and running on the target.

A robust approach for non-developers includes:

  • Taking a backup any changed files of interest to the user and preserving off the device
  • Taking a backup using sysupdate and preserving off the device
  • Install OpenWrt on the target and boot
  • Copy the preserved sysupdate-style backup to the device and restore
  • Adjust any configuration parameters that may be different due to overall architecture (LED naming, for example)
  • Adjust any configuration parameters that are device specific (references to wireless devices in /etc/config/wireless, for example)
  • Reinstall any user-installed packages that are still necessary
  • Reboot and make any remaining changes required

In an x86 environment, the boot loader(s) may need to have their configuration adjusted. This is especially true in a multi-boot environment or those that use chain loading, such as EFI boot.

2 Likes

yes all these can be treated as warnings to be kept in mind , but try guys its worth knowledge

Sorry, I meant move from a partition on one device to a partition on another device.

It's the same:

dd if=/dev/sda1 of=/dev/sdb1

Make sure sdb1 >= sda1.

1 Like