Questions tagged [dd]

dd is a traditional utility for binary data copies

dd is a command to copy input to output, granting control over the block size and allowing partial copies and progress reports as well as endianness, case and ASCII/EBCDIC translations. It is a traditional Unix command, able from the start to cope with binary data.

A major limitation of dd is that it copies blocks, and does not count partial blocks specially, so it may copy less data than intended. dd is also not particularly fast.

Although dd is very often mentioned in tutorials as a way to copy disk images, all the “magic” is in fact in the /dev/ entries. For example, to make an image from a disk partition, you can use the command

cat /dev/sda1 >sda1.img

Further information

External links

Standards and implementation manuals

874 questions
161
votes
9 answers

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 performance. In these days, though, are there situations…
kizzx2
  • 1,833
  • 2
  • 12
  • 9
161
votes
14 answers

How do I know if dd is still working?

I've not used dd all that much, but so far it's not failed me yet. Right now, I've had a dd going for over 12 hours - I'm writing an image back to the disk it came from - and I'm getting a little worried, as I was able to dd from the disk to the…
eckza
  • 2,179
  • 5
  • 16
  • 16
123
votes
5 answers

How to dd a remote disk using SSH on local machine and save to a local disk

How can I create a backup of a remote disk using SSH on my local machine and save it to a local disk? I've tried the following: ssh [email protected] "sudo dd if=/dev/sdX " | \ dd of=/home/username/Documents/filename.image` However, I…
Qu0rk
  • 1,371
  • 2
  • 10
  • 9
118
votes
20 answers

What is the fastest way to send massive amounts of data between two computers?

This is a situation I am frequently in: I have a source server with a 320GB hard-drive inside of it, and 16GB of ram (exact specs available here, but as this is an issue I run into frequently on other machines as well, I would prefer the answer to…
IQAndreas
  • 10,145
  • 21
  • 59
  • 79
92
votes
6 answers

Is it possible to mount a gzip compressed dd image on the fly?

I like to create an image backup the first time I'm backing up a system. After this first time I use rsync to do incremental backups. My usual image backup is as follows: Mount and zero out the empty space: dd if=/dev/zero of=temp.dd bs=1M rm…
g19fanatic
  • 1,023
  • 1
  • 9
  • 14
91
votes
6 answers

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 take longer than that other time last week" seem…
user4443
83
votes
2 answers

When is dd suitable for copying data? (or, when are read() and write() partial)

Short version: In what circumstances is dd safe to use for copying data, safe meaning that there is no risk of corruption due to a partial read or write? Long version — preamble: dd is often used to copy data, especially from or to a device…
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
81
votes
8 answers

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 bs=1 skip=1131 if=filtered.dump…
Rup
  • 913
  • 1
  • 7
  • 11
63
votes
2 answers

Running dd. Why resource is busy?

I just formatted microSD card, and would like to run a dd command. Unfortunately dd command fails: $ sudo dd bs=1m if=2016-02-26-raspbian-jessie-lite.img of=/dev/rdisk2 dd: /dev/rdisk2: Resource busy $ Everyone on the internet says I need to…
oldhomemovie
  • 1,627
  • 2
  • 13
  • 18
59
votes
3 answers

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:…
user129371
51
votes
5 answers

What does dd stand for?

I know very well what the command does, but man dd, info dd tell me: 'Convert and copy a file', as does GNU Coreutils. Google says its an abbreviation of everything between medicine and bad webchat slang; except someone saying it means 'data…
invert
  • 1,743
  • 1
  • 19
  • 24
50
votes
6 answers

Benchmark ssd on linux: How to measure the same things as crystaldiskmark does in windows

I want to benchmark a ssd (possibly with encrypted filesystems) and compare it to benchmarks done by crystaldiskmark on windows. So how can I measure approximately the same things as crystaldiskmark does? For the first row (Seq) I think I could do…
student
  • 17,875
  • 31
  • 103
  • 169
50
votes
8 answers

How do I suppress dd output?

I have a bash script that creates some file using dd. The problem is dd throws a great amount of output that is going to mess with the output of my script. Searching around I've found a solution: dd if=boot1h of="/dev/r$temp1" >& /dev/null Is there…
dierre
  • 625
  • 1
  • 6
  • 9
45
votes
5 answers

Full DD copy from hdd to hdd

ORIGINAL QUESTION: If I have 2 identical hard drives with the following characteristics: SATA 6.0 Gb/s 5400 rpm 3TB How long should a full dd copy take to complete? So far it's been running for 5 hours and still going... I am using Linux Ubuntu…
oshirowanen
  • 2,571
  • 15
  • 46
  • 66
43
votes
3 answers

What is the difference between 'bs', 'count' and 'seek' in dd command?

I've read many guides and forum posts describing how to use dd, but one thing I've noticed is that people always use different values for the bs=, count= and seek= switches. Please can someone explain what these switches do exactly (the man page…
Eric
  • 447
  • 1
  • 4
  • 4
1
2 3
58 59