Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [dd]

dd is a traditional utility for binary data copies

4
votes
1answer
46 views

System lags when doing large R/W operations on external disks

I am having some issues with system-wide latency/lagging when doing large disk imaging operations on an Ubuntu 18.04 system. Here's the system specs: Processor: Intel Core i7 (never near capacity on ...
18
votes
1answer
2k views

Why does piping `tar` into `dd` not stop until the disk is full?

I have a tar archive of a single disk image. The image inside this tar file is about 4GB in size. I pipe the output of tar xf into dd to write the disk image to an SD card. The diskdump never stops ...
0
votes
0answers
18 views

Filled sdcard with zeroes (with DD) and now it no longer visible with 'lsblk'

I recently filled my completely fine working sdcard with zeroes using dd: dd if=/dev/zero of=/dev/sdb bs=4096 And now nothing recognizes it. However, once I put it to my laptop, it appears under "...
1
vote
0answers
38 views

Cannot access mounted partition after using dd

I have used following command to create an image of mounted partition sda1: dd if=/dev/sda1 of=/dev/sdb1 'conv=noerror,sync' where sda1 is the one I want to "backup" and sdb1 is obviously target, ...
0
votes
0answers
14 views

repack .img file from usb that have been partitioned to two partition

I have an img file with unix system. I used win32diskimager to create a bootable usb from that img file. I booted successfully and i installed some packages. Now I want to repack it to img file again....
1
vote
0answers
32 views

When using TAB completion with dd command, options (like 'if' or 'of') disappear

When I type dd if= then hit TAB to complete, the file name is added, but the if= portion vanishes (and of= too, for that matter). So for example, instead of # dd if=input_file.iso of=/dev/sdb I get ...
0
votes
0answers
35 views

Why can't I mount array disks for dd?

When I have an USB disk recognized, I can do the 'dd' command and wipe data from the stick. I cannot do that with a SCSI disk from array such as NetApp. They don't seem to mount at all. The disk would ...
1
vote
1answer
24 views

df size of partition and dd-ed image with sparse flag does not match

The size of a partition is close to 2Gb and the actual used size is 1.5Gb, I am trying to make image of this partition using dd with conv=sparse flag enabled. The generated image by dd is of size 1....
0
votes
0answers
39 views

How to fill a device with zeros, without overwriting the bytes that are already zeros?

I have a USB flash drive usb 3, the reading speed is much more than the writing speed. Let's say that 99% of the flash memory is already full with zeros, and I would like to fill it with zeros until ...
1
vote
1answer
50 views

dd hanging & uninterruptible sleep (kernel quirk?)

So, this has been annoying me for years. This happens with more programs than just dd, but I find it happens very often with programs that involve raw filesystem manipulation. When I'm copying with ...
4
votes
3answers
234 views

Why does a gunzip to dd pipeline slow down at the end?

my command: gunzip -c serial2udp.image.gz | sudo dd of=/dev/mmcblk0 conv=fsync,notrunc status=progress bs=4M my output: 15930949632 bytes (16 GB, 15 GiB) copied, 1049 s, 15.2 MB/s 0+331128 ...
0
votes
0answers
25 views

No space left on device when trying to dd to an LVM

I am currently helping out a friend who is migrating some of his infrastucture from VMWare to KVM an I am having trouble when migrating the machines to LVM. I am following this guide: https://www....
0
votes
1answer
51 views

How to change UUID after cloning a Mac HDD with `dd`?

After 1 day of googling and try&error I give up and ask for help. Long story short: I cloned internal HDD of my iMac (Mid 2011) to external SDD with dd command. Now I have two identical discs ...
2
votes
1answer
126 views

How to use dd if=/dev/mem in place of devmem ?

It seems like root@testbox:~# dd if=/dev/mem bs=1 count=4 skip=2149646336 | hd should be nearly equivalent to root@testbox:~# devmem 2149646336 32 But, while devmem works great, that dd invocation ...
0
votes
1answer
27 views

Moving an Linux OS image from a 4 GB flash drive to a hard drive

I have a small flash drive (4 GB) that has a stripped down version of Redhat Linux. I'm currently attempting to move this OS from the flash drive to a much bigger hard drive (500 GB) that is bootable. ...
0
votes
1answer
25 views

How can you replace a file on a raw device preserving filesystem integrity?

Say I have a Linux system and want to write to a raw device. But I want to replace a certain file on this device with a new version. Can this be accomplished? I think with dd you could maybe write the ...
1
vote
1answer
138 views

dd copy from an OS HDD to PCIe NVME SSD, SSD can't boot

