onekey-sec / ubi_reader

Collection of Python scripts for reading information about and extracting data from UBI and UBIFS images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRC Failed

dionisiodeniz opened this issue · comments

I am not sure if this is an error in my extraction process of a problem with the software. I extracted a nand dump with:

dd if=/dev/mtd1 of=mtd1.img bs=4096

*NOTE: /dev/mtd1 is attached to ubi which is mounted on /

Then I used the utility to extract the files from the image as:

ubireader_extract_files -l mtd1.img

It started recognizing the ubi fs but the CRC it is reading seem to be wrong:

guess_start_offset Found UBI magic number at 0
guess_filetype Looking for file type at 0
guess_filetype File looks like a UBI image.
UBI_File Open Path: mtd1.img
UBI_File File Size: 15597568
UBI_File Start Offset: 0
UBI_File End Offset: 15597568
UBI_File Block Size: 131072
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 0: LEB# -1
extract_blocks PEB: 0 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 1: LEB# -1
extract_blocks PEB: 1 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 2: LEB# -1
extract_blocks PEB: 2 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 3: LEB# -1
extract_blocks PEB: 3 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 4: LEB# -1
extract_blocks PEB: 4 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 5: LEB# -1

The output is much larger, but perhaps this is enough to understand the problem.

Any thoughts?

Hello,
If not every block is failing, these could just be empty blocks, they will show up with the log flag, it determines a valid block by checking if the CRC for the header fails, so this would be normal.

If every block fails and nothing is extracted, I would assume this is because dd does not leave out the OOB data, and to use nanddump instead. There is an option flag that omits the OOB data, I can't remember it off hand, should be in the help of nanddump.

-Jason

Thanks Jason,

So now I tried with the nanddump using the -o option that omits OOB data. However, I am still not getting any data. The CRC error are still there and yes there are some good blocks. Unfortunately, I cannot see any output. In this occasion I used the -o flag of the utility to specify the current directory.

Another thing that I noticed now is that this time I see a some sort of abort at the end of the output.

The command was:
ubireader_extract_files -o . -l mtd1.img

and the output is (sorry for the long output):

