mkfs.jffs2
Hi all,
This is my first mail to the group and is hoping for some
fruitful results from your mails. I am having problems in mounting my MTD device using mkfs.jffs2 . Though i have read mails on the group regarding mkfs.jffs2 but still i am not able to decipher my problem, so hoping a helpful hand from your side. Here are the steps that i am following:
eraseall -j /dev/mtd/1 ( -j as i need jffs2 file system /dev/mtd/1 is 1 MB partition)
mkfs.jffs2 -e 0x420 -d /tmp/Application -o image ( created image of my application which is to be put into MTD)
cp image /dev/mtd/1 ( copied the image into MTD)
mount -t jffs2 /dev/mtdblock/1 /mnt is giving errors
Node at 0x00000048 with length 0x000006d2 would run over the end of the erase block Perhaps the file system was created with the wrong erase size? jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000004c: 0x06d2 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000050: 0x39d7 instead [...]
Further such events for this erase block will not be printed
Node at 0x0000071c with length 0x000003d7 would run over the end of the erase block Perhaps the file system was created with the wrong erase size?
JFFS2: Erase block at 0x00000420 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000840: 0xf42b instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000844: 0x68c7 instead [....]
Further such events for this erase block will not be printed
Node at 0x00000af4 with length 0x000005a6 would run over the end of the erase block Perhaps the file system was created with the wrong erase size?
JFFS2: Erase block at 0x00000840 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c60: 0x6df1 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c64: 0x1283 instead [...]
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00000c60 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001080: 0x8c70 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001084: 0x8f13 instead [...]
From the output atleast i am sure that i am providing the right eraseblock to mkfs.jffs2 as Erase block is checking at an interval of 0x420 everytime. When all these messages stops , i entered into /mnt to check if there is something in the mounted device and it does shows everthing that i copied into it, so why is this error coming ? "Node at 0x00000048 with length 0x000006d2 would run over the end of the erase block" can this helps me out somehow where something is going wrong ???
Narinder
Quoted 1 line · Narinder Kumar
mkfs.jffs2 -e
0x420-d/tmp/Application
0x420 is strange size. I believe it is wrong, try to look at your Flash specification closer.
Hi ,
First of all thanx for the reply . I am using AT45DB642 NAND
Flash and it seems to have erase block of 0x420 i,e 1056 bytes. and when i have created my MTD partitions i have specified the partition sizes to be multiple of these eraseblock sizes in drivers/at91/mtd/at91_dataflash.c , My 3 partitions are 4*1024*1056 (4 GB) , 3*1024*1056 (3 GB) and 1*1024*1056 (1 GB)
Quoted 16 lines · Artem B. Bityuckiy
Quoted 3 lines · Narinder Kumar
mkfs.jffs2 -e
0x420-d/tmp/Application
0x420is strange size. I believe it is wrong, try to look at your Flash specification closer..
hi,
Quoted 6 lines
First of all thanx for the reply . I am using AT45DB642 NAND
Flash and it seems to have erase block of0x420i,e 1056 bytes. and when i have created my MTD partitions i have specified the partition sizes to be multiple of these eraseblock sizes indrivers/at91/mtd/at91_dataflash.c, My 3 partitions are 4*1024*1056 (4 GB) , 3*1024*1056 (3 GB) and 1*1024*1056 (1 GB)
Atmel AT45DB642 is DataFlash (not NAND).
mkfs.jffs2 is currently broken for DataFlash.
This is how I once fixed it. I don't know if the current mkfs.jffs2 code is different.....
In mkfs.jffs2.c in function main(). Comment out the code:
// /* If it's less than 4096, assume they meant KiB */
// if (erase_block_size && erase_block_size < 0x1000)
// erase_block_size *= 1024;
// /* If it's less than 8KiB, they're not allowed */
// if (erase_block_size < 0x2000) {
// fprintf(stderr, "Increasing erase size to 8KiB minimum\n");
// erase_block_size = 0x2000;
// }
Then run mkfs.jffs2 with the parameters "-e 2112 -n -l"
The 2112 is because JFFS2 merges multiple 528-byte or 1056-byte physical blocks into larger virtual blocks.
The 2112 is for a 4Mb dataflash device, and that value will probably differ for differently sized dataflash devices.
You should see the message:
JFFS2 write-buffering enabled (2112)
when you mount the JFFS2 partition. The size of brackets is the virtual blocks size. You should also be using the code from the MTD/JFFS2 CVS.
Regards,
Andrew Victor
SAN People (Pty) Ltd.
Quoted 39 lines · Andrew Victor
hi,
Quoted 4 lines
First of all thanx for the reply . I am using AT45DB642 NAND
Flash and it seems to have erase block of0x420i,e 1056 bytes. and when i have created my MTD partitions i have specified the partition sizes to be multiple of these eraseblock sizes indrivers/at91/mtd/at91_dataflash.c, My 3 partitions are 4*1024*1056 (4 GB) , 3*1024*1056 (3 GB) and 1*1024*1056 (1 GB)Atmel AT45DB642 is DataFlash (not NAND).
mkfs.jffs2 is currently broken for DataFlash.This is how I once fixed it. I don't know if the current mkfs.jffs2 code is different.....
In
mkfs.jffs2.cin functionmain(). Comment out the code:// /* If it's less than 4096, assume they meant KiB */
// if (erase_block_size&&erase_block_size<0x1000)
//erase_block_size*= 1024;
// /* If it's less than 8KiB, they're not allowed */
// if (erase_block_size<0x2000) {
//fprintf(stderr, "Increasing erase size to 8KiB minimum\n");
//erase_block_size=0x2000;
// }Then run mkfs.jffs2 with the parameters "-e 2112 -n -l"
The 2112 is because JFFS2 merges multiple 528-byte or 1056-byte physical blocks into larger virtual blocks.
The 2112 is for a 4Mb dataflash device, and that value will probably differ for differently sized dataflash devices.You should see the message:
JFFS2 write-buffering enabled (2112)
when you mount the JFFS2 partition. The size of brackets is the virtual blocks size. You should also be using the code from the MTD/JFFS2 CVS.
Quoted 10 lines
Regards,
Andrew Victor
SAN People (Pty) Ltd.
I tried out the solution that you mentioned but it doesn't seems to work for me. I am using ATMEL AT45DB642 which is an 8MB Dataflash. Can anyone tell me what the erase size of this DataFlash. Currently i am trying out with 1056 ( i,e 0x420 in hex) . If anyone has success in making a jffs2 partition on this dataflash and thereby reading/writing on it, please help me out. I tried out with different erasesizes but it doesn't seems to work.
Can anyone tell me what are the parameters to be
specified in drivers/at91/mtd/at91_dataflash.c where one can specify what static partitions are to be created in the data flash. I am currenlt giving static struct mtd_partition static_partitions[] =
{
{
name: "bootloader",
offset: 0,
size: 1 * 1024 * 1056, // 1 MB
mask_flags: MTD_WRITEABLE // read-only
},
{
name: "kernel",
offset: MTDPART_OFS_NXTBLK,
size: 1 * 1024 * 1056, // 1 MB
},
{
name: "ramdisk",
offset: MTDPART_OFS_NXTBLK,
size: 3 * 1024 * 1056, // 3 MB
},
{
name: "Application",
offset: MTDPART_OFS_NXTBLK,
size: MTDPART_SIZ_FULL,
}
};Am i write on these parameters ?
Regards,
Narinder
KSPL, Delhi
Please, erase your flash then mount *empty* flash. Then type 'dmesg'. You should find the information about the block size implied by JFFS2 there.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
Hi all,
I have finally mounted my dataflash's jffs2 partition. The
problem was that the driver of dataflash was taking page size in erase size function (which was 1056 bytes) and mkfs.jffs2 takes the block size. So i changed the erasesize in the driver to be block size which is 8 * page_size i,e ( 8 *1056) and then i mounted my device and it mounted without any errors.
Thanx to all
Narinder
Quoted 12 lines · Artem B. Bityuckiy
Please, erase your flash then mount *empty* flash. Then type 'dmesg'. You should find the information about the block size implied by JFFS2 there.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia..
Quoted 1 line · Narinder Kumar
mkfs.jffs2 -e
0x420-d/tmp/Application-o image
Please, post the cat /proc/mtd/ output.
Signature · 3 lines
Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.
Hi all,
When the kernel boots it shows the message:
Creating 3 MTD partitions on "Atmel AT45DB642":
0x00000000-0x00108000 : "/dev/mtd/0"
0x00108000-0x00420000 : "/dev/mtd/1"
0x00420000-0x00840000 : "/dev/mtd/2"
and cat /proc/mtd prints out
dev: size erasesize name
mtd0: 00108000 00000420 "/dev/mtd/0"
mtd1: 00318000 00000420 "/dev/mtd/1"
mtd2: 00420000 00000420 "/dev/mtd/2"
Quoted 11 lines · Artem B. Bityuckiy
Quoted 3 lines · Narinder Kumar
mkfs.jffs2 -e
0x420-d/tmp/Application-o imagePlease, post the
cat /proc/mtd/output.
Could you please look at JFFS2 output during mount - it should inform what Virtual block size it gonna use. This should appear before error messages.
Signature · 3 lines
Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.
Quoted 6 lines · Artem B. Bityuckiy
Could you please look at JFFS2 output during mount - it should inform what Virtual block size it gonna use. This should appear before error messages.
This is what is being shown when i mount the mtd block, can this help out in someway ?
$mount -t jffs2 /dev/mtdblock/1 /tmp/mmm/
Node at 0x00000048 with length 0x000006d2 would run over the end of the erase block Perhaps the file system was created with the wrong erase size? jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000004c: 0x06d2 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000050: 0x39d7 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000054: 0x0002 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000058: 0x0002 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000005c: 0x81a4 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000060: 0x022f instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000064: 0x13fb instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000068: 0xa791 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000006c: 0xa791 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000070: 0xa791 instead Further such events for this erase block will not be printed jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000420: 0xad8f instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000424: 0xcfd9 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000428: 0x4e0b instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000042c: 0x2792 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000430: 0xfa51 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000434: 0xf7bd instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000438: 0xe348 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000043c: 0xb366 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000440: 0xe86b instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000444: 0x10f2 instead
Further such events for this erase block will not be printed Node at 0x0000071c with length 0x000003d7 would run over the end of the erase block
Perhaps the file system was created with the wrong erase size? JFFS2: Erase block at 0x00000420 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000840: 0xf42b insteadjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000844: 0x68c7 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000848: 0x0184 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000084c: 0xfb02 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000850: 0x6d29 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000854: 0x5cbd instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000858: 0x23a3 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000085c: 0xe231 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000860: 0xb762 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000864: 0x3c62 instead
Further such events for this erase block will not be printed Node at 0x00000af4 with length 0x000005a6 would run over the end of the erase block
Perhaps the file system was created with the wrong erase size? JFFS2: Erase block at 0x00000840 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c60: 0x6df1 insteadjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c64: 0x1283 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c68: 0x1cd8 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c6c: 0x86dd instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c70: 0x8594 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c74; 0xb3c8 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c78: 0x8922 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c7c: 0x8d8c instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c80: 0x01f8 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000c84: 0x9726 instead
Further such events for this erase block will not be printed JFFS2: Erase block at 0x00000c60 is not formatted. It will be erased jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001080: 0x8c70 insteadjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001084: 0x8f13 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001088: 0x01fc instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000108c: 0xbf8e instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001090: 0x7b72 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001094: 0x00c0 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001098: 0x4ae2 instead Node at 0x0000109c with length 0x0000055c would run over the end of the erase block
Perhaps the file system was created with the wrong erase size? jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000010a0: 0x055c insteadjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000010a4: 0x4686 instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000010a8: 0x0002 instead
Further such events for this erase block will not be printed JFFS2: Erase block at 0x00001080 is not formatted. It will be erased [............................................................]
Best Regards,
Narinder Kumar,
New Delhi, India.