It’s been a while since the last installment in my Little Things Doth Crabby Make series. The full series can be found here. So, what’s made me crabby this time? Well, when a Linux utility returns a success code to me I expect that to mean it did what I told it to do. Well…

What’s 4K Between Friends?
Really? I’m just picky! If I use dd(1) to write 2GB (2 * 2^30 sort of 2GB by the way) I’m not looking for a successful transfer of (2 * 2 ^ 30) – 4096 bytes! Imagine that.

Folks, don’t trust the return code from dd(1). I’ve been burned more than once.

Is He Totally Crazy? Using dd(1) with a 2GB write size?
Sure, why not? If it doesn’t want to do what I ask it is supposed to fail the command, not lose data.

Yes, Freek, good catch. I discovered the erroneous success code before I plugged the wc in. I though the wc would make the point easier to understand. I’ll quicklu follow up with proof that it fails the same was with a file to file dd.