Test 1: dd if=/dev/sdb of=/dev/sdc /dev/sdb is a bootable OS HDD, /dev/sdc is another HDD, after executed the above dd command, the /dev/sdc become bootable. Test 2: dd if=/dev/sdb of=/dev/sdc /...
-1
votes
1answer
22 views

Can I restore a Macintosh disk image using dd?

I have a clone of an entire Mac OS HDD that I created using dd, as: sudo dd if=/dev/sda of=/media/mint/backup/mac-backup.img I verified the integrity of the image at creation time using diff. Now I ...
1
vote
1answer
113 views

Why is fio seq_writes so much faster than dd?

I have a zfs server, where I ran a couple of dumb tests just for understanding, and it puzzles me. Context:- FreeBSD 11.2, ZFS with Compression enabled, SAS HDDs, RAIDz2, 768GB of memory. Both ...
1
vote
1answer
130 views

Creating a raw img file of linux system

I'm trying to backup a linux system to an IMG file that I can then boot and run in QEMU. NOTE: I have tested on Lubuntu and tiny core linux. The process I have followed is: I have 2 hard disks, ...
0
votes
1answer
52 views

dd copy a HDD to USB but fail to boot? [closed]

dd if=/dev/sdb of=/dev/sdc bs=10M /dev/sdb is a HDD with installed CentOS7 and able to boot. if /dev/sdc is another HDD, the dd copy works OK, /dev/sdc can boot without problem. if /dev/sdc is a ...
2
votes
1answer
77 views

dd completes implausibly quickly

I'm running dd to copy a 1.8 GB image onto an SD card for a Raspberry Pi. This copies at about ~400MB/s, which is much higher than the write speed the manufacturer says this card can do. I therefore ...
1
vote
0answers
25 views

Reset all files after reboot

I have a little question. It is possible to reset all files of the system to the saved one? I thought about saving state with dd to other disk, then create "man in the middle" so after boot it will ...
5
votes
1answer
533 views

What's the difference in these commands - cat piped to dd and just cat? [duplicate]

I'm curious to know the difference between these two commands in Linux: $ cat ./boot.bin ./kernel.bin /dev/zero | dd bs=512 count=2880 of=devos.img and $ cat ./boot.bin ./kernel.bin > devos.img
1
vote
0answers
51 views

Why can't dd write to /dev/ram0 on Core Linux?

I created an ext2 file-system on /dev/ram0 ramdisk, and mounted it at /mnt/ram. mkdir /mnt/ram mkext2fs /dev/ram0 sudo mount /dev/ram0 /mnt/ram -o rw Reading from ramdisk with dd works. dd if=/dev/...
0
votes
1answer
73 views

Scriptable way to clone source disk to multiple destination disks?

I need to clone a bootable disk to multiple disks (of different sizes) on different computers and it needs to be scriptable, but I can't find a way to do it. I'm using Ubuntu 16.04 on everything. ...
0
votes
1answer
46 views

How do I clone a SSD containing LVM LV's and /root to a larger one?

This is my root volume, it is 32GB and contains /boot, and on LVM LV's are / and swap. sdb 8:16 0 29.8G 0 disk ├─sdb1 8:17 0 200M 0 part /boot/...
0
votes
0answers
139 views

Zero Disk Space

I have a Centos 7 server with ext4 running as a KVM and I want to zero the free disk space. This is so when I backup the KVM the compressed image size is reduced. I saw this command etc. dd if=/dev/...
1
vote
2answers
291 views

disk image without free space

I've an image of a bootable 16GB SD card. I've created the image with: cat /dev/sdd | gzip >sdcard.img.gz And I was happy because $ du -h sdcard.img.gz 482M sdcard.img.gz 482MB instead of ...
0
votes
0answers
25 views

Good fdisk output for backup image but can't mount to loop device even when using offset

I've recently created a backup file for my Ubuntu 16.04.4 server using dd in order to prepare for migrating to a larger SSD. I want to mount the backup image through a separate Ubuntu VM running on my ...
1
vote
3answers
175 views

General question about `dd`, iso images and linux devices

