A common Unix program whose primary purpose is the low-level copying and conversion of raw data.

learn more… | top users | synonyms

52
votes
2answers
3k views

Why is piping 'dd' through gzip so much faster than a direct copy?

I wanted to backup a path from a computer in my network to another computer in the same network over a 100 Mbit/s line. For this I did dd if=/local/path ...
21
votes
1answer
11k views

Mac OSX - Why is /dev/rdisk 20 times faster than /dev/disk

According to the rasbery pi documentation, You can load your OS to a flash card with either /dev/disk or /dev/rdisk. rdisk stands for raw disk. /dev/disk is a block level device, why would rdisk ...
19
votes
4answers
24k views

How can I find what /dev my DVD-drive is?

I'm on Mac OS X, have a DVD in the DVD-drive and can look at it in the Finder. I'd like to try to create an iso of it by using the dd command. But to do that I need to know what device to use as an ...
18
votes
5answers
13k views

Why is my /dev/random so slow when using dd?

I am trying to semi-securely erase a bunch of hard drives. The following is working at 20-50Mb/s dd if=/dev/zero of=/dev/sda But dd if=/dev/random of=/dev/sda seems not to work. Also when I ...
17
votes
5answers
19k views

How Do I Find The Hardware Block Read Size for My Hard Drive?

I'm trying to figure out the optimal size for a large copy from my hard drive using dd. I'm trying to figure out what the best blocksize to use it, which I would assume is the hardware block size for ...
17
votes
2answers
32k views

creating a bootable USB from command line on linux

I have a CD that's created from an ISO file which I use to install a custom version of Ubuntu via plop linux. The cd works fine but I'd like to use a bootable USB drive instead. I used the command dd ...
16
votes
2answers
37k views

How do I create a 1GB random file in Linux?

I am using the bash shell and would like to pipe the out of the command openssl rand -base64 1000 to the command dd such as dd if={output of openssl} of="sample.txt bs=1G count=1`. I think I can use ...
16
votes
4answers
33k views

Why does 'dd' not work for creating bootable USB?

Recently I wanted to create a bootable USB of Linux mint. I found that there was a lot of conflicting advice/experience about whether the 'dd' command could be used to create a bootable USB. I decided ...
14
votes
4answers
31k views

How to create VHD disk image from a Linux live system?

Once more, I have to resort at the experts here at SuperUser, as my other sources (mainly Google ;-)) didn't prove very helpful... So basically, I would like to create a VHD image of a physical disk ...
12
votes
3answers
13k views

How to pad a file with “FF” using dd?

How to pad a file with 0xFF using dd? This command will pad the output file with zeroes until the file size reaches 100 KB: dd if=inputFile.bin ibs=1k count=100 of=paddedFile.bin conv=sync ...
11
votes
5answers
6k views

How to erase a hard drive with unwritable sectors?

So I have a hard drive that is failing. I want to erase the data on it before sending it for replacement. I'm trying to use dd if=/dev/zero of=/dev/sdXX, but it stops at the first write error. How can ...
11
votes
4answers
6k views

How to use Cygwin to copy an image from an SD memory card

Long story short, I'm working on a Windows 7 machine and I'd like to strip the image off an SD card (backing up the card from a Raspberry Pi). I'm trying to use Cygwin, but not having much success. ...
10
votes
6answers
1k views

What happens if I dd zeros to the drive where dd resides?

Will this command: dd if=/dev/zero of=/dev/sda bs=1M succeed if the dd command was originally on /dev/sda? Will this complete because dd is in memory at that time?
10
votes
1answer
4k views

dd performance on Mac OS X vs. Linux

I was trying to copy an iso of the windows installer onto a hard drive to avoid burning a disk. I first tried Disk Utility's restore function, however it didn't like the ISO for some reason. Then I ...
10
votes
3answers
17k views

How do I create an MBR on a USB stick using DD command line tool

Okay I'm trying to create a BOOTABLE Windows7 image on a USB key from a Mac running Lion. My image is .iso format. I tried: sudo dd if=/Users/myusername/Win7.iso of=/dev/disk1 bs=1m And this ...
9
votes
7answers
3k views

How can I recover a crashed hard drive?

My hard drive from my MacBook crashed and died hard last week. I replaced the drive with a new one, and installed 10.6/Snow Leopard on it. The old drive is now in a usb enclosure, and I really need to ...
8
votes
2answers
2k views

How can I mount dd image of a partition?

I created a dd image of a partition (containing an HFS+ FS) of one of my disks (and not the entire disk) a few days ago using the following command - dd conv=sync,noerror bs=8k if=/dev/sdc2 ...
7
votes
2answers
7k views

