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

learn more… | top users | synonyms

50
votes
2answers
2k 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 ...
16
votes
4answers
20k 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 ...
15
votes
4answers
29k 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
5answers
12k 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 ...
14
votes
1answer
6k 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 ...
12
votes
4answers
25k 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 ...
11
votes
2answers
23k 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 ...
11
votes
3answers
11k 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 ...
10
votes
6answers
990 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
5answers
16k 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 ...
10
votes
5answers
5k 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 ...
10
votes
2answers
15k 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 ...
10
votes
3answers
14k 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
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 ...
7
votes
4answers
4k 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. ...
6
votes
1answer
230 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
2answers
5k 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 ...
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
1answer
3k 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 ...
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
3k 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
3k 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?
5
votes
1answer
365 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
472 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
807 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
595 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
96 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
106 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
2answers
9k 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 ...
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
677 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
2answers
433 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
2k 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
1answer
176 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
529 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
201 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
1answer
380 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
563 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
6k 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
353 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. ...
3
votes
1answer
208 views

Mapping dd commands to ddrescue

I'm trying to back up the Windows Recovery Partition on a laptop using ddrescue. I tried using dd, but I kept getting an Input Output error (at about 9.65 GB through, if it matters), so I learned that ...
3
votes
3answers
3k views

How do skip MBR & partition table while doing dd of a partition

I need to copy a SATA partition to external usb partition , both partitions are same in size but total disk size are different , i want to copy only the data and not concerned about boot sector and so ...
3
votes
1answer
3k views

Use losetup and dd to make filesystems images ready to be deployed

Introduction Using dd, one can easily backup the MBR and partition table of a disk. It's as easy as: dd if=/dev/disk2 of=~/Desktop/disk2_mbr bs=512 count=1 One can also backup whole partitions: dd ...
3
votes
3answers
5k views

Cloning an SD card onto a larger SD card

I'm using Ubuntu 12.04. I have an old 4GB SD card, and have just bought a new 16GB SD card. I would like to copy everything from my old 4GB SD card onto the new 16GB SD card. I was afraid that the ...
3
votes
1answer
527 views

dd/ddrescue style tool for SSDs that skips writes for identical blocks

I have a dd copy of a filesystem from a SSD I want to restore back to the same SSD filesystem due to a bad OS crash, putting it back into a known good state. 95% of the blocks will be the same, so to ...
3
votes
2answers
2k views

What is the difference between dd's direct and fsync options?

I would like to copy an image to a USB thumb drive. As I would like to get "real" speeds, and don't want to wait ages for the device to sync after copying the image, I would like to know which ...