1

Ok so have been trying to look some settings from a jffs2 partition I extracted from a nand dump I had done previously Here ----> https://forum.openwrt.org/viewtopic.php?id=67564

Steps I have preformed are as follows

convert from big endian to little endian
$ jffs2dump -r -e  1D0000_converted.jffs2 -b 1D0000.jffs2

Create the mtdblock devices
$ mkdir /dev/mtdblock
$ mknod /dev/mtdblock/0 b 31 0
$ mknod /dev/mtdblock/1 b 31 1
$ mknod /dev/mtdblock/2 b 31 2

Mount the Image
$ modprobe jffs2
$ modprobe mtdram total_size=8192 erase_size=128
$ modprobe mtdblock
$ dd if=1D0000_converted.jffs2 of=/dev/mtdblock/0
$ mkdir /mnt/jffs2
$ mount -t jffs2 /dev/mtdblock/0 /mnt/jffs2

Now when I browse to /mnt/jffs2 I can see all the files and directory's but i cant open any of the files i just get Could not open the file"mnt/jffs2/bank_1/etc/config/ethernet" Unexpected error: Error reading from the file: input/output error

dmesg output:

[  100.279943] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[  222.654270] jffs2: Node at 0x0003ffac with length 0x00000099 would run over the end of the erase block
[  222.654272] jffs2: Perhaps the file system was created with the wrong erase size?
[  222.654274] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffb0: 0x0099 instead
[  222.654275] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffb4: 0x9a59 instead
[  222.654276] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffb8: 0x01a7 instead
[  222.654277] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffbc: 0x0465 instead
[  222.654278] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffc0: 0x81a4 instead
[  222.654279] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffc8: 0x9edc instead
[  222.654280] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffcc: 0x5ab1 instead
[  222.654281] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffd0: 0x5ab1 instead
[  222.654282] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffd4: 0x5ab1 instead
[  222.654283] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003ffd8: 0x9e7c instead
[  222.654284] jffs2: Further such events for this erase block will not be printed
[  222.654286] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040000: 0xfd99 instead
[  222.654287] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040004: 0x1d95 instead
[  222.654288] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040008: 0x8d33 instead
[  222.654289] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004000c: 0xb6c0 instead
[  222.654290] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040010: 0x9c47 instead
[  222.654291] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040014: 0x76b6 instead
[  222.654292] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040018: 0x86e5 instead
[  222.654293] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004001c: 0x1520 instead
[  222.654294] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040020: 0x193f instead
[  222.654295] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040024: 0x7b93 instead
[  222.654295] jffs2: Further such events for this erase block will not be printed
[  222.654355] jffs2: Node at 0x0005ff60 with length 0x000003d1 would run over the end of the erase block
[  222.654356] jffs2: Perhaps the file system was created with the wrong erase size?
[  222.654357] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060000: 0x87a0 instead
[  222.654358] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060004: 0x3003 instead
[  222.654359] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060008: 0x3926 instead
[  222.654360] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0006000c: 0x71f6 instead
[  222.654361] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060010: 0x799e instead
[  222.654362] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060014: 0xd7f5 instead
[  222.654371] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060018: 0x6e18 instead
[  222.654372] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0006001c: 0x73ee instead
[  222.654373] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060020: 0xccfc instead
[  222.654374] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00060024: 0x6bfd instead
[  222.654375] jffs2: Further such events for this erase block will not be printed
[  222.654441] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0000: 0x4c22 instead
[  222.654452] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0004: 0x6e15 instead
[  222.654453] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0008: 0xe048 instead
[  222.654454] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c000c: 0xf50f instead
[  222.654455] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0010: 0xd19e instead
[  222.654456] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0014: 0xf35c instead
[  222.654457] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0018: 0x9cc2 instead
[  222.654458] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c001c: 0xd25b instead
[  222.654459] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0020: 0x7745 instead
[  222.654460] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0024: 0x4abf instead
[  222.654461] jffs2: Further such events for this erase block will not be printed
[  222.654526] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0000: 0xa1c6 instead
[  222.654527] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0004: 0xd9d2 instead
[  222.654528] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0008: 0xa856 instead
[  222.654529] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a000c: 0x4019 instead
[  222.654530] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0010: 0xd580 instead
[  222.654531] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0014: 0xb7af instead
[  222.654532] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0018: 0xe93d instead
[  222.654533] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a001c: 0x7b96 instead
[  222.654534] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0020: 0x9cda instead
[  222.654535] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002a0024: 0xcd67 instead
[  222.654536] jffs2: Further such events for this erase block will not be printed
[  222.654992] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0000: 0x8a6d instead
[  222.654993] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0004: 0x20c1 instead
[  222.654994] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0008: 0x0de1 instead
[  222.654995] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c000c: 0x8841 instead
[  222.654996] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0010: 0xb9fb instead
[  222.654997] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0014: 0x3943 instead
[  222.654998] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0018: 0xf380 instead
[  222.654999] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c001c: 0x17a6 instead
[  222.655000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0020: 0xb72f instead
[  222.655001] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002c0024: 0x0afb instead
[  222.655002] jffs2: Further such events for this erase block will not be printed
[  222.655459] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0000: 0xf2aa instead
[  222.655461] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0004: 0x314d instead
[  222.655462] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0008: 0xbd28 instead
[  222.655463] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e000c: 0x1bc2 instead
[  222.655464] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0010: 0xde65 instead
[  222.655465] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0014: 0x8c02 instead
[  222.655466] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0018: 0x17f9 instead
[  222.655467] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e001c: 0x1c15 instead
[  222.655468] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0020: 0xa016 instead
[  222.655469] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x002e0024: 0x993d instead
[  222.655469] jffs2: Further such events for this erase block will not be printed
[  222.655505] jffs2: Old JFFS2 bitmask found at 0x002e2418
[  222.655506] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[  222.655838] jffs2: Old JFFS2 bitmask found at 0x002f9888
[  222.655839] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[  222.655932] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300000: 0xbc51 instead
[  222.655933] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300004: 0x10fd instead
[  222.655934] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300008: 0x1848 instead
[  222.655935] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0030000c: 0xfa5f instead
[  222.655936] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300010: 0x623d instead
[  222.655937] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300014: 0x293c instead
[  222.655938] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300018: 0xd001 instead
[  222.655939] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0030001c: 0x56b9 instead
[  222.655940] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300020: 0x2eb1 instead
[  222.655941] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00300024: 0x2fb2 instead
[  222.655942] jffs2: Further such events for this erase block will not be printed
[  222.656045] jffs2: Old JFFS2 bitmask found at 0x00307510
[  222.656046] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[  222.656399] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320000: 0x666b instead
[  222.656401] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320004: 0x2ed2 instead
[  222.656402] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320008: 0xdc4c instead
[  222.656403] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0032000c: 0x9009 instead
[  222.656404] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320010: 0xf72f instead
[  222.656405] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320014: 0x3ba0 instead
[  222.656406] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320018: 0x08e7 instead
[  222.656407] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0032001c: 0xfcb5 instead
[  222.656408] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320020: 0xec5b instead
[  222.656409] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00320024: 0x28f9 instead
[  222.656409] jffs2: Further such events for this erase block will not be printed
[  222.656916] jffs2: notice: (3096) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 1 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  232.551529] jffs2: compression type 0x08 not available
[  232.551533] jffs2: Error: jffs2_decompress returned -5
[  232.551535] jffs2: read_cache_page() returned error: -5
[  232.551537] jffs2: Error garbage collecting node at 00040224!
[  232.551539] jffs2: No space for garbage collection. Aborting GC thread
[  260.444456] jffs2: compression type 0x08 not available
[  260.444460] jffs2: Error: jffs2_decompress returned -5
[  260.444629] jffs2: compression type 0x08 not available
[  260.444631] jffs2: Error: jffs2_decompress returned -5
[  260.444690] jffs2: compression type 0x08 not available
[  260.444692] jffs2: Error: jffs2_decompress returned -5
[  260.444870] jffs2: compression type 0x08 not available
[  260.444871] jffs2: Error: jffs2_decompress returned -5
[  260.444933] jffs2: compression type 0x08 not available
[  260.444934] jffs2: Error: jffs2_decompress returned -5
[  260.445129] jffs2: compression type 0x08 not available
[  260.445130] jffs2: Error: jffs2_decompress returned -5
[  260.445189] jffs2: compression type 0x08 not available
[  260.445190] jffs2: Error: jffs2_decompress returned -5
[  260.445263] jffs2: compression type 0x08 not available
[  260.445264] jffs2: Error: jffs2_decompress returned -5
[  262.212738] jffs2: compression type 0x08 not available
[  262.212742] jffs2: Error: jffs2_decompress returned -5
[  262.213648] jffs2: compression type 0x08 not available
[  262.213651] jffs2: Error: jffs2_decompress returned -5
[  262.213760] jffs2: compression type 0x08 not available
[  262.213762] jffs2: Error: jffs2_decompress returned -5
[  262.213910] jffs2: compression type 0x08 not available
[  262.213913] jffs2: Error: jffs2_decompress returned -5
[  262.214018] jffs2: compression type 0x08 not available
[  262.214021] jffs2: Error: jffs2_decompress returned -5
[  262.214165] jffs2: compression type 0x08 not available
[  262.214167] jffs2: Error: jffs2_decompress returned -5
[  262.214254] jffs2: compression type 0x08 not available
[  262.214255] jffs2: Error: jffs2_decompress returned -5
[  262.214322] jffs2: compression type 0x08 not available
[  262.214323] jffs2: Error: jffs2_decompress returned -5
[  262.214391] jffs2: compression type 0x08 not available
[  262.214393] jffs2: Error: jffs2_decompress returned -5
[  262.214501] jffs2: compression type 0x08 not available
[  262.214502] jffs2: Error: jffs2_decompress returned -5
[  262.214700] jffs2: compression type 0x08 not available
[  262.214701] jffs2: Error: jffs2_decompress returned -5
[  262.214789] jffs2: compression type 0x08 not available
[  262.214791] jffs2: Error: jffs2_decompress returned -5
[  262.214877] jffs2: compression type 0x08 not available
[  262.214879] jffs2: Error: jffs2_decompress returned -5
[  262.215052] jffs2: compression type 0x08 not available
[  262.215054] jffs2: Error: jffs2_decompress returned -5
[  262.215192] jffs2: compression type 0x08 not available

Nothing i have found with my google foo has been much help. Not sure what to do next ? has anyone had this problem before ?

  • 1
    if your problem was solved, please either accept an existing answer, add and accept your own answer, or delete the question if it was wrongly stated. – Igor Skochinsky Dec 14 '16 at 11:06
3

It's hard to say without the image but at a guess, maybe you did not properly strip the OOB bytes from the dump, or the block size is wrong.

Instead of mounting it maybe try just extracting the files from the image, e.g. using this script.

  • I was able to extract and read the squashfs part of the NAND dump after I had removed the OOB part from the dump. – Path-E-Tech Management Oct 16 '16 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.