OpenWrt Forum Archive

Topic: mtd partition unlock problem

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I am having a problem while trying to unlock and rewrite the RedBoot config partition from within the linux.
All other partitions are able to unlock and rewrite except the RedBoot config "mtd6" and FIS directory"mtd7".

Following is the partition setup on the Intel IXP425 board running kamikaez r12369. 

root@OpenWrt:/etc# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00060000 00020000 "RedBoot"
mtd1: 00140000 00020000 "kernel1"
mtd2: 00500000 00020000 "rootfs1"
mtd3: 00140000 00020000 "kernel2"
mtd4: 00500000 00020000 "rootfs2"
mtd5: 00100000 00020000 "OSMOconfig"
mtd6: 00001000 00020000 "RedBoot config"
mtd7: 00020000 00020000 "FIS directory"
root@OpenWrt:/#

When trying to unlock RedBoot config, it throws the fowlloing error.

root@OpenWrt:/etc# mtd unlock mtd6
Could not open mtd device: mtd6
Could not open mtd device: mtd6
root@OpenWrt:/#

Whereas, unlocking other parition like mtd5 is ok.
root@OpenWrt:~# mtd unlock mtd5
Unlocking mtd5 ...
root@OpenWrt:~#

Does anybody have an idea where the problem could be?

Just a wild guess. Check that there are device files for mtd6 and 7 in /dev.

Wodin,

Thanks for the tips.  The device files are there in /dev for mtd6 and mtd7.

I have fixed the problem by disabling the Force Read-only for Redboot system images under
MTD support in the kernel_menuconfig. Now, I can able to unclock the partitions mtd6 and mtd7.

Now there is another problem . I am getting Write error image.

root@OpenWrt:/# mtd write /tmp/redbootconfig "RedBoot config"
Unlocking RedBoot config ...
Writing from /tmp/redbootconfig to RedBoot config ...  [w]Error writing image.
root@OpenWrt:/#

But this works well using stable kamikaze_7.09. Whereas it doesn't using latest kamikaze-trunk.

any idea ?

(Last edited by sara on 11 Sep 2008, 13:19)

How can I create my own flash partitons in OpenWRT?

The discussion might have continued from here.