Hola,
Para hacer un backup del sistema entrar al router vía ssh:
ssh root@192.168.1.1
y ejecutar:
/usr/bin $ cat /proc/mtd
dev: size erasesize name
mtd0: 00030000 00010000 "boot"
mtd1: 0019a400 00010000 "kernel"
mtd2: 005f8000 00010000 "rootfs"
mtd3: 0083dc00 00010000 "data"
/usr/bin $
Os aparecerá la Memory Technology Device con cada dispositivo.
Para hacer un backup conectaís un usb y ejecutáis:
cat /dev/mtd0 > /mnt/alejandro/backup_mtd0_boot.bin
cat /dev/mtd1 > /mnt/alejandro/backup_mtd1_kernel.bin
cat /dev/mtd2 > /mnt/alejandro/backup_mtd2_rootfs.bin
cat /dev/mtd3 > /mnt/alejandro/backup_mtd3_data.bin
[/b]
Y ya tendréis el backup.
Para ver todo el contenido del rootfs podéis hacer lo siguiente:
Nota: Está en squashfs con compresión LZMA. Hay que compilar el paquete con esta funcionalidadOs bajáis el paquete:
http://sourceforge.net/projects/squashfs/# sudo apt-get install lzma-dev
# sudo apt-get install liblzma-dev
# tar -zxvf squashfs4.3.tar.gz
# cd squashfs4.3/squashfs-tools: [b]Editas el Makefile descomentáis la línea "LZMA_XZ_SUPPORT = 1"[/b]
# make
# make install
# unsquashfs /mnt/alejandro/backup_mtd2_rootfs.bin
A continuación os aparecerá:
[b]sudo unsquashfs /mnt/alejandro/backup_mtd2_rootfs.bin[/b]
Parallel unsquashfs: Using 4 processors
1333 inodes (1364 blocks) to write
[=============================================================/] 1364/1364 100%
created 928 files
created 94 directories
created 124 symlinks
created 281 devices
created 0 fifos
Si entramos en la carpeta veremos el FS:
# ls -last
total 52
0 lrwxrwxrwx 1 563 563 8 nov 8 19:34 tmp -> /var/tmp
0 lrwxrwxrwx 1 563 563 11 nov 8 19:34 linuxrc -> bin/busybox
0 lrwxrwxrwx 1 563 563 3 nov 8 19:34 pool -> var
4 drwxr-xr-x 3 alejandro alejandro 4096 nov 8 19:34 ..
4 drwxrwxr-x 10 563 563 4096 jul 30 2013 etc
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 var
4 drwxrwxr-x 4 563 563 4096 jul 30 2013 lib
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 sbin
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 bin
4 drwxrwxr-x 13 563 563 4096 jul 30 2013 .
4 drwxrwxr-x 8 563 563 4096 jul 30 2013 usr
4 drwxrwxr-x 3 563 563 4096 jul 30 2013 dev
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 mnt
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 proc
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 root
4 drwxrwxr-x 2 563 563 4096 jul 30 2013 sys
[/b]
Para compilar seguramente se utilizará
mksquashfs con toda la carpeta descomprimida anteriormente y aplicando una compresión lZMA. Despues copiando el archivo en un pendrive y introducirlo en bruto:
cat ARCHIVOBACKUP_DATAFS.bin >> /dev/mtd2
Pero no me atrevo a hacerlo XD.
Para flashear OpenWRT a través del CFE tampoco me funciona. Parece que sí pero al reiniciar está como antes
Un saludo