# Imx6ull UBI setting mount fail

**URL:** <https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575>\
**Category:** General Discussions\
**Created:** [February 25, 2020, 7:48am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575 "2020-02-25T07:48:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 25, 2020, 7:48am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/1 "2020-02-25T07:48:59Z")

</div>

Hi Team,

I have integrated my imx6ull for NAND boot in which we are using mender code. Yocto build is successfull . But when booted we get the below error. we are not able to figure out what is the issue. Since i have not tested with mender before.

U-Boot 2018.03-4.14.98-2.2.0+g73af2fca69 (Feb 25 2020 - 07:39:36 +0000)

CPU: Freescale i.MX6ULL rev1.1 792 MHz (running at 396 MHz)  
CPU: Industrial temperature grade (-40C to 105C) at 41C  
Reset cause: POR  
Model: Freescale i.MX6 ULL 14x14 EVK Board  
Board: MX6ULL 14x14 EVK  
I2C: ready  
DRAM: 256 MiB  
NAND: 512 MiB  
MMC: FSL\_SDHC: 0  
Loading Environment from … ubi0: attaching mtd1  
ubi0 error: validate\_ec\_hdr: bad VID header offset 2048, expected 4096  
ubi0 error: validate\_ec\_hdr: bad EC header  
Erase counter header dump:  
magic 0x55424923  
version 1  
ec 0  
vid\_hdr\_offset 2048  
data\_offset 4096  
image\_seq 1848161125  
hdr\_crc 0xbb8791a9  
erase counter header hexdump:  
ubi0 error: ubi\_io\_read\_ec\_hdr: validation failed for PEB 0  
ubi0 error: ubi\_attach\_mtd\_dev: failed to attach mtd1, error -22  
UBI error: cannot attach mtd1UBI error: cannot initialize UBI, error -22UBI init error 22

\*\* Cannot find mtd partition “ubi”  
Failed (-5)  
In: serial  
Out: serial  
Err: serial  
Net: No ethernet found.  
Normal Boot  
Hit any key to stop autoboot: 0  
Saving Environment to … ubi0: attaching mtd1  
ubi0 error: validate\_ec\_hdr: bad VID header offset 2048, expected 4096  
ubi0 error: validate\_ec\_hdr: bad EC header  
Erase counter header dump:  
magic 0x55424923  
version 1  
ec 0  
vid\_hdr\_offset 2048  
data\_offset 4096  
image\_seq 1848161125  
hdr\_crc 0xbb8791a9  
erase counter header hexdump:  
ubi0 error: ubi\_io\_read\_ec\_hdr: validation failed for PEB 0  
ubi0 error: ubi\_attach\_mtd\_dev: failed to attach mtd1, error -22  
UBI error: cannot attach mtd1UBI error: cannot initialize UBI, error -22UBI init error 22

\*\* Cannot find mtd partition “ubi”  
Failed (1)  
ubi0: attaching mtd1  
ubi0 error: validate\_ec\_hdr: bad VID header offset 2048, expected 4096  
ubi0 error: validate\_ec\_hdr: bad EC header  
Erase counter header dump:  
magic 0x55424923  
version 1  
ec 0  
vid\_hdr\_offset 2048  
data\_offset 4096  
image\_seq 1848161125  
hdr\_crc 0xbb8791a9  
erase counter header hexdump:  
ubi0 error: ubi\_io\_read\_ec\_hdr: validation failed for PEB 0  
ubi0 error: ubi\_attach\_mtd\_dev: failed to attach mtd1, error -22  
UBI error: cannot attach mtd1UBI error: cannot initialize UBI, error -22UBI init error 22  
UBIFS error (pid: 1): cannot open “ubi0:rootfsa”, error -19Error reading superblock on volume ‘ubi0:rootfsa’ errno=-19!  
ubifsmount - mount UBIFS volume

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 25, 2020, 11:30am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/2 "2020-02-25T11:30:33Z")

