Sunday, April 06, 2008

OpenWRT Backup - Restore

So you've just configured this router just the way you like it. You've installed the required packages and all now its time to safeguard your baby and backup your router completly. (Apart from bootrom & nvram) To do t his couldn't be easier... simply enter the following into an ssh session:
dd if=/dev/mtd/1 of=/tmp/firmware.trx

Now all thats needed to do is SCP the firmware backup to your computer for safe keeping.

So now lets imagine you've done something silly like rm -r -f /jffs/* and now your routers now doing what u like... or maybe you've changed config settings all over the place so much so that u just want to go back to when it worked. Well fear now more, since we've backed up, one simply command and about 3 minutes and we'll be back to normal.

To restore all you need to do is enter the following into an ssh session:
mtd -r write firmware.trx linux

So there you go, all those lost nights sitting up awake scared of router mishaps, now you're safe.. *sigh* night night :p