While trying to open /dev/mtd2 for read/write access: Permission denied

gpuguy hf.basit at gmail.com
Mon Apr 7 23:14:01 PDT 2014


Looks like my MTD2,and MTD3 partitions are write protected. The OS is 
booting from SD card on a ARM Cortex A 9 processor.

root at Xilinx-ZC702-2013_3:~# mount /dev/mmcblk0p1 /mnt/
root at Xilinx-ZC702-2013_3:~#
root at Xilinx-ZC702-2013_3:~# cd /mnt/flash/
root at Xilinx-ZC702-2013_3:/mnt/flash#
root at Xilinx-ZC702-2013_3:/mnt/flash# ls
BOOT.BIN      image.ub      rootfs.jffs2
root at Xilinx-ZC702-2013_3:/mnt/flash# flashcp -v image.ub /dev/mtd2
While trying to open /dev/mtd2 for read/write access: Permission denied
root at Xilinx-ZC702-2013_3:/mnt/flash#


Even I tried alternate:

root at Xilinx-ZC702-2013_3:/mnt/flash# flash_eraseall -j /dev/mtd2
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use 
it
flash_erase: error!: /dev/mtd2
             error 13 (Permission denied)


Here are additional info:

root at Xilinx-ZC702-2013_3:/mnt/flash# mtdinfo
Count of MTD devices:           4
Present MTD devices:            mtd0, mtd1, mtd2, mtd3
Sysfs interface supported:      yes

root at Xilinx-ZC702-2013_3:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00500000 00010000 "boot"
    mtd1: 00020000 00010000 "bootenv"
    mtd2: 001202c0 00010000 "image"
    mtd3: 00500000 00010000 "jffs2"
Also:

root at Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags = MTD_BIT_WRITEABLE
mtd.size = 5242880 (5M)
mtd.erasesize = 65536 (64K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root at Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd2
mtd.type = MTD_NORFLASH
mtd.flags = MTD_BIT_WRITEABLE
mtd.size = 1180352 (1M)
mtd.erasesize = 65536 (64K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root at Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd1
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 131072 (128K)
mtd.erasesize = 65536 (64K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root at Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 5242880 (5M)
mtd.erasesize = 65536 (64K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0

root at Xilinx-ZC702-2013_3:/mnt/flash#




How do I solve this issue?




More information about the linux-mtd mailing list