Data corrupted error on dm-verity iMX6dl

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data corrupted error on dm-verity iMX6dl

1,401 Views
Aravinthkumar
Contributor III

Hi Team,
I'm using dm-verity in yocto Linux 5.15 on the imx6dl board. On boot
when device mapper creates I'm getting a data block corrupted error,
Can you please help to fix this issue.?

Error log:

# cryptsetup 2.4.3 processing "veritysetup create rootfs
/dev/mmcblk3p3 /dev/mmcblk3p2
11757d96406b3407f8ab9109908c451a061c2fd1e66a38f830bb31ebc4cb5b51
--debug"
device-mapper: verity: 179:3: data block 13040 is corrupted
Buffer I/O error on dev dm-0, logical block 13040, async page read
device-mapper: verity: 179:3: data block 13040 is corrupted
Buffer I/O error on dev dm-0, logical block 13040, async page read
[    6.115793] Buffer I/O error on dev dm-0, logical block 13040,
async page read
[    6.130642] Buffer I/O error on dev dm-0, logical block 13040,
async page read
[    6.348502] device-mapper: verity: 179:3: reached maximum errors
[    7.966201] EXT4-fs (dm-0): unable to read superblock
mount: /new_root: can't read superblock on /dev/mapper/rootfs.

#Yocto #dm-verity #linux5.15 #initramfs #dm-verity-initramfs #veritysetup

Regards,
Aravinthkumar.

Tags (3)
0 Kudos
Reply
3 Replies

1,349 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi 

It seems hash mismatch between data and hash partition block when create mapper device, "/dev/mmcblk3p3 /dev/mmcblk3p2 11757d96406b3407f8ab9109908c451a061c2fd1e66a38f830bb31ebc4cb5b51".

Can you share your full log and whole running steps, we can help analyze dm-verity procedure.

 

Best regards

Harvey

0 Kudos
Reply

1,384 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi @Aravinthkumar 

Make sure that the disk has not been changed after the HASH tree is made. For example, such as mount, umount.  Then pay attention, after making the hash tree, do not change the content in it.

Would you like to share your processing steps? If there is still a problem.

 

Best regards

Harvey

0 Kudos
Reply

1,368 Views
Aravinthkumar
Contributor III

Thanks for your response. We have not done any changes on disk.

Below are partitions command executed for partitioning in MFG tool

sfdisk --force ${node} << EOF
${BOOT_ROM_SIZE}M,500M,0c
700M,800M,83
1600M,,83
EOF

 

Below command executed for Hash flash and Rootfs flash in MFG tool ucl file

<!-- create  rootfsHashTree -->
<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p2 ]; do sleep 1; echo waiting...; done ">Waiting for the partition ready</CMD>
<CMD state="Updater" type="push" body="send" file="firmware/core-image-base.rootfs.tar.bz2.metadata" ifdev="MX6D">HASH flash</CMD>
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%p2 bs=4096 seek=2">HASH flash to board</CMD>

 

        
<!-- burn rootfs -->
<CMD state="Updater" type="push" body="$ mkfs.ext4 -F -E nodiscard /dev/mmcblk%mmc%p3">Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p3"/>
<CMD state="Updater" type="push" body="$ mount -t ext4 /dev/mmcblk%mmc%p3 /mnt/mmcblk%mmc%p3"/>
<CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk%mmc%p3" file="firmware/core-image-base.rootfs.tar.bz2" ifdev="MX6SL MX6SLL MX6D MX6Q MX6SX">Sending and writting rootfs</CMD>

 

 

Regards,

Aravinth
<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p3">Unmounting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

0 Kudos
Reply