While trying to open /dev/mtd2 for read/write access: Permission denied
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@Xilinx-ZC702-2013_3:~# mount /dev/mmcblk0p1 /mnt/ root@Xilinx-ZC702-2013_3:~# root@Xilinx-ZC702-2013_3:~# cd /mnt/flash/ root@Xilinx-ZC702-2013_3:/mnt/flash# root@Xilinx-ZC702-2013_3:/mnt/flash# ls BOOT.BIN image.ub rootfs.jffs2 root@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@Xilinx-ZC702-2013_3:/mnt/flash#
Even I tried alternate:
root@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@Xilinx-ZC702-2013_3:/mnt/flash# mtdinfo Count of MTD devices: 4 Present MTD devices: mtd0, mtd1, mtd2, mtd3 Sysfs interface supported: yes
root@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@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@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@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@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@Xilinx-ZC702-2013_3:/mnt/flash#
How do I solve this issue?
What do you have in your device tree for these partitions?
// Mats
________________________________________
From: linux-mtd [[email protected]] on behalf of gpuguy [[email protected]]
Sent: Tuesday, April 08, 2014 8:14 AM
To: [email protected]
Subject: While trying to open /dev/mtd2 for read/write access: Permission denied
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@Xilinx-ZC702-2013_3:~# mount /dev/mmcblk0p1 /mnt/ root@Xilinx-ZC702-2013_3:~# root@Xilinx-ZC702-2013_3:~# cd /mnt/flash/ root@Xilinx-ZC702-2013_3:/mnt/flash# root@Xilinx-ZC702-2013_3:/mnt/flash# ls BOOT.BIN image.ub rootfs.jffs2 root@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@Xilinx-ZC702-2013_3:/mnt/flash#
Even I tried alternate:
root@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@Xilinx-ZC702-2013_3:/mnt/flash# mtdinfo Count of MTD devices: 4 Present MTD devices: mtd0, mtd1, mtd2, mtd3 Sysfs interface supported: yes
root@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@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@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@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@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@Xilinx-ZC702-2013_3:/mnt/flash#
How do I solve this issue?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/