Tagged Questions

dd is a traditional utility for binary data copies

learn more… | top users | synonyms

3
votes
2answers
809 views

How to write file into another

I have an empty file (only zeroes are in it) of size 9,0KB and I need to write another file (with size 1,1KB) to it, but the first file must not lose its size or the rest of its contents. So if the ...
3
votes
1answer
138 views

reasons for a dd image of an almost-empty drive not be small after gzip

i just cleaned a 50GB partition with dd if=/dev/zero of=/dev/sda1 then added some data to it (actually installed a linux distro) some 3Gb on ext4. and decided to make a image. dd if=/dev/sda1 | ...
2
votes
2answers
465 views

How does mdraid resync work?

I have two drives in a mirror (linux sw raid/mdadm); one drive somehow left the mirror in the past and its content is now several days old. At this moment, I'm using degraded mirror (with one drive ...
1
vote
0answers
667 views

Use dd to backup disk image within an OpenVZ container

I want to use dd to backup the disk of an OpenVZ VPS in addition to traditional cold tar backups. Because I may need to migrate to a different VPS provider. From end user point of view, OpenVZ ...
4
votes
3answers
5k views

Moving /boot and MBR to a new drive

I have a CentOS 6 server with two hard drives in it. My old 3TB drive has been giving me some issues so I'm moving things over to a new drive. Because my / and /home partition are managed by a LVM ...
3
votes
2answers
303 views

Is it safe to only partially restore a disk image with dd?

I have saved my whole hard-disk with dd to an image file. The hard-disk contained some primary partitions formatted with ntfs, swap and ext4. I did it this way: dd if=/dev/sda | ssh user@fastmachine ...
3
votes
2answers
412 views

how to create ISO and hide certain files

I am a newbie here and my apologies if I am posting a question which has been answered many times in a another thread. I did my homework find some relevant information But could not. Thanks for ...
4
votes
1answer
108 views

Error(?) in output of the dd command

When I run the following command: dd if=/dev/sda of=output bs=512 count=1 In the middle of the output, I see this text: GRUB ^@Geom^@Hard Disk^@Read^@ Error^M What does it mean?
3
votes
1answer
190 views

How to enlarge existing file to specific size

I have hdd.img file, which I user as HDD for my virtual machine, but it's size is too small, how can I enlarge it? There is one method, something like: dd if=/dev/zero ds=10GB count=8 >> ...
1
vote
1answer
285 views

Stripping null byte blocks with a sparse file?

I've created a sparse file with dd. How do I copy contents of another file there, leaving all the zero blocks unallocated?
2
votes
1answer
152 views

dd is crashing after a few hours of transfer

I am trying to clone a external hardrive ( 1.5T ) to a second one ( 3T ) with dd. I am working on Unix and want to create a disk image. Here is the command I am using : dd if=/dev/disk1 ...
8
votes
1answer
198 views

How to re-size partitions in a complete hard drive image?

I have taken a complete image of a hard drive using: dd if=/dev/sda of=/home/user/harddriveimg bs=4M It would seem to me, that I should be able to re-size the partitions within it after suitably ...
2
votes
1answer
216 views

Using dd to cause an error in memory

The command dd if=/dev/mem of=/dev/null seek=16k bs=4k count=1 is used to test erroect injection for edac. Why? As far as I know, dd is simply copying data from those devices to somewhere else. What ...
16
votes
3answers
2k 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 ...
1
vote
1answer
384 views

Read/write access on raw NTFS image

I backed up an entire 32GB NTFS partition to a raw image with with dd. The file-system on the partition in accessible under Debian after mounting with: $ sudo mount -o ro,loop ...
1
vote
2answers
659 views

Writing data on particular sectors or blocks

Not sure if it's better suited for superuser of serverfault boards, let me know. I have a drive which I repartitioned with fdisk. Initially there was only one big partition, now there are a number ...
2
votes
1answer
2k views

VBoxManage: Error: Can't be used as the requested device