How can I mount a disk image?

I have a disk image myimage.disk which contains the partition table and a primary partition (i.e. a FAT32 filesystem). Think that as a USB pen image. I want to mount the primary partition to a local ...
7
votes
2answers
2k views

What exactly does the dd command do?

A few days ago I was delighted to find out that it's not all that difficult to write an iso image to a USB without the help of a third-party program explicitly designed to do so. But the command (or ...
6
votes
1answer
244 views

Is it possible to 'instantly' create arbitrary files?

I've seen the following trick to create large, empty files somewhat quickly: dd if=/dev/zero of=test.dat bs=1024 count=1024 However, this still takes some time when creating multi-GB files. I ...
6
votes
1answer
4k views

dd_rescue vs dcfldd vs dd

What are the main differences between dd_rescue, dcfldd, and dd? In what situations would you use one over the other? Why are there three different yet simliar programs?
6
votes
5answers
4k views

Mount raw CD-ROM image

Let's say I created a image like this: ddrescue /dev/disk1 MY_CDROM_IMAGE.img (/dev/disk1 is my CDROM drive) How can I mount this on my Mac? Note: The image created is not a IMG file - it is ...
6
votes
3answers
11k views

Can I use dd to clone a larger SD card to a smaller SD card if the actual partitions will fit?

I have a 16GB SD card that has a few partitions on it (it's actually the card for a Raspberry Pi). I have several other 4GB cards that I want to clone the primary card to. The 3 partitions on the ...
6
votes
1answer
2k views

Compressing a file in place - does “gzip -c file | dd of=file” really work?

In the question How can I compress a file on Linux in-place, without using additional disk space?, one answer proposes to simply use gzip -c file | dd of=file I tried it (on Debian Linux), and it ...
5
votes
2answers
4k views

Why is GNU shred faster than dd when filling a drive with random data?

While securely erasing a hard drive before decommissioning I noticed, that dd if=/dev/urandom of=/dev/sda takes nearly a whole day, whereas shred -vf -n 1 /dev/sda only takes a couple of hours with ...
5
votes
1answer
393 views

File recovery: How can I make a non-destructive copy of a (NTFS) partition?

I want to recover some deleted files from a healthy NTFS partition on an undamaged hard-disk. In order to leave the partition undisturbed, i plan to use dd to clone the partition to a raw image file ...
5
votes
1answer
3k views

Can I resume an interrupted disk image done with dd?

I am going to reinstall my system and I want to backup it first. There is an 80 GB HDD with Ubuntu and 750 GB HDD on which I want to put image. So, I run a live CD and use dd to transfer my sda to ...
5
votes
1answer
543 views

dd gets slower while reading and writing

user@user-laptop:~$ sudo dd if=sd_backup of=/dev/sdd bs=4M conv=noerror,sync 205520896 bytes (206 MB) copied, 28.564 s, 7.2 MB/s 247463936 bytes (247 MB) copied, 57.1285 s, 4.3 MB/s 260046848 bytes ...
5
votes
1answer
933 views

Accidentally dd'ed an image to wrong drive / overwrote partition table + NTFS partition start

I screwed up and set the wrong output for dd when trying to copy a freenas iso, overwriting the wrong external hard drive. Ironically, I was trying to setup a freenas server for data backup... ...
4
votes
3answers
672 views

How to tell if you have a fake sd card

I've been given some flash drives that appear to be fake. The silk screen says 64 gigs, and they show up as 64 gigs to the OS. However if you attempt to write any files larger than 4 gigs the file ...
4
votes
2answers
124 views

Attempting to test an embedded nand flash chip by filling up a file to drive capacity

I'm trying to test an embedded nand flash chip using the dd command (write random data to a file): dd if=/dev/urandom of=/nand/storage/testnand/test.raw bs=100000 count=50 2> /dev/null However, ...
4
votes
1answer
117 views

What is the difference between byte sizes for DD

If I use the extreme byte size of 1 gb vs 1 mb for instance, on the hardware level, what is the difference? What does a byte size do if a constant stream of data is just getting written to the disk>?
4
votes
1answer
1k views

What does an asterisk “*” mean in hexdump output?

I print MBR with hexdump and I get the following output: 000001a0 67 60 6f 70 65 72 61 74 69 6e 67 60 73 79 73 74 |g`operating`syst| 000001b0 65 6d 00 40 00 63 7b da c5 f5 61 68 00 40 00 40 ...
4
votes
1answer
6k views

Why do we use cp to copy files and not dd? (in unix-derivatives)

For normal file copying in *nix, I've only ever seen people use cp (eg. cp /mnt/mydevice/myfile ~/myfile), but I eventually ran into dd, which appears to do the exact same thing (dd ...
4
votes
2answers
7k views

using dd to copy partition to another partition, while using physical drive

I'm not sure how to explain this in the subject better, so the "question" may not be right. But here goes. I have three hard drives. Drive A is a 320GB drive, Drive B is a 80 GB Drive, and Drive C is ...
4
votes
2answers
4k views

How to Copy .VHD File to Physical Hard Disk Using DD Command

I have read other question/answers on this site that say this is possible, but I'm wondering how it is done. I have tried the following command, which completes successfully, but the NTFS isn't valid ...
4
votes
2answers
1k views

faster dd backup by differential copy

im looking to use dd to back up my whole hard drive regularly but it takes around 1.5 hours and want to know if there is a faster way to back up. possibly just by updating the bytes which are ...
4
votes
1answer
751 views

Can you successfully clone a Mac OS X boot volume directly to another larger volume with ddrescue?

Can you clone a Mac OS X boot volume (specifically a "Mac OS Extended, Journaled" a.k.a. JHFS+ volume) directly to another, larger volume using ddrescue or even dd, and have the target volume end up ...
4
votes
1answer
3k views

Using dd with bad blocks on a harddrive?

I'm looking to use dd to make a clone of failing harddrive. My concern is there will be bad blocks for surely. So my question is with dd will a bad block leave a gap the size of the selected ...
4
votes
2answers
471 views

Recovering Ubuntu after filesystem was overwritten using dd

I had an Ubuntu installation on my laptop, on an encrypted LVM (this was /dev/sda1). I was planning to write an Arch Linux image to my USB drive (/dev/sdc1), following this guide - ...
4
votes
1answer
190 views

Why is my 500GB hdd not readable after dd'ed on a different 500GB hdd?

Accidentally formatted an important external 500GB hdd yesterday. Not an SDD, 2.5". (Quick) formatting occured while installing windows xp on it. I had the wrong usb drive plugged in. ~600MB are ...
4
votes
1answer
623 views

Trying to create an ISO of my bootable USB using the unix command: dd

i'm trying to create a (bootable) ISO (which i'll then burn to dvd) from the source being an bootable USB disk (it contains windows 7 and i've installed a number of PC's from it already). So i'm ...
3
votes
1answer
299 views

