iMX6 sd_card file systems > 2GB

Pirmin Duss pirmin.duss at
Tue Apr 2 15:09:19 CEST 2019

Hello Genodeans

I have created a run script that creates a file system a SD-Card (4GB) connected to my iMX6q.

Whenever I try to create a file system that is larger than 2048MB, mkfs.ext2 fails with "Bad file descriptor while
zeroing block 953328 at end of filesystem".

This lets me think, that probably there is a overflow in a signed 32-Bit integer somewhere.

I have tried to understand how the sd_card_drv operates. If I'm understanding it right, the read_dma()/write_dma()
functions pass the block_number (64-Bit value) to the constructor of Write_multiple_block, which in turn stores it in
its arg member (32-Bit register).
But this, truncation of the block number, would not explain to me why the error occurs after 2GB, as the data on the
sd_card is accessed in blocks of 4096 bytes.

Can anybody help me with some clues, where to investigate further?

Best regards, Pirmin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the users mailing list