</div>

I am using the .ubimg image.  
Also my boot env is as below

altbootcmd=run mender\_altbootcmd; run bootcmd  
baudrate=115200  
board\_name=EVK  
board\_rev=14X14  
bootargs=root=ubi0\_0 mtdparts=01806000.flash:10m(u-boot),-(ubi) ubi.mtd=ubi rootfstype=ubifs console=ttymxc4,115200 ubi.mtd=3 rootfstype=ubifs coherent\_)  
bootcmd=run mender\_setup; setenv bootargs root={mender\_kernel\_root} {mtdparts} ubi.mtd={mender\_mtd\_ubi\_dev\_name} rootfstype=ubifs {bootargs}; ubi par  
bootcmd\_mfg=run mfgtool\_args;bootz {loadaddr} {initrd\_addr} {fdt\_addr}; bootcount=1 bootdelay=3 bootlimit=1 console=ttymxc4 ethaddr=00:01:02:03:04:FF ethprime=eth1 fdt\_addr\_r=0x83000000 fdt\_file=imx6ull-iwg18m-sm.dtb fdt\_high=0xffffffff fdtcontroladdr=8eef4330 initrd\_addr=0x83800000 initrd\_high=0xffffffff loadaddr=0x80800000 mender\_altbootcmd=if test {mender\_boot\_part} = 0; then setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; else setenv mender\_boot\_part 0; setenvp  
mender\_boot\_kernel\_type=bootz  
mender\_boot\_part=0  
mender\_boot\_part\_hex=0  
mender\_boot\_part\_name=ubi0:rootfsa  
mender\_check\_saveenv\_canary=1  
mender\_dtb\_name=imx6ull-iwg18m-sm-nand.dtb  
mender\_kernel\_name=zImage  
mender\_kernel\_root=ubi0\_0  
mender\_kernel\_root\_name=ubi0:rootfsa  
mender\_mtd\_ubi\_dev\_name=ubi  
mender\_saveenv\_canary=1  
mender\_setup=if test “{mender\_saveenv\_canary}" != "1"; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test "{mender\_pre\_setup\_commands}” != “”; i  
mender\_try\_to\_recover=if test {upgrade\_available} = 1; then reset; fi mender\_uboot\_boot=dummy dummy: mender\_uboot\_dev=dummy mender\_uboot\_if=dummy mender\_uboot\_root=dummy dummy:0 mender\_uboot\_root\_name=ubi0:rootfsa mfgtool\_args=setenv bootargs console={console},${baudrate} rdinit=/linuxrc g\_mass\_storage.stall=0 g\_mass\_storage.removable=1 g\_mass\_storage.file=/fat g  
mtddevname=u-boot  
mtddevnum=0  
mtdids=nand0=01806000.flash  
mtdparts=mtdparts=01806000.flash:10m(u-boot),-(ubi)  
partition=nand0,0  
stderr=serial  
stdin=serial  
stdout=serial  
tee=no  
upgrade\_available=0

Environment size: 3376/131067 bytes

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [February 25, 2020, 5:34pm UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/3 "2020-02-25T17:34:31Z")

</div>

As far as I can recall, this means that your MTDPARAMS are incorrect for the flash parts on your device.

I’m not sure how to troubleshoot that though.

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 26, 2020, 4:21am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/4 "2020-02-26T04:21:52Z")

</div>

Below are my configuration for MTD

# Partitions

MENDER\_MTDIDS = “nand0=01806000.flash”  
MENDER\_MTDPARTS = “01806000.flash:10m(u-boot),-(ubi)”  
MENDER\_NAND\_FLASH\_PAGE\_SIZE = “4096”  
MENDER\_PARTITION\_ALIGNMENT = “4194304”  
MENDER\_STORAGE\_PEB\_SIZE = “131072”  
MENDER\_STORAGE\_TOTAL\_SIZE\_MB = “512”  
MENDER\_BOOT\_PART\_SIZE\_MB = “0”  
MENDER\_DATA\_PART\_SIZE\_MB = “10”

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [February 26, 2020, 6:57am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/5 "2020-02-26T06:57:24Z")

