backup dd-wrt

Settings of such equipment is typically stored in nonvolatile memory. The devices can be found in the proc / mtd

root @ router: ~ # cat / proc / mtd
dev: size erasesize name
# Boot
mtd0: 00040000 00010000 "cfe
"
# Kernel
mtd1: 003b0000 00010000 "linux
"
# Root filesystem
mtd2: 001db400 00010000 "rootfs
"
# Parameters
mtd3: 00010000 00002000 "nvram
"
# Free partition (where I keep extra initialization scripts)
mtd4: 000f0000 00010000 «ddwrt»

Now, where do a full dump of interest to us section, and save somewhere on your computer.

# Do a dump
root @ router: ~ # dd if = / dev/mtdblock/3 of = / tmp / config.dd
128 0 records in
128 0 records out
root @ router: ~ #

# Save to your computer
yurial @ note: ~ $ scp root@192.168.0.1: / tmp / config.dd config.dd

To restore the settings to produce the inverse operation, and reboot.

# Copy the settings from your PC to your device
yurial @ note: ~ $ scp config.dd root@192.168.0.1: / tmp / config.dd

# Copy the settings from the dump
root @ router: ~ # dd if = / tmp / config.dd of = / dev/mtdblock/3
# Reboot
# Ps before rebooting unplug usb-connected devices
root @ router: ~ # reboot-f

In general, this way you can make a backup, not only for firmware dd-wrt, and not only on dir-320. Such a method suitable, for example, to backup iphone, or geeksphone.

PS: on my dir-320 under its own firmware before restarting I would do a sync, to make sure that all data were recorded. However, under dd-wrt I, this led to the crash.