guess_start_offset Found UBI magic number at 0
guess_filetype Looking for file type at 0
guess_filetype File looks like a UBI image.
UBI_File Open Path: mtd1.img
UBI_File File Size: 15609856
UBI_File Start Offset: 0
UBI_File End Offset: 15609856
UBI_File Block Size: 131072
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 0: LEB# -1
extract_blocks PEB: 0 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 1: LEB# -1
extract_blocks PEB: 1 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 2: LEB# -1
extract_blocks PEB: 2 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 3: LEB# -1
extract_blocks PEB: 3 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 4: LEB# -1
extract_blocks PEB: 4 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 5: LEB# -1
extract_blocks PEB: 5 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 6: LEB# -1
extract_blocks PEB: 6 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 7: LEB# -1
extract_blocks PEB: 7 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 8: LEB# -1
extract_blocks PEB: 8 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 9: LEB# -1
extract_blocks PEB: 9 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 10: LEB# -1
extract_blocks PEB: 10 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 11: LEB# -1
extract_blocks PEB: 11 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 12: LEB# -1
extract_blocks PEB: 12 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 13: LEB# -1
extract_blocks PEB: 13 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 14: LEB# -1
extract_blocks PEB: 14 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 15: LEB# -1
extract_blocks PEB: 15 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 16: LEB# -1
extract_blocks PEB: 16 has possible issue EC_HDR [], VID_HDR [crc]
extract_blocks Block: PEB# 17: LEB# 0
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 18: LEB# -1
extract_blocks PEB: 18 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 19: LEB# -1
extract_blocks PEB: 19 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 20: LEB# -1
extract_blocks PEB: 20 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 21: LEB# -1
extract_blocks PEB: 21 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 22: LEB# -1
extract_blocks PEB: 22 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 23: LEB# -1
extract_blocks PEB: 23 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 24: LEB# -1
extract_blocks PEB: 24 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 25: LEB# -1
extract_blocks PEB: 25 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 26: LEB# -1
extract_blocks PEB: 26 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 27: LEB# -1
extract_blocks PEB: 27 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 28: LEB# -1
extract_blocks PEB: 28 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 29: LEB# -1
extract_blocks PEB: 29 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 30: LEB# -1
extract_blocks PEB: 30 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 31: LEB# -1
extract_blocks PEB: 31 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 32: LEB# -1
extract_blocks PEB: 32 has possible issue EC_HDR [], VID_HDR [crc]
extract_blocks Block: PEB# 33: LEB# 1
extract_blocks Block: PEB# 34: LEB# 2
extract_blocks Block: PEB# 35: LEB# 3
extract_blocks Block: PEB# 36: LEB# 4
extract_blocks Block: PEB# 37: LEB# 5
extract_blocks Block: PEB# 38: LEB# 6
extract_blocks Block: PEB# 39: LEB# 7
extract_blocks Block: PEB# 40: LEB# 8
extract_blocks Block: PEB# 41: LEB# 9
extract_blocks Block: PEB# 42: LEB# 10
extract_blocks Block: PEB# 43: LEB# 11
extract_blocks Block: PEB# 44: LEB# 12
extract_blocks Block: PEB# 45: LEB# 13
extract_blocks Block: PEB# 46: LEB# 14
extract_blocks Block: PEB# 47: LEB# 15
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 48: LEB# -1
extract_blocks PEB: 48 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 49: LEB# -1
extract_blocks PEB: 49 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 50: LEB# -1
extract_blocks PEB: 50 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 51: LEB# -1
extract_blocks PEB: 51 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 52: LEB# -1
extract_blocks PEB: 52 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 53: LEB# -1
extract_blocks PEB: 53 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 54: LEB# -1
extract_blocks PEB: 54 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 55: LEB# -1
extract_blocks PEB: 55 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 56: LEB# -1
extract_blocks PEB: 56 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 57: LEB# -1
extract_blocks PEB: 57 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 58: LEB# -1
extract_blocks PEB: 58 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 59: LEB# -1
extract_blocks PEB: 59 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 60: LEB# -1
extract_blocks PEB: 60 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 61: LEB# -1
extract_blocks PEB: 61 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 62: LEB# -1
extract_blocks PEB: 62 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 63: LEB# -1
extract_blocks PEB: 63 has possible issue EC_HDR [], VID_HDR [crc]
extract_blocks Block: PEB# 64: LEB# 0
extract_blocks Block: PEB# 65: LEB# 0
extract_blocks Block: PEB# 66: LEB# 1
extract_blocks Block: PEB# 67: LEB# 2
extract_blocks Block: PEB# 68: LEB# 3
extract_blocks Block: PEB# 69: LEB# 4
extract_blocks Block: PEB# 70: LEB# 5
extract_blocks Block: PEB# 71: LEB# 6
extract_blocks Block: PEB# 72: LEB# 7
extract_blocks Block: PEB# 73: LEB# 8
extract_blocks Block: PEB# 74: LEB# 9
extract_blocks Block: PEB# 75: LEB# 10
extract_blocks Block: PEB# 76: LEB# 11
extract_blocks Block: PEB# 77: LEB# 12
extract_blocks Block: PEB# 78: LEB# 13
extract_blocks Block: PEB# 79: LEB# 14
extract_blocks Block: PEB# 80: LEB# 15
extract_blocks Block: PEB# 81: LEB# 16
extract_blocks Block: PEB# 82: LEB# 17
extract_blocks Block: PEB# 83: LEB# 18
extract_blocks Block: PEB# 84: LEB# 19
extract_blocks Block: PEB# 85: LEB# 20
extract_blocks Block: PEB# 86: LEB# 21
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 87: LEB# -1
extract_blocks PEB: 87 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 88: LEB# -1
extract_blocks PEB: 88 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 89: LEB# -1
extract_blocks PEB: 89 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 90: LEB# -1
extract_blocks PEB: 90 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 91: LEB# -1
extract_blocks PEB: 91 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 92: LEB# -1
extract_blocks PEB: 92 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 93: LEB# -1
extract_blocks PEB: 93 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 94: LEB# -1
extract_blocks PEB: 94 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 95: LEB# -1
extract_blocks PEB: 95 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 96: LEB# -1
extract_blocks PEB: 96 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 97: LEB# -1
extract_blocks PEB: 97 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 98: LEB# -1
extract_blocks PEB: 98 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 99: LEB# -1
extract_blocks PEB: 99 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 100: LEB# -1
extract_blocks PEB: 100 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 101: LEB# -1
extract_blocks PEB: 101 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 102: LEB# -1
extract_blocks PEB: 102 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 103: LEB# -1
extract_blocks PEB: 103 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 104: LEB# -1
extract_blocks PEB: 104 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 105: LEB# -1
extract_blocks PEB: 105 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 106: LEB# -1
extract_blocks PEB: 106 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 107: LEB# -1
extract_blocks PEB: 107 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 108: LEB# -1
extract_blocks PEB: 108 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 109: LEB# -1
extract_blocks PEB: 109 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 110: LEB# -1
extract_blocks PEB: 110 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 111: LEB# -1
extract_blocks PEB: 111 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 112: LEB# -1
extract_blocks PEB: 112 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 113: LEB# -1
extract_blocks PEB: 113 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 114: LEB# -1
extract_blocks PEB: 114 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 115: LEB# -1
extract_blocks PEB: 115 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 116: LEB# -1
extract_blocks PEB: 116 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 117: LEB# -1
extract_blocks PEB: 117 has possible issue EC_HDR [], VID_HDR [crc]
vid_hdr CRC Failed: expected 0xb730eb2 got 0xffffffff
extract_blocks Block: PEB# 118: LEB# -1
extract_blocks PEB: 118 has possible issue EC_HDR [], VID_HDR [crc]
read Error: Block ends at 15728640 which is greater than file size 15609856
extract_blocks Fatal: PEB: 119: Bad Read Offset Request