</div>

`MENDER_PARTITION_ALIGNMENT` is almost certainly wrong, since it is not supposed to be a power of two when using UBI. Just unset it, it should be automatically set from the other variables. The rest looks ok to me from a generic viewpoint, but I don’t know the board well, so it’s hard for me to say.

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 26, 2020, 7:32am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/6 "2020-02-26T07:32:31Z")

</div>

ERROR: u-boot-iwg18m-2018.03-r0 do\_provide\_mender\_defines: BOOTENV\_SIZE (0x20000) is too big to fit two copies inside MENDER\_RESERVED\_SPACE\_BOOTLOADER\_DATA (245760) with proper alignment. Please either: 1. Increase MENDER\_RESERVED\_SPACE\_BOOTLOADER\_DATA manually and make sure it is an _even_ multiple of MENDER\_PARTITION\_ALIGNMENT (122880). -or- 2. Decrease BOOTENV\_SIZE in the U-Boot recipe so that it can fit two copies inside MENDER\_RESERVED\_SPACE\_BOOTLOADER\_DATA. Please see [https://docs.mender.io/troubleshooting/yocto-project-build](https://docs.mender.io/troubleshooting/yocto-project-build) for more information.

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [February 26, 2020, 8:26am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/7 "2020-02-26T08:26:48Z")

</div>

I would try option 1 in this case.

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 28, 2020, 6:56am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/8 "2020-02-28T06:56:21Z")

</div>

UBIFS assert failed in ubifs\_change\_lp at 540  
UBIFS assert failed in ubifs\_release\_lprops at 278  
UBIFS assert failed in ubifs\_change\_lp at 540  
UBIFS assert failed in ubifs\_release\_lprops at 278  
UBIFS error (ubi0:0 pid 0): ubifs\_read\_node: bad node type (255 but expected 9)  
UBIFS error (ubi0:0 pid 0): ubifs\_read\_node: bad node at LEB 125:249352, LEB mapping status 0  
Not a node, first 24 bytes:UBIFS error (ubi0:0 pid 0): ubifs\_iget: failed to read inode 1, error -22  
Error reading superblock on volume ‘ubi0:rootfsa’ errno=-22!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [February 28, 2020, 10:07am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/9 "2020-02-28T10:07:26Z")

</div>

Can you post the output from:

```auto
ubireader_display_info -i UBIMG

```

where `UBIMG` is the image ending in `.ubimg`.

(If you don’t have the tool, you can install with with `sudo pip3 install python-lzo ubi-reader`)

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 28, 2020, 10:34am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/10 "2020-02-28T10:34:03Z")

</div>

Please find the output of ubireader\_display\_info

## UBI File

