Redirection doesn't overwrite device files, so
cat foo.img > /dev/sda
works and should be portable. No control over the buffer size, though. cat foo.img > /dev/sda
works and should be portable. No control over the buffer size, though.