The last bit there just means the image size is not aligned with the block size, try adding the option"--end-offset 15597568" and see what that does. It is pretty easy to not dump the entire NAND and miss the last part of it. That end offset is just making the data you got evenly divisible by 131072 which is the PEB size.

If that doesn't work out, I can take a look at the image if you like, if you have a place to post it for download.
-Jason

Jason,

Your suggestion did not work.

I just sent you a link to the file to your email.

I really appreciate the help.

--Dio

Hi Dio,

I took a look at it, the problem I'm getting is there are no layout blocks, there should be two, they contain vital information about the UBI image. I'm guessing there is some data missing from the end of the dump, which is why the size is not matching up with the offset. This is the most common problem with NAND dumps I see. Make sure the length option for nanddump is correct and you're getting the whole thing. IIRC I had trouble once because the length I was reading in /proc/mtd was off by one block. You might also try some of the bad block settings, apparently that can have some different effects on things.

-Jason

It seems that I was exhausting the available space when getting the dump. Now I redirected the dump to a partition with a larger space. Unfortunately, I am still getting errors. The last one I got was 👍

...
extract_blocks PEB: 126 has possible issue EC_HDR [], VID_HDR [crc]
extract_blocks Block: PEB# 127: LEB# 1
group_pairs Layout blocks found at PEBs: [[64, 127]]
description Create Volume: main_boot, ID: 0, Block Cnt: 16
description Create Volume: alt_boot, ID: 1, Block Cnt: 22
description Created Image: 1942783186, Volume Cnt: 2
create_output_dir Created output path: ubifs-root/1942783186/alt_boot
UBIFS UBIFS Common Header file addr: 8523776
UBIFS Fatal: Super block error: Wrong node type.

The utility is able to create some initial directory hierarchy but only a couple of folders with nothing inside.

One thing that I am actually doing is dumping the /dev/mtd1 device while the device is mounted. From the symptoms that I am seeing this seems to be part of the problem (the file if in the middle of some modifications). However, since this is the root file system I cannot umounted. So I have two additional questions:

  1. Do you think it is part of the problem that mtd1 is mounted?
  2. if that is the case, Do you know of some technique to get the dump without umounting it?

Hi Dio,

It is very possible, the UBI/UBIFS system is doing something while you are dumping the NAND. This script is completely incapable of dealing with certain scenarios that could come up with NAND dumps. I have had success in the past doing it, but it was on a new device and/or freshly updated one.

Basically this error is because its not finding the UBIFS Superblock in the first Logical Erase Block. I am not sure why this is. It is not unheard of for a manufacturer to fiddle with the UBI/UBIFS system to do things a little different. It could also be a script error or procedure error with it being only in the first LEB.

If you want to post up the new dump I can take a look at it.

-Jason

Hi Dio,

I just extracted the images, ubireader_extract_images to get the UBIFS images. There is no filesystem here, these are two Linux kernels. I tried extracting the initramfs to see if the root filesystem was in there, it was empty except for one /dev entry. So I think perhaps mtd1 is not the root filesystem. I would think if they exist, mtd2 or 3 maybe?

-Jason

Jason,

Actually i was looking for the kernel images because i need to get the configuration parameters to compile a kernel module for that system. How did you get the extractor to work? Where are the kernels?

--Dio

Hi Dio,

The command is "ubireader_extract_images mtd1-4.img" This is normally used for extracting the UBIFS from the UBI image, but in this case, there is no file system (UBIFS) part, just raw data. The kernels are named

img-1942783186_vol-alt_boot.ubifs
img-1942783186_vol-main_boot.ubifs

after extraction, they'll be in the output folder like normal. They are only named that because ubi_reader thinks it is UBIFS data, most of the time there is one more step involved, parsing the filesystem, before files are extracted. First time I've seen this.

-Jason

Excellent. I see them now. I will now try to see if I can get the parameters.

Thanks a lot Jason.

Awesome, good to hear.

Jason,

I just now had the time to return to this project. I was trying to extract the parameters from the images but I was not able to do that. More specifically when I run "file" on them it just return "data" instead of something like "executable 32 bits..." Am I missing something? How did you know these were kernel images?

Hi Dio,

Very sorry it took this long to reply, I didn't get an email informing me you had responded.

I figured it out basically just opening the files in Okteta, any hex editor would do, scrolled looking for anything text, you could also run strings. There is one "Uncompressing Linux" that gave away what it was.

If you want to extract it further, the first part of the files is the gzip program that extract the actual kernel, scripts like this might help https://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage It will get rid of the gzip compression. It is a lot to look through, I did see what looks like the cmdline args around 0x00298E70

-Jason