When I try to use dd to flash images I see some issues when the seek value exceeds 2GB.(i.e. bs * seek >= 2GB).

dd bs=512 count=8 if=sample.img of=/dev/block/mmcblk0 seek=4194304
dd: /dev/block/mmcblk0: Invalid argument

When I try with a value (2GB-1), the dd command succeeds. Can anyone point out why exactly the 2GB limit for the seek value exists? Is it related to filesystem (FAT limit?)? Is there any easy workaround to get dd work past the seek limit?

dd bs=512 count=8 if=sample.img  of=/dev/block/mmcblk0 seek=4194303                         <
8+0 records in
8+0 records out
4096 bytes transferred in 0.001 secs (4096000 bytes/sec)

Apparently, the issue is seen only for seek values in the range (2GB-4GB). The dd succeeds beyond 4GB - very strange.

  • I havent tried another dd binary. But I guess the issue is similar to the one mentioned lists.busybox.net/pipermail/busybox/2012-July/078193.html I coudln't download the patch to fix the issue. I'm writing to the mmcblk0 itself (not to a specific partition). – AIB Aug 30 '18 at 6:17
  • For me, androids toolbox dd is failing. I tried another dd (toybox) and it worked fine. – AIB Aug 31 '18 at 11:21

Don't use busybox dd (compiled with bionic libc). Instead you may use static dd binary from gnu coreutils compiled with glibc or musl. On my device all binaries work well; Android's toolbox dd, meefik's busybox dd and statically built dd.

Bionic is confirmed to be buggy with large files.

PS: Playing with eMMC is dangerous, particularly when testing buggy dd. dd is a killer, in my opinion. You can accidentally overwrite initial few bytes of mmcblk0 rendering your device useless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.