Saving and writing the complete system

I am trying to make a complete backup of a tp-link mr3020 that I use for gaming. I already have it configured, programs installed and it's working great as a file server. Since I have it completely configured, with samba added and everything, I was curious to know if there's a way to complete save the system, in case the configuration goes to hell (happened couple of times already), and I can save myself from factory reset the thing and reinstall and reconfigure everything by hand.

Maybe flashing the already created and working system is the way. Anyone knows the commands?

I've found this thread Backing up complete system but in my /dev folder theres quite a lot of stuff, and mtd11 it's missing, so here I am asking for some insight.

MOTD with sys info

Screenshot of my dev folder


use the provided tar tools and sysupgrade.conf... ( regularly )... keep a copy of every .bin or .img...

simple... ( mtd/'art'/env/'emmc bootloader + layout' etc. are the real things you'd really want if anything... general users by all means... if you are confident get backups... but don't expect to restore them unless its an emergency in which case there are no guarantees anyway, do you really want to invest 6-12 months and risk bricking your device just to learn how to restore things at a low level? )

the only clean way to what you describe/envision in your OP for the majority of devices ( with bootloader support and flash specific tools accommodated ) is to boot an initramfs to dump / restore the flash... ( or similar re: bootloader > usb... etc. etc. from a non running OS, kermit, jtag, slaveusbmodes, soic-clip etc... )...

this is unfeasable for most users due to;

  • skill level and chances you'll actually brick via user error
  • file size and transfer / wear... it's illogical ( thanks spock )... to move a whole say 4GB ... ( unless you are truly messing with the device at a low level then it's worth it )... not openwrt but android devices are an exception due to various rom flashing methods... and better available local storage...
  • when/if the time arises for most users... restoration of such 'total' backups would leave them with an outdated... ( possibly incompatible with current bootloader of you dont dump whole-flash )... etc. etc.

Huge advantage that platforms using sd cards have is you can dup one sd card to another... Something goes wrong you just swap them.

1 Like

This will vary by model. You missed the part to examine the partitioning scheme with cat /proc/mtd. Find the number of the one named "firmware". It was 11 in the other thread, because that's a different model.

Since this procedure requires using sysupgrade -F -n there's little protection against bricking. Always use the -n option and never try it on a model with NAND flash.

1 Like

Why not try to build your own firmware image (targeting a release tag like 18.06.2/19.07.5)? You will have the ability to select which packages to include (pre-install) in the firmware image. You can also include your own custom configuration files (from your OpenWRT config backup) or other files inside the image.

I'm generally wary of anything that might require a JTAG port to solve in case things went horribly wrong.


Do you really need to back up all the partitions? The MTD is not going to get corrupted, unless you do something crazy with the device.

Anything you modified after the last sysupgrade is at /overlay, everything else should be recoverable with a sysupgrade.

1 Like