Questions tagged [dd]

A common Unix program whose primary purpose is the low-level copying and conversion of raw data.

It is used to copy a specified number of bytes or blocks, performing on-the-fly byte order conversions, as well as more esoteric EBCDIC to ASCII conversions. It can also be used to copy regions of raw device files, for example backing up the boot sector of a hard disk, or to read fixed amounts of data from special files like /dev/zero or /dev/random.

584 questions
4
votes
1 answer

What is the difference between byte sizes for DD

If I use the extreme byte size of 1 gb vs 1 mb for instance, on the hardware level, what is the difference? What does a byte size do if a constant stream of data is just getting written to the disk>?
agz
  • 8,278
  • 21
  • 73
  • 112
3
votes
2 answers

Restoring a disk image with dd

I made an image of a complete disk with : $ sudo dd if=/dev/sdc | gzip -c > my_image.dd.gz When I restore it with : $ gunzip -c my_image.dd.gz | sudo dd of=/dev/sdc I get errors when I type : $ sudo sfdisk -l Output of sfdisk : Disque /dev/sdc :…
dpeng
  • 181
  • 1
  • 1
  • 6
2
votes
1 answer

About `dd` onto USB stick if it's not empty

Should I clean my USB device right before using dd to it, in case I'm copying a file with a size lower than the USB capacity? For example: my USB stick is 32 GB full of data, my .iso file is 4 GB. After dding to the drive, will all the data be…
kAldown
  • 181
1
vote
1 answer

Perform dd from input file, excluding last 4 bytes of every block

I have a very large file (999,952,379,904 bytes to be precise), which is a partial disk image. Looking at it in a hex editor I have found that the structure is as follows: 0-2073 byte offsets contains some header information added by the tool…
Tinkerer
  • 118
1
vote
1 answer

how to recover my hard drive...put an iso image on it with dd

I did the following: dd if=some.iso of=/dev/sda Or some such craziness. How should I recover from this? Gparted, etc..., didn't help out, deleting partition etc... Whenever I try to install a linux onto this disc it complains that its an iso9660…
ftravers
  • 2,694
1
vote
2 answers

The 'real', 'user' and 'sys' description from time(1) differ when they shouldn't?

I read this SO question on 'real', 'user', and 'sys' descriptions and thought I'd play a little. Can someone explain why [root@lux ~]# time dd if=/dev/zero of=del.large bs=10K count=32768 32768+0 records in 32768+0 records out 335544320 bytes (336…
1
vote
2 answers

Migrate Operating System to a new Disk with dd or other linux tools

I have 1 TB HDD, and a new 250 GB SSD. The HDD has these partitions: 499 MB (EFI) 256 GB (Boot, Page File) - Only 120 GB of this partition is used. the rest is free. 499 MB (Recovery Partition) 736 GB (Primary Partition) I only want the…
Shayan
  • 1,524
1
vote
0 answers

How to format `dd` speed units?

dd scales its reported speed (e.g. MB/s or kB/s), but I would like to enforce that it always use the same unit, e.g. B/s. How can I enforce that dd always prints the same units? Example usage: $ dd if=/dev/zero of=/tmp/testfile bs=100k count=1k &&…
tarabyte
  • 2,323
1
vote
1 answer

Cloning Hard drive to smaller SSD

I have a 146GB HDD in one of my servers that I want to replace with a 120GB SSD. Can I just clone the drive with dd and have it boot just fine? Are there any repurcussions to cloning to a smaller drive? (The drive is nowhere near full so there…
cclloyd
  • 752
1
vote
2 answers

Safer way to use dd

I need to write a .bin file directly to a USB (as boot sector opcodes), however, I don't like using the "disk destroyer" command from the terminal. Is there a safer way to use dd?
Jim
  • 51
  • 5
0
votes
1 answer

"Target filesystem doesn't have sbin/init" after cloning boot disk with dd

I cloned a boot disk (bootloader, / and swap partitions) with dd to the same size disk (bad sectors started to appear). Got 1 reading error in the middle of the disk. After I swapped the disks I received "Target filesystem doesn't have sbin/init"…
Art Shayderov
  • 280
  • 1
  • 7
0
votes
1 answer

error of "You don't currently have permission to access this folder" from osfmount when opening \users\user from a raw file produced by dd

I'm getting an error of "You don't currently have permission to access this folder" from osfmount when opening \users\user(or whatever user profile folder), from a raw file produced by dd (or ddrescue). When trying to open c:\user\usera , it takes a…
barlop
  • 23,849
0
votes
1 answer

can Linux dd copy a single file from an ext4 formatted partition to an NTFS partition?

1) I would like to copy a single file from Ubuntu 18.04's ext4-formatted partition to Window 10's NTFS-formatted partition without going through an intermediate FAT32 partition. Can the "dd" command in Ubuntu do that? What "mount" commands might…
0
votes
0 answers

dd read into /dev/null, page cache

When dd reads a remote file into of=/dev/null, does data get page-cached by Linux? I executed the command a few times and the transfer rate stays consistent. This may indicate that the file is not being cached during read; I'd like to…
Vortex
  • 101
-3
votes
1 answer

Can a dd command destroy the input file?

Assuming that I have the correct input file and the correct output file in the dd command. Is there a risk that if something change in the input file during the process it could corrupt the input file or only the output file?
J.C
  • 105