Questions tagged [dd]

dd is a traditional utility for binary data copies

Filter by
Sorted by
Tagged with
12
votes
2answers
3k views

Will dd if=/dev/zero of=/dev/sda wipe out a pre-existing partition table?

Will # dd if=/dev/zero of=/dev/sda wipe out a pre-existing partition table? Or is it the other way around, i.e, does # fdisk /dev/sda g (for GPT) wipe out the zeros written by /dev/zero?
1
vote
1answer
268 views

Mount an ext4 partition in another PC(Windows) at the same network in my Ubuntu Live?

Is there any way to mount an ext4 partition in another PC, running Windows, at the same network in my Ubuntu Live? My HD just died earlier today and I needed to use Live Distros until I get a new one....
2
votes
1answer
324 views

How can I move a single partition to another empty drive?

I've got a partition P1 (which contains my Linux OS) on a drive A. I've just gotten a completely new drive B (that is larger than partition P1 AND the entire drive A). I'd like to copy across the ...
1
vote
1answer
79 views

SD card img created with dd is all zeros [closed]

A computer illiterate family member asked me to recover photos from an SD card she used in her camera. She went to fetch them from her computer when it informed her that the device needed to be ...
1
vote
1answer
570 views

FIO reporting slow write speeds while DD reports fast ones

According to most disk benchmarks, sequential write speeds are typically very close to the read speeds. Mine are in the ~500MB/s range. $ dd if=/dev/zero of=tempfile bs=1M count=5120 conv=notrunc ...
0
votes
1answer
35 views

Unreadable block in multiblock reading on dd / ddrescue: How does it handle it?

Let's say that I set the block size of dd or ddrescue to 256K. A sector of flash drives usually has 512 bytes, a sector on optical data discs has 2048 bytes. Let's assume that in the next 256 KB, ...
1
vote
0answers
67 views

loop device not matching file size

I have a sparse backing file (NTFS) (made via dd seek=) that's a partial image of a damaged disk. The size as given by ls matches the original disk. However, when looping it, /proc/partitions shows it ...
2
votes
2answers
950 views

“dd” an image onto an sd-card from Ubuntu in Windows Subsystem for Linux

I have a bootable disk image file that I'd like to write onto an sd-card. However, I only have a Windows 10 machine available - it has the Windows Subsystem for Linux already installed, Ubuntu runs, ...
5
votes
1answer
149 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
3k 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 ...
1
vote
0answers
52 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, ...
1
vote
0answers
51 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 ...
1
vote
1answer
63 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....
5
votes
1answer
192 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
471 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
833 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
1answer
954 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 ...
3
votes
1answer
2k 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
35 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
27 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
834 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
78 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 ...
2
votes
1answer
768 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
398 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
97 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
88 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
39 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
633 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
171 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
136 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
307 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
298 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
1k 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 ...
1
vote
0answers
68 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 ...
2
votes
3answers
1k 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
38 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
1k 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 (...
1
vote
2answers
213 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
42 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
62 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
603 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
1answer
68 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
2k 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
38 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
497 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
38 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
94 views

Android / Linux dd [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
23 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 ...
0
votes
2answers
328 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
1k 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=...