I used the soluton from this thread but always i get VirtualBox error: The medium 'lvol.vmdk' can't be used as the requested device type (0x80004005) I've tried all controllers SATA, SCSI, IDE and ...
2
votes
3answers
1k views

Why does dd change the filesystem on the external disk?

I took out a 250 GB SATA disk from my netbook, filled it with zeroes with dd and connected it to my laptop via the usb adapter. It's correctly detected by fdisk: Disk /dev/sdb: 250.1 GB, 250059350016 ...
4
votes
2answers
664 views

Help with unzipping a .dd.gz, possibly corrupted

I recieved this file that I was told was a copy of a hard drive (or disk). The file is "sheeva-mem.dd.gz". I tried to unzip the file in a linux Fedora machine. This yielded "unexpected end of file". ...
7
votes
3answers
1k views

Create a Random ISO Image Using dd

I would like to create a ISO file for testing optical drives with the method mentioned here. I want to create an ISO file filled with random data, so I can burn it to a CD, read it back and compare ...
2
votes
3answers
1k views

How to clone linux installation onto an external harddisk?

I see a lot of dd related questions, but could not find answers to the following. If question/answers already exist, please point to them, then flag to close, delete or merge. Can a working linux ...
5
votes
2answers
4k views

Unpack files and directories from an image created by dd?

I created an image of an NTFS partition using dd. I wonder if I can unload/unpack the files and directories in the image to any partition whose size is larger than the image size, so that I can ...
2
votes
2answers
2k views

Check integrity of a dd backup

I just made a backup of an entire hard drive (50GB) over ssh via: dd if=/dev/hda | buffer -s 64k -S 10m | ssh myuser@myhost "cat > ~/image.img" What's now the best way to check the integrity of ...
6
votes
1answer
2k views

dd: writing '/dev/null': No space left on device

I am reading a 550MB file into /dev/null and I am getting dd: writing '/dev/null': No space left on device I was surprised. I thought /dev/null is a black hole where you can send as much as you ...
6
votes
2answers
631 views

Why did dd create a different uuid?

root@debian:/home/tiger# dd if=/dev/sda of=/dev/sdb bs=10240k 11447+1 records in 11447+1 records out 120034123776 bytes (120 GB) copied, 4729.59 s, 25.4 MB/s root@debian:/home/tiger# blkid ...
3
votes
3answers
514 views

from a sparse file to a block device over the network

If I have a sparse file representing a block device, then how can I efficiently restore the file over a network? Ideally, I'd use rsync -S host:file /dev/sdb, but rsync won't write to block devices. ...
4
votes
1answer
1k views

How do I create a USB image with a partition table?

I want to create an image of some directory tree that is writable directly to an USB drive, just like the images of many linux distributions. For example, with openSUSE you can download an ISO image ...
1
vote
3answers
1k views

dd command for windows filesystem

dd is a handy tool for backing up a whole drive or filesystem in some situations. Now I am thinking about what if I use the tool for backing up Windows file-systems / drives (Windows 2003/2008) which ...
5
votes
1answer
2k views

Are there alternatives for `dd`?

What other tools should I use to read and write files with truncation, seeking and skipping. dd's command line options seem inconvenient and foreign and I don't like choosing between slow, but precise ...
7
votes
2answers
5k views

Create file image container

I would like to create a 100GB file to use as a file-system. The file will be stored on an encrypted volume, so the file/file-system itself does not need to be (further) encrypted. Searching has ...
3
votes
2answers
2k views

Sending the output from 'dd' to awk/sed/grep

I'm trying to approximate the computer's write speed using dd: dd if=/dev/urandom of=/dev/null bs=1K count=10000 which gives the following output 10000+0 records in 10000+0 records out 10240000 ...
1
vote
3answers
1k views

How to convert dd disk image to Clonezilla?

I have disk image from VirtualBox, it is a raw image, just like dd makes it, now I would like to restore the system to real machine using Clonezilla. However Clonezilla does not recognize the image ...
2
votes
2answers
462 views

