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

0
votes
0answers
20 views

Cache behavior in dd command

I am performing some dd outputs and running in parallel vmstat: With no direct write (i.e. via cache) $ dd if=/dev/urandom of=somefile.txt bs=1M count=200 200+0 records in 200+0 records out ...
1
vote
1answer
22 views

Can recover data from disk but not from image of same disk?

So I'm creating this training scenario whereby participants have to take an image of a broken disk, loop mount and recover the data. It's supposed to be fairly basic, but I've come accross this weird ...
0
votes
0answers
8 views

integrity check of uboot using dd

I just upgraded uboot using dd and it boot successfully : dd if=uboot_file of=/dev/mmcblk0 bs=512 The output is : 1360+1 records in 1360+1 records out I would like to read backup to ensure every ...
0
votes
1answer
34 views

grep for multiple elements of an array

I am trying to write a dd migration script that will do the following: read user input (max=4) into an array, called "array". the user will enter the logical volume names to be migrated. once each ...
1
vote
1answer
34 views

Bit banging with dd?

I need to change one byte at a well-known position of a binary file to a specific value, and am looking for a way to achieve that using command line tools. Constraints: I need to change one single ...
12
votes
2answers
2k 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
54 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
27 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
30 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
75 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
14 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
52 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 ...
0
votes
2answers
69 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, ...
4
votes
1answer
65 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 ...
0
votes
0answers
20 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
44 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
19 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
37 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
39 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
33 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....
1
vote
1answer
56 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
89 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
266 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
127 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
474 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
29 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
292 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
25 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
270 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
228 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
62 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
78 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
26 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
553 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
76 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
94 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
58 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
202 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
463 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
36 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
435 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
31 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
257 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
81 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
34 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
42 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
418 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
23 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 ...