Freitag, 7. November 2008

backup/save/flash/restore edimax br-6104kp openwrt

#### preparing backup pc:
#### linuxmachine 192.168.0.66:
user1@linuxmachine:~/openwrt/tst$ nc -l -p 7777 | dd of=mtdblock2
2978+1485 records in #<---- those lines appear after backup
3968+0 records out
2031616 bytes (2.0 MB) copied, 3.96442 seconds, 512 kB/s

#### preparing openwrt backup
#### "firmware" is including everything except /tmp
root@OpenWrt:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00008000 00004000 "admboot"
mtd1: 00008000 00008000 "config"
mtd2: 001f0000 00010000 "firmware"
mtd3: 000b93e4 00010000 "kernel"
mtd4: 00134c00 00010000 "rootfs"
mtd5: 00070000 00010000 "rootfs_data"

root@OpenWrt:/# mount -o remount,ro /jffs
root@OpenWrt:/# dd if=/dev/mtdblock2 | nc 192.168.0.66 7777
3968+0 records in
3968+0 records out

#### restore:
root@OpenWrt:/# cd tmp/
root@OpenWrt:/tmp# scp user1@192.168.0.66:~/openwrt/tst/mtdblock2 .
root@OpenWrt:/# dd if=/tmp/mtdblock2 of=/dev/mtdblock2 && reboot
3968+0 records in
3968+0 records out

#### original firmware restore: serial cable (slower) or like this:
root@OpenWrt:/tmp# scp user1@192.168.0.66:~/openwrt/tst/orig.bin .
root@OpenWrt:/tmp# mtd -r -e firmware write orig.bin firmware

#### flashing Openwrt to Device: use webinterface (faster) or serial
cable (failsafe) - openwrt/bin has different files for that

##### references:
http://wiki.openwrt.org/BackupAndRestore

Keine Kommentare: