`dd` is a real power user command, I’d prefer that it isn’t doing “intelligent” things, especially not by default.
`dd` is a real power user command, I’d prefer that it isn’t doing “intelligent” things, especially not by default.
In general, I don't see the point in manually specifying block sizes most of the time. What I want nearly always the maximum performance, and that should be possible to derive from the hardware, and/or benchmarking.
What about uses like say, skipping data? seek= and skip= are in block sizes, that may not be ideal for performance.
A smart tool should be able to write in 1 MB blocks and yet still skip 512 bytes.
cp file.iso /dev/sda && sync
not sure why it's necessary only sometimes!If you want to be more targeted:
blockdev --flushbufs /dev/sda cat foo.img > /dev/sda
works and should be portable. No control over the buffer size, though.Whatever behaviour you’re describing is not how POSIX mandates cp to work. In fact you can do this with busybox too.
cp will open("/dev/sda", O_WRONLY | O_TRUNC) and simply start writing to that file descriptor.