I have a files system that I am trying to put in flash memory mtd3 partition.I first boot using uboot and then do run sdboot to boot using SD card as shown below:  U-Boot-PetaLinux>U-Boot-PetaLinux> printenv mtdpartsmtdparts=mtdparts=0:5M(boot),128K(bootenv),10752K(image),4M(spare)U-Boot-PetaLinux>run sdbootNow I have a running linux system.....root@Xilinx-ZC702-14_7:/mnt/flashboot# nandwrite -p /dev/mtd3 rootfs.jffs2Image 3513340 bytes, NAND page 1 bytes, OOB area 0 bytes, device size 393216 bytesnandwrite: error!: Input file does not fit into device           error 0 (Success)nandwrite: error!: Data was only partially written due to error           error 0 (Success)So why it shows:   nandwrite: error!: Input file does not fit into deviceYou can see my environmental variables in first line, I have given sufficient space of 4MB, so why an image of size  3513340 bytes (3.35 MB) won't fit in a device ? And from where this device size 393216 bytes  coming? Additional info#cat /proc/cmdlineconsole=ttyPS0,115200mtdinfo:Count of MTD devices:           4Present MTD devices:            mtd0, mtd1, mtd2, mtd3Sysfs interface supported:      yespartitions root@Xilinx-ZC702-14_7:/# cat /proc/mtddev: size erasesize namemtd0: 00500000 00010000 bootmtd1: 00020000 00010000 bootenvmtd2: 00a80000 00010000 imagemtd3: 00060000 00010000 sparealso it can be seen that:root@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd0mtd0Name:                           bootType:                           norEraseblock size:                65536 bytes, 64.0 KiBAmount of eraseblocks:          80 (5242880 bytes, 5.0 MiB)Minimum input/output unit size: 1 byteSub-page size:                  1 byteCharacter device major/minor:   90:0Bad blocks are allowed:         falseDevice is writable:             trueroot@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd1mtd1Name:                           bootenvType:                           norEraseblock size:                65536 bytes, 64.0 KiBAmount of eraseblocks:          2 (131072 bytes, 128.0 KiB)Minimum input/output unit size: 1 byteSub-page size:                  1 byteCharacter device major/minor:   90:2Bad blocks are allowed:         falseDevice is writable:             trueroot@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd2mtd2Name:                           imageType:                           norEraseblock size:                65536 bytes, 64.0 KiBAmount of eraseblocks:          168 (11010048 bytes, 10.5 MiB)Minimum input/output unit size: 1 byteSub-page size:                  1 byteCharacter device major/minor:   90:4Bad blocks are allowed:         falseDevice is writable:             trueroot@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd3mtd3Name:                           spareType:                           norEraseblock size:                65536 bytes, 64.0 KiBAmount of eraseblocks:          6 (393216 bytes, 384.0 KiB)Minimum input/output unit size: 1 byteSub-page size:                  1 byteCharacter device major/minor:   90:6Bad blocks are allowed:         falseDevice is writable:             trueSystem petalinux running on ARM cortex A9http://www.wiki.xilinx.com/Linuxhttps://github.com/XilinxDevice Treehttp://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/plain/conf/machine/boards/zedboard/zedboard-zynq7-board.dtsiPartition in Configuration ToolThis is the tool for configuration I use prior to building image.ub. See the size of jffs2 which is greater than the actual size of rootfs.jffs2 file. /sys/class/mtdroot@Xilinx-ZC702-14_7:/sys/class/mtd# ls -ld *lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd0 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd0lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd0ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd0rolrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd1 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd1lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd1ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd1rolrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd2 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd2lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd2ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd2rolrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd3 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd3lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd3ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd3roroot@Xilinx-ZC702-14_7:/sys/class/mtd#Driversroot@Xilinx-ZC702-14_7:~# ls /sys/bus/*/drivers/sys/bus/amba/drivers:/sys/bus/clocksource/drivers:/sys/bus/cpu/drivers:/sys/bus/hid/drivers:hid-generic/sys/bus/i2c/drivers:at24     dummy    pca954x/sys/bus/mdio_bus/drivers:Generic PHY/sys/bus/mmc/drivers:mmcblk/sys/bus/platform/drivers:alarmtimer       vexpress-sysreg  xilinx-gpio      xusbps-drof-flash         xadcps           xilinx_emaclite  xusbps-ehciphysmap-flash    xdevcfg          xqspips          xusbps-otgsdhci-zynq       xemacps          xslcr            xusbps-udcuio_pdrv_genirq  xgpiops          xsmcps           xwdtpsvexpress-reset   xi2cps           xuartps          zynq_remoteproc/sys/bus/rpmsg/drivers:rpmsg_proto          rpmsg_server_sample/sys/bus/scsi/drivers:ch    osst  sd    sr    st/sys/bus/sdio/drivers:/sys/bus/serio/drivers:/sys/bus/spi/drivers:m25p80/sys/bus/usb/drivers:hub          usb          usb-storage  usbfs        usbhid/sys/bus/virtio/drivers:virtio_rpmsg_busroot@Xilinx-ZC702-14_7:~#mmc driversroot@Xilinx-ZC702-14_7:/# cd /sys/bus/mmc/drivers/mmcblk/root@Xilinx-ZC702-14_7:/sys/bus/mmc/drivers/mmcblk# lsbind       mmc0:1234  uevent     unbindroot@Xilinx-ZC702-14_7:/sys/bus/mmc/drivers/mmcblk# cd mmc0\:1234/root@Xilinx-ZC702-14_7:/sys/devices/amba.0/e0100000.ps7-sdio/mmc_host/mmc0/mmc0:1234# lscid                   hwrev                 scrcsd                   manfid                serialdate                  name                  subsystemdriver                oemid                 typeerase_size            power                 ueventfwrSolutionI solved it by using configuration tool , and by making the following selections which were unslected earlier.  File systems  ---> -*- Native language support  --->    <*>   Codepage 437 (United States, Canada)    ...    <*>   NLS ISO 8859-1  (Latin 1; Western European Languages)    ... 
rootfs.jffs2 files system won't fit in mtd3
filesystems;u boot;flash memory