On Technologic Systems hardware that uses the sdctl technology, eMMC and SD storage devices will use the Linux Network Block Device architecture for access.


The stumbling point is that the nbd generally has no idea how big it is, so dd will happily try marching right off the end of the device and produce an I/O error. 


One thing you can do to confirm this is what happened is to run a couple diagnostic commands with sdctl. You will probably see something like this:


# sdctl --stats
...
nbd_seek_past_eof_errs=3
...
# sdctl --dmesg
...
Jan  1 01:38:57 Access beyond EOF, sec=3776488, len=256, req=0
Jan  1 01:38:57 Access beyond EOF, sec=3776744, len=256, req=0
Jan  1 01:38:57 Access beyond EOF, sec=3776504, len=8, req=0


The way to avoid the I/O (ran past EOF) error is to always give your dd a constraint when dealing with nbd-using storage drivers, such as:


dd if=/dev/nbd1 of=/my/backup.dd bs=1M count=1024 conv=fsync


By providing a count of the blocks you want to read, you can avoid falling off the edge of your media. Blocksize and count can be almost anything, so long as bs*count <= actual media size.


Much of this content first appeared on Stack Exchange, by the same author, here:

http://electronics.stackexchange.com/questions/286649/dd-copy-emmc-for-backup-and-use-on-other-devices-gets-input-output-error/287760#287760