Art partition backup error

regarding https://openwrt.org/docs/guide-user/installation/generic.backup#create_art_backup

I'm trying to backup art partition with command
dd if=/dev/$(sed -n -e '/:.*"art"/s///p' /proc/mtd) of=/tmp/art.backup

but I get error
dd: /dev/: Is a directory

Any help? thanks

Can you give us the output from cat /proc/mtd?

1 Like

root@OpenWrt:~# cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 01fb0000 00010000 "firmware"
mtd4: 00308e9a 00010000 "kernel"
mtd5: 01ca7166 00010000 "rootfs"
mtd6: 017d0000 00010000 "rootfs_data"

on a ... ?

2 Likes

sorry but what is the output of the command:

sed -n -e '/:.*"art"/s///p' /proc/mtd

it appears to me to be empty

which partition do you want to make a backup of /dev/mdX ?

This looks like a MediaTek device. ART is a QCA Atheros thing. On your router the unit-specific calibration data is in factory.

2 Likes

it's empty for me too. I'm just following the guide to make a full back-up of my router in case I need to go back to stock, and I don't know where particular data like "calibration" ones are stored. I have alredary used the openwert tool on http://192.168.1.1/cgi-bin/luci/admin/system/flash "SAVE MTDBLOCK" for every block I see

PS @mk24 the openwrt tool "SAVE MTDBLOCK" is fully functional to save those important data?

zbt wg1602 v04 32m

I was advised against restoring partitions from backups of the /dev/mtdX partitions

but now I don't remember who recommended this to me...

could be reasonable to update your guide with more specific examples to suite more devices?

I dont use luci much at all so I don't know what that does. It appears that it should work. Since this is NOR flash you can simply dump a partition image to a file and restore it later. That does not work with NAND flash.

Of course to be able to pull a copy of the stock firmware out of flash it has to be done with the router in stock condition before flashing OpenWrt. This means use serial to TFTP boot the initramfs OpenWrt. That is kind of an advanced process reqiring CLI operations.

A normal install will only alter the firmware partitions the bootloader and factory won't be changed unless something goes badly wrong.

1 Like

thanks for explaining. Sorry for asking "stupid" question: how do I know what kind of flash does need my device? NAND or NOR or both?

Check the system log or kernel log.
There is typically mentioned at boot which kind of flash chip is found.

[    0.589507] spi-nand spi2.0: Fidelix SPI NAND was found.
[    0.594832] spi-nand spi2.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.602988] mtk-snand 1100d000.spi: ECC strength: 4 bits per 512 bytes
[    0.609837] 2 fixed-partitions partitions found on MTD device spi2.0
1 Like