Two 2TB drives, why is dd is almost 8 times faster erasing one?

I have two 2TB drives: /dev/sde WCD WD20EZRX-00D8PB0 Firmware revision 80.00A80 (new consumer-grade WD Green series) /dev/sdf WCD WD2002FYPS-01U1B1 Firmware revision 04.05G05 (old pro-grade server ...
3
votes
2answers
18k views

How can I clone a hard drive directly to a vdi image

I would like to make a VirtualBox .vdi image out of my hard drive. I've found howto's online that describe doing this by first usind DD to create a .raw image, then using VBoxManage to convert the ...
3
votes
4answers
4k views

Windows XP virtual machine hangs in VirtualBox

What i want to do: I'm trying to virtualise 2 different physical Windows XP systems which reside on one hard drive each to VirtualBox under Windows 7. What I did (once per drive): From a Linux ...
3
votes
1answer
485 views

Checking if any data exists on a presumably empty storage device

So, say you've completed a full pass of: dd if=/dev/zero of=/dev/sdX bs=1M Then, you'd like to make sure the destination has been really zeroed out (ignoring the confirmation messages from dd ...
3
votes
1answer
607 views

Migrating to LVM

The drive on my Ubuntu media server is nearly full. I hope to add another 2TB of capacity to the machine and would prefer for all 3.5 TB to be recognized as a single drive. To complicate things, I ...
3
votes
2answers
8k views

Rescuing a hdd with bad sectors: dd vs gddrescue

Somewhere on the internets I read that gddrescue is superior to dd at least in terms of being able to distinguish between the amount of disk reads performed on a troubled sector. Is this really the ...
3
votes
3answers
371 views

Backing up to smaller drive

In a few hours I'll have a new 500GB Sony laptop, filled with the usual Sony rubbish which I'll promptly be replacing with Ubuntu or Crunchbang or something. However, first I want to make a full clone ...
3
votes
5answers
1k views

dd producing corrupt ISO images on Snow Leopard (whether invoked from a script or the shell)

Alright, I am probably being an idiot here, but I am writing an ISO-ripping util that is really just GUI slapped on top of dd, and I can't coax the thing to produce non-corrupt ISOs on Snow Leopard. ...