Linked Questions
58 questions linked to/from When is dd suitable for copying data? (or, when are read() and write() partial)
0 votes
1 answer
644 views
dd bs=X count=1 reads less than X bytes [duplicate]
I have dd from GNU coreutils 8.32. When I run { echo a; sleep 1; echo b; } | dd bs=4 count=1 then I get a 0+1 records in 0+1 records out 2 bytes copied, 2.0381e-05 s, 98.1 kB/s dd terminates during ...
1 vote
0 answers
51 views
osx - dd command behaving weirdly [duplicate]
I've been using dd for a couple of years now, most of the time successfully. I usually use it to dd Linux images to USB drives. My workflow doing so is as such: convert .iso image to a .img format ...
1 vote
0 answers
40 views
Reading from stdin `dd` copies more data than reading the same thing from file [duplicate]
I encountered weird behaviour of the dd tool: I downloaded compressed "newsystem.iso.xz". I ran xz -d --stdout newsystem.iso.xz | dd of=/dev/sdb bs=1M conv=sync. The decompressed "*....
174 votes
9 answers
59k views
dd vs cat -- is dd still relevant these days?
I recently realized we can use cat as much as dd, and it's actually faster than dd I know that dd was useful in dealing with tapes where block size actually mattered in correctness, not just ...
89 votes
8 answers
123k views
Best way to remove bytes from the start of a file?
Today I had to remove the first 1131 bytes from an 800MB mixed text / binary file, a filtered subversion dump I'm hacking for a new repository. What's the best way to do this? To start with I tried dd ...
103 votes
8 answers
81k views
Is there a way to determine the optimal value for the bs parameter to dd?
On occasion I've seen comments online along the lines of "make sure you set 'bs=' because the default value will take too long," and my own extremely-unscientific experiences of, "well that seemed to ...
65 votes
3 answers
72k views
Is it better to use cat, dd, pv or another procedure to copy a CD/DVD?
Background I'm copying some data CDs/DVDs to ISO files to use them later without the need of them in the drive. I'm looking on the Net for procedures and I found a lot: Use of cat to copy a medium: ...
34 votes
3 answers
32k views
Create random data with dd and get "partial read warning". Is the data after the warning now really random?
I create a 1TB file with random data with dd if=/dev/urandom of=file bs=1M count=1000000. Now I check with kill -SIGUSR1 <PID> the progress and get the following: 691581+0 Datensätze ein 691580+...
41 votes
4 answers
41k views
Why does dd from /dev/random give different file sizes?
I am running the following command on an ubuntu system: dd if=/dev/random of=rand bs=1K count=2 However, every time I run it, I end up with a file of a different size. Why is this? How can I ...
36 votes
7 answers
34k views
How can I use DD to migrate data from an old drive to a new drive?
I am upgrading the internal SATA hard drive on my laptop from a 40G drive to a 160G drive. I have a Linux/Ubuntu desktop which has a SATA card. I would actually like to do the same thing for a couple ...
27 votes
5 answers
52k views
Why specify block size when copying devices of a finite size?
In online tutorials it is often suggested to use the following command to copy a CDROM to an ISO image: $ dd if=/dev/dvd of=foobar.iso bs=2048 Why must the block size be specified? I noticed that in ...
21 votes
6 answers
3k views
Is there another simple way to append line to end of file other than `>>`?
Recently I'm echoing short sentences to a tree_hole file. I was using echo 'something' >> tree_hole to do this job. But I was always worried of what if I mis-input of > instead of >>, ...
22 votes
5 answers
19k views
Does dd do any kind of verification?
I'm using dd to copy data from an old hard drive to a new one. I want to be sure that the data's integrity is secure. On this answer, Gilles says If [dd] terminated successfully, then the backup is ...
35 votes
3 answers
36k views
How to unzip and dd a disk image to an SD Card with a single command?
I am under the following restrictions: I have a 1.0 GB .zip file on my computer which contains one file, a disk image of raspbian. When uncompressed, this file is 3.2 GB large and named 2015-11-21-...
15 votes
5 answers
14k views
How can I get the size of stdin?
I'm about to compress a large directory and I want to know how large, exactly, the resulting file will be. I've tried using du: $ tar -cv dir | du -h - du: cannot access '-': No such file or ...