dd is an utility which is primarily used for low-level copying of data from storage devices.

learn more… | top users | synonyms

1
vote
2answers
62 views

how to use dd to fill drive with 1's

Filling a drive with /dev/urandom seems to be very slow, so I created a file filled with FF: dd if=/dev/zero ibs=1k count=1000 | tr "\000" "\377" >ff.bin I'd like to fill the drive with copies ...
0
votes
3answers
34 views

dd write vs read performance

I have recently done some performance tests on a new server (using dd) and wonder why read performance is so much worse than write performance? Shouldn't it be another way around? file size was in ...
2
votes
4answers
318 views

Why is writing so slow on raw device, and so fast on filesystem (USB key)?

I have a USB key that I am trying to benchmark quick'n'dirty on Linux. I'm testing write bandwith. dd on raw partition I created a partition starting at sector 2048, then did a 4 GB sequential ...
3
votes
0answers
30 views

Is this a correct way to back up one big drive to two smaller ones?

I have a pre-fail drive, and while I'm waiting for replacement I am trying to do full back up to two smaller drives. Given that drive is 3TG and ones I have are 1.5 and 2TB, is this a correct way to ...
4
votes
1answer
186 views

Partially overwrote /dev/sda, can I recover anything?

I was messing around with my new hard drive, which only contains some personal files, and to check its write speed, I typed: sudo dd if=/dev/zero of=/dev/sda, /dev/sda/ being the new 2 TB connected to ...
10
votes
2answers
522 views

Is dd able to overwrite parts of a file?

I have a 1TB big file (disk-image from a damaged drive) and a 1.3MB small file (beginning of a disk-file). Using the contents of the small file, I want to overwrite portions of the big file. That is, ...
1
vote
1answer
894 views

Copy MBR and boot partition to a smaller disk

I'm using a 32GB SD card for my raspberry pi. I have successfully transferred the operating system (Archlinux ARM) to a usb harddrive. Which means that I only need the boot partition on the SD card. ...
1
vote
1answer
45 views

How to use pv with dd?

I'm trying to use dd with pv to write an iso to a usb drive. I did: iso="myiso.iso"; dd if="$iso" bs=1M | pv --eta --size $(ls -l "$iso" | awk '{print $5}') --progress --bytes --rate --wait > ...
18
votes
5answers
14k views

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

I like create an image backup for 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 ...
2
votes
2answers
54 views

dd to clone to smaller sdcard

One of my Raspberry Pi's is using a 4GB SDcard for the root/boot filesystem. As seen when mounted on another system: Disk /dev/sdc: 3904 MB, 3904897024 bytes 121 heads, 62 sectors/track, 1016 ...
1
vote
3answers
82 views

Full DD copy from hdd to hdd

UPDATE: 2 This seems a lot better than before (Thanks to Groxxda for the suggestions): sudo dd if=/dev/sdb bs=128K | pv -s 3000G | sudo dd of=/dev/sdc bs=128K ETA is about 9 hours for 3TB, whereas ...
2
votes
3answers
100 views

Why is dd running forever on a 8 GB drive

I have a filesystem handled by ZFS and it's about 8 GB. I tried to zero out the filesystem by running: dd if=/dev/zero of=/EMPTY bs=1M | true rm -f /EMPTY And normally on an ext4 filesystem, it ...
10
votes
5answers
623 views

Is it safe to take the drive image of the current working drive?

I have to backup my hard disk. I want to use dd and put the image on an external hdd. Can I do this using dd from the OS that resides on the hdd itself or do I have to boot from another device, for ...
1
vote
1answer
47 views

DD with a specific pattern

I was watching this Defcon video and around 4:30 he shows a custom pattern of drive wiping — the drive is filled with a constant text pattern. Whether he is joking or not, is this possible? How would ...
1
vote
3answers
384 views

1:1 copy with dd

