How to backup Xiaomi Mini Wifi Router (R1CM) before flash

# Check MTD partitioning.

root@XiaoQiang:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 00c80000 00010000 "OS1"
mtd5: 00b127d7 00010000 "rootfs"
mtd6: 00200000 00010000 "OS2"
mtd7: 00100000 00010000 "overlay"
mtd8: 00010000 00010000 "crash"
mtd9: 00010000 00010000 "reserved"
mtd10: 00010000 00010000 "Bdata"

# Backup
# /extdisks/sda1 is the external storage for your router

dd if=/dev/mtd0 of=/extdisks/sda1/rom/ALL.bin
dd if=/dev/mtd1 of=/extdisks/sda1/rom/Bootloader.bin
dd if=/dev/mtd2 of=/extdisks/sda1/rom/Config.bin
dd if=/dev/mtd3 of=/extdisks/sda1/rom/Factory.bin
dd if=/dev/mtd4 of=/extdisks/sda1/rom/OS1.bin
dd if=/dev/mtd5 of=/extdisks/sda1/rom/rootfs.bin
dd if=/dev/mtd6 of=/extdisks/sda1/rom/OS2.bin
dd if=/dev/mtd7 of=/extdisks/sda1/rom/overlay.bin
dd if=/dev/mtd8 of=/extdisks/sda1/rom/crash.bin
dd if=/dev/mtd9 of=/extdisks/sda1/rom/reserved.bin
dd if=/dev/mtd10 of=/extdisks/sda1/rom/Bdata.bin
#dd if=/dev/mtd11 of=/extdisks/sda1/rom/firmware.bin
# Note: there is no mtd11 firmware partition in my device

# Backup Restore

mtd -r write /extdisks/sda1/rom/Bootloader.bin Bootloader
mtd -r write /extdisks/sda1/rom/Config.bin Config
mtd -r write /extdisks/sda1/rom/Factory.bin Factory
mtd -r write /extdisks/sda1/rom/OS1.bin OS1
mtd -r write /extdisks/sda1/rom/rootfs.bin rootfs
mtd -r write /extdisks/sda1/rom/OS2.bin OS2
mtd -r write /extdisks/sda1/rom/overlay.bin overlay
mtd -r write /extdisks/sda1/rom/crash.bin crash
mtd -r write /extdisks/sda1/rom/reserved.bin reserved
mtd -r write /extdisks/sda1/rom/Bdata.bin Bdata
#mtd -r write /extdisks/sda1/rom/firmware.bin firmware
# Note: there is no firmware partition in my device


# start to flash uboot (optional, only need if you replace uboot)
cd /tmp
wget http://downloads.openwrt.org.cn/PandoraBox/Xiaomi-Mini-R1CM/u-boot/uboot-xiaomi-mini-115200.bin -O uboot.bin

mtd -r write /tmp/uboot.bin Bootloader

# waiting for reboot

Comments

Popular Posts