dd copies more data than exists in .img?

I'm trying to dd an .img file over to my micro sd (8 GB). The rom (.img) is 2.66 GB, but in my output of DD (live) it says its transfered 9 GB. I don't get how it's turning a 2 GB image into 9 GB. I'm ...
4
votes
1answer
3k views

What's faster, dd 1.5TB or rsync 500GB?

I need to save data from a failing hard drive. Sounds like ddrescue or myrescue (or maybe clonezilla?) will be my best friends here, but I'm just wondering what will likely be faster: using ...
7
votes
2answers
7k views

gzip - redirection or piping?

I will be backing up a large (750GB) disk to an external USB disk using dd. Should I be using redirection or piping? Which is more efficient? Or is there a difference? Also, what is the best block ...
1
vote
2answers
3k views

How to write a file at various offsets to a filesystem partition with dd command

Requirement I want to write a file at various offsets into the partition Partition /dev/part2 is mounted at /mypart I tried the command below: dd if=/dev/urandom of=/mypart/aaa bs=1024 seek=0 ...
0
votes
3answers
217 views

What happened to my ext3 partition

I had an ext3 partition. I ran a dd command like this: dd if=/dev/urandom of=/dev/part2 bs=1024 count=15000 seek="various values" Where various values are basically 0, 15000K, 30000K etc. The ...
4
votes
2answers
3k views

How to check progress when cloning a disk using `dd`? [duplicate]

Possible Duplicate: dd: How do I know if it's still working? I'm using dd to clone a disk to an image file, and compress it on the fly: dd if=/dev/sda | gzip > /mnt/image_file How ...
17
votes
3answers
4k 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 ...
10
votes
2answers
5k 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?
1
vote
1answer
772 views

Adding a populated existing disk device to a QEMU raw image

I have a raw QEMU image (vda.raw), and I would like to resize it and add an existing partition, using data I have in a file that contains a raw ext3 file system populated with data (vdb.raw). The two ...
4
votes
2answers
4k views

Why can't I copy my DVD with dd?

I tried dd, dd_rescue and ddrescue, all failed. I thought these tools bypass the filesystem and make a bitwise copy. dd is fooled, it finishes but just produces a small file and states it's finished. ...
3
votes
1answer
2k views

What is the fastest way to write all sectors on a drive?

The goal in my case is not to securely erase data, but simply to force sector reallocation by the drives firmware. I have a drive that has had a few file corruptions. It seems to be due to getting ...
23
votes
5answers
17k 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 ...
1
vote
2answers
512 views

Embedded device: How to do raw reads and write to flash (emmc/movinand) bypassing file system cache

I have an embedded device with a flash memory running linux. I want to do raw read writes on the flash part but I also want to avoid any file system cache. How can I do this? Any pointers?
3
votes
4answers
3k views

Comparison of raw block devices

Is there a utility (or some shell magic) that allows me to compare two block devices? Details: I have one large (0.5 TB) RAID device that I've backed up to a slightly larger SATA device using dd. ...
0
votes
1answer
282 views

Backed an ipod up with dd, how to retrieve all tracks in one go with gnupod?

I have had gnupod for a while. Still haven't figured out how to use it though. I usually just go for gtkpod. So this question, in case anyone had any doubts after reading everything below, is purely ...
3
votes
3answers
402 views

Some basic questions about dd

I'm working on a system of how to back up partitions using dd and have been reading a lot about it. I have a few questions and assumptions that I would like to ask. These may seem a little noob-ish, ...
2
votes
3answers
455 views

Duplicating a hard disk

I'd like to simply duplicate a hard disk drive to another hard disk drive of the same size. I know I can simply do: dd if=/dev/sda of=/dev/sdb (or whatever the names of the drives are in /dev). ...
21
votes
4answers
1k views

What's the difference between these two dd commands?

What's the difference between two dd commands that have different bs and count values, as long as they multiply to the same? For example: dd if=/dev/random of=aa bs=1G count=2 dd if=/dev/random ...