I need to get a copy of an HDD that is a real 1:1, I mean not just the filesystem but also the geometry and the partition table and everything in between. if I'll just use dd if=/dev/sdb ...
11
votes
3answers
595 views

Read the middle of a large file

I have a 1 TB file. I would like to read from byte 12345678901 to byte 19876543212 and put that on standard output on a machine with 100 MB RAM. I can easily write a perl script that does this. ...
1
vote
2answers
52 views

`dd` to specific location [closed]

dd is a great tool for copying and conversion. Is there any way by dd (or by any other way), to dump the first few bytes from a file to an unmounted partition? Something like this: dd if=hda2.pbr ...
47
votes
8answers
23k views

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 ...
1
vote
2answers
58 views

dd: 'bs', 'count' & 'seek'

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 ...
3
votes
1answer
170 views

How to use SSH to make a dd copy of disk A from host B and save on disk B?

I want to make remote backups from disk A at will using SSH from computer B. I want to save the backups to disk B. How can I do this? I've tried using $ ssh hostname@my.ip.add.ress "sudo dd ...
3
votes
7answers
1k views

How to write repeated free-form strings to a file, as fast as 'dd'?

dd can write repeating \0 bytes to a file very fast, but it can't write repeating arbitary strings. Is there a bash-shell method to write repeating arbitary strings equally as fast as 'dd' (including ...
1
vote
2answers
66 views

live dd over a mounted read-only root partiton

I'm trying to conceive a firmware update mechanism for a Linux-based embedded system without an additional initrd/initramfs/whatever. From within the running system which has a read-only mounted root ...
4
votes
3answers
86 views

Can I overwrite LUKS partition with it's decrypted content?

I have HDD with my data (partial backup of most important data available on other HDD), currently it's formatted as Ext4 over LVM over LUKS. I want to remove LUKS layer, but reformatting and data ...
2
votes
2answers
26 views

Backing up a partition

I am pretty new to linux. I mostly started learning after I purchased a couple of Raspberry Pis. I like to make backups of my images as I have often made the mistake of corrupting my data :). ...
25
votes
6answers
15k 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 ...
3
votes
4answers
170 views

dd remove range of bytes

Given this file $ cat hello.txt hello doge world I would like to remove a range of bytes to end up with this $ cat hello.txt heorld I would like to do this with dd if possible. The reason is ...
0
votes
1answer
95 views

dd and rm -r commands

