I am trying to mount a jffs2 file to /mnt/mtdblock0 but I keep getting errors because mtd is too small.
The commands I run to mount it are:
modprobe mtdblock modprobe mtdram total_size=49152 erase_size=128 dd if=rootfs.jffs2 of=/dev/mtdblock0 mount -t jffs2 /dev/mtdblock0 /mnt/mtd
The output for the dd command is:
dd: writing to ‘/dev/mtdblock0’: No space left on device 98305+0 records in 98304+0 records out 50331648 bytes (50 MB) copied, 0.295263 s, 170 MB/s
After I mount I do "df -h" and get:
/dev/mtdblock0 48M 48M 0 100% /mnt/mtd
From "mtdinfo /dev/mtd0":
mtd0 Name: mtdram test device Type: ram Eraseblock size: 262144 bytes, 256.0 KiB Amount of eraseblocks: 192 (50331648 bytes, 48.0 MiB) Minimum input/output unit size: 1 byte Sub-page size: 1 byte Character device major/minor: 90:0 Bad blocks are allowed: false Device is writable: true
The size of rootfs.jffs2 is 51280296 and the above command showed that only 50331648 is available, so it makes sense why it is running out of room. What I haven't been able to figure out is how to increase the size of mtd0.
I've been reading articles like this that talk about setting mtdparts, but I don't really understand the process they talk about. I've tried using flash_eraseall, increasing the total_size and erase_size parameters, setting mtdparts from the command line, and setting mtdparts from /usr/src/linux-headers-4.2.0-35/drivers/mtd/Kconfig.
Does anyone know what I can do to increase the size of mtd? Any suggestions or resources would be very appreciated. I am using Ubuntu 14.04 desktop.