Talk:dd (Unix)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Free Software / Software / Computing  (Rated Start-class, Mid-importance)
WikiProject icon This article is within the scope of WikiProject Free Software, a collaborative effort to improve the coverage of free software on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (marked as Low-importance).
Taskforce icon
This article is supported by WikiProject Computing (marked as Low-importance).

Learn The DD Command External Reference[edit]

This link is to copyrighted material. It is my material, copyrighted by me. I give permission to anyone using Wikipedia to use the linked information in any way he/she sees fit. However, if one uses the material, he/she must not charge money for any derivative writings. [user: AwesomeMachine]

improve text / examples[edit]

I just /dev/zero'ed some harddisks and i found out, that the blocksize has a great performance impact

With defautl bs: 15MB/s

With bs=100M: 65MB/s

Maybe also mention that sending SIGUSR1 to gnu dd will make it print progress and writing speed.

Example code:

while sleep 1s; do killall dd -USR1 2> /dev/null; done &

dd if=/dev/zero of=/dev/hdb bs=100M

Linux or gdd specific behavior does not belong to generic WP examples[edit]

  • gdd specific is that count=0 has effect, other dd implement count=0 ~ infinity.
  • conv=fdatasync is gdd spüecific and thus does not belong into generic examples either
  • Linux specific is that lseek(2) may modifiy files (by seeking beyond the end of a file that was open for read/write). On a normal UNIX, an empty sparse file can only be created with the ftruncate() call that is not in any known dd implementation.

This was the reason why a related example has been removed from the article. Schily (talk) 12:59, 18 December 2014 (UTC)

Hello! As it seems, that behavior of lseek() isn't Linux-specific, and lseek() itself doesn't modify the file by seeking beyond its end. Please have a look at the Open Group's man page, which says this:
The lseek() function shall allow the file offset to be set beyond the end of the existing data in the file. If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
That's pretty much the same what both the Linux man page and FreeBSD man page say. Am I missing something? — Dsimic (talk | contribs) 14:53, 18 December 2014 (UTC)
Sorry, I have to correct myself. I thought that on Linux, gdd can create a sparse file using the removed example because the syscall chain: f = open("name", O_RDWR|O_CREATE|O_TRUNC), lseek(f, offset, SEE_SET), close(f) results in a sparse file of size "offset" while on other UNIXes, this just creates a zero sized file.
Correct is that gdd calls ftruncate() with count=0 which is still non-standard. A related example would need to be marked gdd specific. You may like to check the UNIX (OpenSolaris) dd source at: You may verify that there is no ftruncate() call inside and that is related to the seek=n parameter (there is however a Solaris specific oseek=n parameter - not available with gdd - that is related to ftruncate()). You may also verify that count=0 results in no record limit on Solaris, so the removed example is at least gdd specific. So on Solaris and other UNIXes, the removed example would have created an infinite sized non-sparse file. Schily (talk) 15:31, 18 December 2014 (UTC)

Non encyclopedical text in section Data recovery[edit]

Could someone explain the reason for this anecdotic text full of false claims?

Here are some basic facts:

  • GNU dd did not exist in 1984! (the first release of GNU dd is from 1992)
  • There have been of course older rescue programs than ddrescue (e.g. my sdd from 1984).

Background: In 1992, Richard Stallman asked for a free dd implementation in the USENET as he believed that no such implementation exists. At that time, I was thinking whether I should donate my sdd program.

I wrote sdd in 1984 (as a dd replacement) and as I worked for a company that made UNIX computers at that time, I had to deal with dying disks and to find solutions to recover data from such disks. I enhanced sdd to do this work.

The section in question should be corrected to meet historical facts or removed.

People who write articles in Wikipedia should first do their homework and inform themself about the background facts for an article. Schily (talk) 11:13, 20 January 2015 (UTC)

The 1984 date is suspect; the initial commit of dd.c in GNU coreutils gives an initial copyright date of 1985 (see source and log. However (like your own work before the mid-1990s), I have found no publicly available copy of the source which one could study. A better response would have been to point out the BSD version of dd, which it is easy to demonstrate that it predates either of these unpublished sources. TEDickey (talk) 01:14, 21 January 2015 (UTC)
Hello! Until we have other reliable sources available, the best we can do is to stick to available sources as closely as possible. As already discussed, having reliable sources for the events and software releases back from the 1980s and early 1990s is quite tough. — Dsimic (talk | contribs) 05:25, 21 January 2015 (UTC)
The BSD dd was derived from the AT&T UNIX V7 dd. The gdd sources have not been available before 1992, so they are most likely closed source.
Even the current text is unacceptable - it should not advertize for gdd while hiding the historic facts. Even the UNIX V7 dd had conv=noerror, so mentioning gdd here is an obvious attempt to slread false claims.
Finally the ddrescue command does not seem to be related to dd (see ddrescue WP article...) and the related text (if ever) should stay in the ddrescue article. I don't like to see bloated advertizing for an unrelatedprogram in the dd article and I don't like to see text that is proven wrong by reliable sources. Schily (talk) 13:12, 21 January 2015 (UTC)
Went ahead and trimmed it down a bit. Regarding the timeline, that's all nice, but please provide reliable sources. That's how Wikipedia works: we're summing up reliable sources, and unfortunately our own memories can't be used for that purpose. — Dsimic (talk | contribs) 13:39, 21 January 2015 (UTC)
Where exactly do you believe that reliable sources are missing? And for the rest, just naming the problem is more than enough for an unrelated program line ddrescue. People who are interested to read the related article may read there. There is no need for bloated advertizing in this article and this is of course not the intention of Wikipedia as well. Schily (talk) 14:31, 21 January 2015 (UTC)
For example, which reference covers that "the BSD dd was derived from the AT&T UNIX V7 dd"? — Dsimic (talk | contribs) 15:14, 21 January 2015 (UTC)