For me, the following commands do exactly the same thing: dd if=/dev/zero of=/dev/sd1 dd if=/dev/null of=/dev/sd1 rm -r /dev/sd1/* meaning, the result of their application is the same. Or least, ...
-1
votes
2answers
53 views

How to unpack dd file on Windows? [closed]

Is it possible to unpack files created with linux dd tool on Windows? I have tried that tool http://www.chrysocome.net/dd, but it crashes under Windows 7. Any ideas?
4
votes
1answer
107 views

What does this dd command do exactly?

I have the an embedded device with this SD card: [root@(none) ~]# busybox fdisk -l Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes 4 heads, 16 sectors/track, 121008 cylinders Units = cylinders of 64 * ...
4
votes
1answer
111 views

Backup of a ubi file system with dd?

A have a root file system (file system - image containinf folder structure and content) on a flash drive. The flash drive uses UBI as the underlying file system file system - the way the data blocks ...
5
votes
1answer
253 views

Writing raw images safely to USB sticks

Trying lots of different linux, on all kinds of hardware I find my self typing commands like this quite often: sudo dd if=xubuntu-13.10-desktop-amd64.iso of=/dev/sdc bs=10240 Needless to say, ...
4
votes
2answers
324 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 ...
3
votes
3answers
181 views

how do I do this: dd if=coolstuff.iso of=(ssh kev@mypi )

the card reader on my laptop doesn't want to work. can I use dd (or some other tool) to write an image to a networked disk. I am trying to replace one raspberry pi distro with another. The SD card ...
2
votes
1answer
74 views

Equivalent of memmove on files: copy a range of bytes to an earlier position

What is an equivalent of memmove on files with the same input and output file? dd works when I move the file contents towards the right, but not if I move the contents left, since there's no handling ...
2
votes
1answer
45 views

dd command lost partition

When I used to image my USB, I used the dd command and saved that image to my Hard Disk my USB = sdb1 (4 GB) My partation = sda5 (775 GB free space) dd if=/dev/sdb1 of=/dev/sda5 operation ...
0
votes
2answers
169 views

How to write an alias function to make dd show progress bar?

According to this article, by replacing: $ dd if=/dev/sda of=/dev/sdb [additional options] with: $ pv -tpreb /dev/sda | dd of=/dev/sdb [additional options] one can augment the default dd ...
1
vote
2answers
75 views

dd command: Finding read/write throughput of a flash/SD?

I am running petalinux from sd card. And trying to find data copying rate from Sd card and from QSPI flash that is there on the Xilinx Zynq board. As suggested here , I am doing like this: ...
2
votes
1answer
75 views

How use tune2fs in with dd?

In this tutorial is written To regain unique UUIDs, use tune2fs /dev/sdbX -U random on every partition. Ok, but how can I use it with this command? dd if=/dev/sda of=/dev/sdb bs=4096 ...
5
votes
1answer
105 views

Partitions same size but different block [closed]

I tried to backup my partition using dd on another disk and I created a partition of the same size. When I finished the copy I had problems mounting the partition since I got bad geometry: block ...
8
votes
2answers
4k views

Use `dd` to cut file end part

There is probably simple trick to do this, but I can't figure from man page. How do I cut last 1MB from file with undetermined size for example, by using dd?
53
votes
7answers
7k 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 ...
1
vote
1answer
158 views

Why does a disk clone using dd take up more space on the target than the source image?

I'm doing some Android development on Ubuntu 11.10. I'm building a set of SD card and eMMC card Android images using a Bash script. Due to Android's idiosyncrasies, I have several file system images ...
11
votes
3answers
883 views

saving data from a failing drive

An external 3½" HDD seems to be in danger of failing — it's making ticking sounds when idle. I've acquired a replacement drive, and want to know the best strategy to get the data off of the dubious ...
2
votes
2answers
151 views

How to backup a running system?

I have a running Linux system, and I'd like to have a full backup of it using dd, which, in my limited knowledge is the only tool every system has. The distro doesn't matter mainly because I should ...
1
vote
0answers
30 views

For what are disk signatures being used for by GNU/Linux (distributions) / grub?

I am talking about disk signatures in context of the MBR. The area from 441 to 445 bytes. For what does the GNU/Linux kernel, GNU/Linux distributions usually use disk signatures for? I only found ...
1
vote
1answer
83 views

How to change the disk signature of a raw image?

I am talking about disk signatures in context of the MBR. The area from 440 to 444 bytes. Let's say I got a bootable raw image (bootable in a virtual machine). How can I set the disk signature to a ...
1
vote
1answer
354 views

SSH remote backup script

I am trying to backup a remote server to my machine. I am trying something like ssh user@ip "dd if=/dev/sda" | dd of=~/backup.img But that obviously doesn't work. Other variants that don't work. ...
16
votes
3answers
1k views

How can you trim files using the command line?

What is the console equivalent of the following Python code: target = file("disk", "w") # create a file target.seek(2*1024*1024*1024) # skip to 2 GB target.write("\0") target.close() Maybe some ...
2
votes
1answer
801 views

Copying a working Linux instead of installing a new one [duplicate]

It is possible to move an installed Linux from one drive to another or from one disk to another by two methods: dd command which copies sector by sector including boot sector cp command, and then ...
2
votes
2answers
560 views

How to clean journals in ext3/ext4 filesystem? [closed]

Some preamble: I'm taking bitwise copy of disk devices (via dd command) from twin hosts (i.e. with the same virtualized hardware layout and software packages, but with different history of usage). To ...