i.MX8MM: Formatting eMMC with mkfs.ext4 in initramfs environment

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.MX8MM: Formatting eMMC with mkfs.ext4 in initramfs environment

2,569 次查看
harsh1621
Contributor II

I am working with Linux Kernel 4.19.35 for Arm64. My imx8mm-var-dart board has two storage devices - SD Card and eMMC. I need to partition, format and flash certain contents from the SD Card onto the eMMC.

For my use case, I intend to perform these manipulations from an intramfs environment using shell scripts triggered by init, and reboot the system into the flashed RFS after the above eMMC modification.

However, after successfully partitioning the eMMC, I am unable to create an ext4 filesystem on any of the created partitions.

mkfs.ext4 -v /dev/mmcblk2p1 -L "part1"

The command above throws a segmentation fault after successfully discarding the blocks in the first partition. 

The following is the output of the mkfs.ext4 operation:

mk2efs 1.45.6 (20-Mar-2020)
fs_types for mk2efs.conf resolution: 'ext4'
Discarding device blocks:
done
Segmentation fault

Before partitioning and formatting, the eMMC already had some data and a partition table, hence I am not using the -E nodiscard option as I need to get rid of the old blocks. 

However, the above segmentation fault message is way too minimal to guess anything for me. Any pointers to what might be going wrong would be very helpful.

Note: The commands fdisk -l -u and mmc part (from u-boot console) list the new partitions properly on the eMMC. Hence, I can be sure that there are no issues in the creation of partitions.

0 项奖励
回复
1 回复

2,549 次查看
nxf54947
NXP Employee
NXP Employee

Hi @harsh1621,

If you are are able, could you use .ext3 at partitioning? Here is an snippet from our kernel examples for downloading  an image from RAM to the EMMC (please use a different partition):

mmc=`cat /tmp/mmcdev`;
 mkfs.ext3 -F -E nodiscard /dev/mmcblk${mmc}p2 

 

I have also found a similar post that could help you out:

How to flash eMMC from an SDCard on i.MX6Q ? 

 

Finally, I also believe that this documentation could help you out:
i.MX Linux® User's Guide 

Regards,

Ruben

0 项奖励
回复