I have an iso image (it's a windows installation disk), but I do not want to burn dvd. I want to create a bootable usb flash drive instead. And I want to use linux tools to accomplish this task. I ...
0
votes
0answers
30 views

Only write back changes when restoring a disk image with dd

Given a physical disk and an image created from it, I want to write the image back onto the physical disk, but only write the changed bytes or sectors. The use case is restoring images on an SSD - ...
1
vote
2answers
126 views

Use dd to extract a precise portion of a file?

I have a 588Ko file, and I want to extract bytes from 0x7E8D6 to 0x8AD5D. I tried : dd if=file of=result bs=50311 count=1 skip=518358 50311 stands for 0x8AD5D - 0x7E8D6 518358 stands for 0x7E8D6 (...
0
votes
2answers
48 views

bash output create file with dd /dev/zero with dialog --gauge

I am trying to create a new file (blank file) with: dd if=/dev/zero of=file.txt count=10240 bs=10240 I also want to use dialog output --gauge, something like this: dd if=/dev/zero | pv | dd of=...
2
votes
2answers
28 views

No bootable device error after restoring debian image to annother ssd disk

I created an image of debian 7 on an SSD disk and later restored it on another computer with excatly same type of HW. however I'm getting the error message: No bootable device -- insert boot disk and ...
2
votes
2answers
36 views

Using 'sync' when wiping a device with /dev/urandom

Is it necessary to synchronize cached writes to persistent storage with the sync command when wiping a USB, or any device, with /dev/urandom? This is a common practice, i.e. dd if=/dev/urandom of=/...
5
votes
2answers
357 views

Errors on cloning disk with cat

I wish to clone a large disk (a 500GB SSD, for what it's worth), and I am leaning toward using cat, as suggested by Gilles here. But what gave me pause is that I do not really know what cat does upon ...
0
votes
0answers
20 views

Clone Linux from VPS to local Virtual Machine

My remote VPS which I rent, runs on Centos6.9 (vmware) system and has the following (virtual) disks mounted df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 95G 27G 64G ...
0
votes
1answer
37 views

can i use dd to copy my dual boot HDD(350G) to smaller SSD(120GB) with only one of two OS from HDD

I Have a dual boot machine (windows+ubuntu) with 350 GB HDD. I wish to clone only ubuntu to the 120GB SDD. How can I accomplish this. PS: I have copied Linux partition(sda5) to SDD using "dd", What i ...
0
votes
1answer
326 views

How to fix I/O error on external HDD?

I am trying to format this external hard drive but I've failed. I have tried to use gparted but I get an error: "Error de E/S en la máquina remota during write on /dev/sdb" Also tried to use dd ...
0
votes
1answer
33 views

Creating OS image from the current installation

I have installed Kali Linux on my Orange Pi board from the official website and made some configuration changes on top of the default installation. I was wondering if I can create a new image, a kind ...
1
vote
0answers
222 views

Why is this `dd` command producing `Resource busy` errors?

I'm attempting to recover anything possible from a known-bad hard disk (failing, or failed). I began with dd and realized I didn't unmount. After unmounting volumes, I was able to correctly begin the ...
2
votes
0answers
20 views

Strange memory usage pattern using LUKS

I'm setting up and external HDD encrypted with LUKS. After adding the LUKS partition on it, to 1) scramble it a bit (which could be pointless) and 2) check that I can write on all the disk, I did: dd ...
-5
votes
2answers
51 views

Android / Linux dd help! [closed]

Can any one give me a simple example? The partition size is 4 MB but the data inside is 3.1 MB. I need to dd only the 3.1 MB. dd if=/dev/block/partition of=/tmp/3.1mb.img bs= skip= I'm confused ...
0
votes
0answers
22 views

What should I notice for the USB stick use as installer?

I have a few questions about the USB stick used as an installer in Linux. 1) Should I leave extra space after running dd? So for Windows user, you might be familiar with rufus, with rufus you can ...
-1
votes
2answers
117 views

Can you make the `dd` command safe?

We all have (or know someone who has) unintentionally misused the destroy-disk (dd) command. What ways exist (if any) to change the command in the following or a similar way: If /dev/sda is given as ...
10
votes
1answer
576 views

Different size of file from /dev/zero and /dev/urandom [duplicate]

I am tring to create random 1G test file via dd command. dd status=progress if=/dev/zero of=/tmp/testfile.zer bs=100M count=10 dd status=progress if=/dev/urandom of=/tmp/testfile1.ran bs=100M count=...
0
votes
0answers
37 views

Best way to move data with overlap towards the end on same device

I have a rather big disk that's pretty full. I need a new partition at the start of this disk. So I need to move the data towards the back of the disk somehow. Usually I do such things with dd, but ...
0
votes
1answer
94 views

Why was a disk image created with dd, bigger than the original disk?

I recently backed up a disk using dd and when I tried to dd the image back to the disk, I realized that somehow the image file is bigger in size than the original disk that was created of original ...
1
vote
2answers
127 views

dd command in script not running when executed from udev rule

I would like to setup a Raspberry Pi 3 running Rasbian to automatically copy a DVD disk when a disk is inserted in a coupled disk station. To achieve this, I have written a udevrule and a script to ...