```
Min I/O: 4096
LEB Size: 253952
PEB Size: 262144
Total Block Count: 269
Data Block Count: 267
Layout Block Count: 2
Internal Volume Block Count: 0
Unknown Block Count: 0
First UBI PEB Number: 0

Image: 1201317210
---------------------
	Image Sequence Num: 1201317210
	Volume Name:u-boot-env-2
	Volume Name:data
	Volume Name:rootfsa
	Volume Name:rootfsb
	Volume Name:u-boot-env-1
	PEB Range: 0 - 268

	Volume: u-boot-env-2
	---------------------
		Vol ID: 4
		Name: u-boot-env-2
		Block Count: 1

		Volume Record
		---------------------
			alignment: 1
			crc: '0xf6617426'
			data_pad: 0
			errors: ''
			flags: 0
			name: u'u-boot-env-2'
			name_len: 12
			padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
			rec_index: 4
			reserved_pebs: 1
			upd_marker: 0
			vol_type: 'dynamic'

	Volume: data
	---------------------
		Vol ID: 2
		Name: data
		Block Count: 13

		Volume Record
		---------------------
			alignment: 1
			crc: '0x893aff54'
			data_pad: 0
			errors: ''
			flags: 0
			name: u'data'
			name_len: 4
			padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
			rec_index: 2
			reserved_pebs: 42
			upd_marker: 0
			vol_type: 'dynamic'

	Volume: rootfsa
	---------------------
		Vol ID: 0
		Name: rootfsa
		Block Count: 126

		Volume Record
		---------------------
			alignment: 1
			crc: '0xa297a27b'
			data_pad: 0
			errors: ''
			flags: 0
			name: u'rootfsa'
			name_len: 7
			padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
			rec_index: 0
			reserved_pebs: 947
			upd_marker: 0
			vol_type: 'dynamic'

	Volume: rootfsb
	---------------------
		Vol ID: 1
		Name: rootfsb
		Block Count: 126

		Volume Record
		---------------------
			alignment: 1
			crc: '0x775c41d'
			data_pad: 0
			errors: ''
			flags: 0
			name: u'rootfsb'
			name_len: 7
			padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
			rec_index: 1
			reserved_pebs: 947
			upd_marker: 0
			vol_type: 'dynamic'

	Volume: u-boot-env-1
	---------------------
		Vol ID: 3
		Name: u-boot-env-1
		Block Count: 1

		Volume Record
		---------------------
			alignment: 1
			crc: '0x2cb7a4fb'
			data_pad: 0
			errors: ''
			flags: 0
			name: u'u-boot-env-1'
			name_len: 12
			padding: u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
			rec_index: 3
			reserved_pebs: 1
			upd_marker: 0
			vol_type: 'dynamic'
```

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [February 28, 2020, 10:37am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/11 "2020-02-28T10:37:30Z")

</div>

Actually i am flashing u-boot and my .ubimg only onto my board. Is it required to flash any other component

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [March 2, 2020, 9:57am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/12 "2020-03-02T09:57:57Z")

</div>

It looks correct as far as I can see, and yes, flashing u-boot and ubimg is what you need. But how are you flashing exactly? Is the flashing tool aware of the mtdparts string `01806000.flash:10m(u-boot),-(ubi)`?

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [March 2, 2020, 10:16am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/13 "2020-03-02T10:16:40Z")

</div>

Yes, @kacf the Flashing tool firmware we have made the same changes. But we are getting the below:

UBIFS assert failed in ubifs\_change\_lp at 540  
UBIFS assert failed in ubifs\_release\_lprops at 278  
UBIFS assert failed in ubifs\_change\_lp at 540  
UBIFS assert failed in ubifs\_release\_lprops at 278  
UBIFS error (ubi0:0 pid 0): ubifs\_read\_node: bad node type (255 but expected 9)  
UBIFS error (ubi0:0 pid 0): ubifs\_read\_node: bad node at LEB 125:249352, LEB mapping status 0  
Not a node, first 24 bytes:UBIFS error (ubi0:0 pid 0): ubifs\_iget: failed to read inode 1, error -22  
Error reading superblock on volume ‘ubi0:rootfsa’ errno=-22!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [March 2, 2020, 10:34am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/14 "2020-03-02T10:34:06Z")

</div>

Sorry, then I’m out of ideas. Maybe you can experiment with [IMAGE\_CMD\_ubimg](https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-core/classes/mender-ubimg.bbclass#L57-L101) and tweak the settings until you get something that works.

---

<div class="post-metadata">

**Author:** ![deepanr](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@deepanr](https://hub.mender.io/u/deepanr)\
**Post date:** [March 3, 2020, 5:12am UTC](https://hub.mender.io/t/imx6ull-ubi-setting-mount-fail/1575/15 "2020-03-03T05:12:41Z")

</div>

Is UBIFS supported in MLC NAND ?
