Live data from Hacker News

The Cult of DD

eklitzke.org

11–20 of 178 posts

Re: The Cult of DD

#11
post #2

Someone should write a wiki bot to crawl through the wikis for Arch, Debian, and so forth to help rewrite all these bad instructions.

I mean, are they bad instructions? They work for most people, and they're what most people are familliar with. If I ask a random *ix user what's wrong with my shell command, they're more likely to know about dd.

Re: The Cult of DD

#12
The author doesn't even give correct invocations of dd (on BSD, at least, for their last example with head).

I certainly agree the syntax of the arguments is strange, due to its age, but I don't agree that learning it is difficult or a waste of time.

All I've learned is that the author doesn't like dd well enough to learn it.

Re: The Cult of DD

#13
post #7

What about the `seek` argument which skips over some blocks at the beginning but still allocates them (unix "holes")? Also note that there are still unix systems out there which do not support byte-level granularity of access to block devices. On those devices you must actually use a buffer of exactly the size of the blocks on the device. Heck, linux was like this until at least v2.

Also keep in mind that specifying the block size can be important, especially for efficiently reading data. standard shell tools don't just "figure it out" automatically. They guess, and sometimes those assumptions can be incorrect resulting in lower (orders of magnitude) performance.

Re: The Cult of DD

#14
I'll point out that dd also allows you to control lots of other filesystem and OS-related things that other tools do not. See: fsync/fdatasync. I'm not aware of any shell tools that allow you to write data like that.

Re: The Cult of DD

#16
post #2

Someone should write a wiki bot to crawl through the wikis for Arch, Debian, and so forth to help rewrite all these bad instructions.

I mean, are they bad instructions? They work for most people, and they're what most people are familliar with. If I ask a random *ix user what's wrong with my shell command, they're more likely to know about dd.

They're good instructions, Brent. 13/10 would follow again.

Re: The Cult of DD

#17
A counterpoint: dd survives not because it's good or makes sense, but explicitly because it doesn't.

You wanna format a usb key? Google this, copy/paste these dd instructions, it works, move on with your life.

You wanna format a usb key using something related to cat you once saw and didn't fully understand? Have fun.

Both approaches have their weak points, but in any OS the answer to "How do I format a usb key" should not start with "Oh boy, let's have a Socratic dialog over 10 years on how to do that."

Re: The Cult of DD

#18
A counterpoint: dd survives not because it's good or makes sense, but explicitly because it doesn't.

You wanna format a usb key? Google this, copy/paste these dd instructions, it works, move on with your life.

You wanna format a usb key using something related to cat you once saw and didn't fully understand? Have fun.

Both approaches have their weak points, but in any OS the answer to "How do I format a usb key" should not start with "Oh boy, let's have a Socratic dialog over 10 years on how to do that."

Re: The Cult of DD

#19

One thing I'll often use dd for is recovering data from a failing drive. Can head ignore read errors? dd can. As far as I'm concerned, dd is lower-level than most of the other utilities and provides more control over what's happening. The author does have a point that the syntax is strange though.

I use gnu ddrescue for this for its ability to log and retry failed areas. Can make recovery or verifying data easier

Re: The Cult of DD

#20
I think dd is primarily so popular because it is used in mostly dangerous operations. Sure, using cat makes logicial sense, but if we are talking about writing directly to disk devices here I'll trust the command I read from the manual and not explore commands I think would work.

dd's "highly nonstandard syntax" comes from the JCL programming language, but it's really just another tool to read and write files. At the end of the day it's not more complex or incompatible than other unix tools. For example, you can also use tools like `pv` with dd no problem to get progress statements.

Post reply on HN