Questions tagged [dd]

A low-level command-line tool on Unix-like operating systems to copy and convert files.

Ref

Examples:

  • Clone the drive sda onto drive sdb:

    `$ dd if=/dev/sda of=/dev/sdb`
    
  • Clone the drive hda onto an image file:

    `$ dd if=/dev/hda of=/image.img`
    
  • Copy a CD or DVD disc to a .iso image file, first unmounting the disc: sudo umount /dev/dvd-device

    dd if=/dev/dvd-device of=dvd.iso bs=2048 conv=sync,notrunc

    # dvd-device will typically be dvd for a dvd disc or cdrom for a cdrom disc.

  • Clone a hard drive to a zipped image file in 100Mb blocks:

    $ dd if=/dev/hda bs=100M | gzip -c > /image.img

  • Create a 10 KB file filled with random data (10 x 1K blocks):

    $ dd if=/dev/random of=random.bin bs=1024 count=10

  • Completely wipe the hard drive hdz by overwriting it with random data:

    $ dd if=/dev/urandom of=/dev/hdz

  • Create a boot floppy:

    $ dd if=boot.img of=/dev/fd0 bs=1440

345 questions
0
votes
1 answer

dd command erros out with larger size than allocated size in VMWARE

There is a VM on MAC os which is allocated 100G HDD. When i use dd command to shrink its size by populating the whole disk with 0, it errors out(no empty space left) when the size is increased to 120G instead of 100G. Why it throws the "no space…
vaj oja
  • 1,151
  • 2
  • 16
  • 47
0
votes
1 answer

dd: invalid argument 'ucase' to 'conv'

Why 'ucase' value is not working for attribute 'conv' in unix ? Error info ➤ dd if=mergefile of=dddemo conv=ucase dd: invalid argument 'ucase' to 'conv'
Uday Kiran
  • 487
  • 2
  • 9
  • 29
0
votes
2 answers

problems restoring image file with dd

I have a pendrive where I restore an image maked by dd command in other system. When I restore the image, always I must do a fsck. Is possbile that when I've generated the image the source system was corrupted or it is that I corrupt the pendrive…
Luis perez
  • 133
  • 3
  • 17
0
votes
2 answers

Dd not working correctly?

I'm not too familiar with Linux so please forgive the ignorance. I'm trying to dump a file to a virtual floppy disk using the command: dd if=a.out of=image bs=1024 count=1 conv=notrunc It creates the image file with the exact same size of a.out…
Kosz
  • 124
  • 1
  • 9
0
votes
2 answers

How to determine eod

I would like to read various partitions from a DDS tape using a script At the moment I am using the following script TAPE=/dev/nst0 BLOCK_SIZE=32768 COUNTER=1 END_OF_DATA=120 while [ $COUNTER -lt $END_OF_DATA ] do dd…
QGA
  • 3,114
  • 7
  • 39
  • 62
0
votes
1 answer

hex to bin file conversion in bash

This question has already been asked in many different forms. I need to convert a file that looks like this 41 20 42 20 43 20 44 to this A B C D This is just an example, but files WILL certainly contain non-printable characters. I wrote a simple…
Ulrik
  • 1,131
  • 4
  • 19
  • 37
0
votes
1 answer

Is using dd to read from /dev/ttyUSB0 the best option?

I'm having some issue with the use of dd to get the content coming from /dev/ttyUSB0. The idea is to poll a device every 5 min (for testing). I will probably use a cron job later but for now, I'm checking every minute and polling every 5. My issue…
didopage
  • 23
  • 3
0
votes
0 answers

Script running twice and dd

I’m trying to poll a device that is sending data through a serial cable, every 15 minutes (Polldata is the string that is recognized by the device). To test, I'm polling data every 15 seconds instead, using sleep to pause. That device should send 3…
didopage
  • 23
  • 3
0
votes
3 answers

How can I convert E01 image file to dd image file?

I'm working on forensics tools and I have Encase E01 type image file. I would like to analyze this image by using other tools. However, those tools such as tsk_recover doesn't accept E01 file type as input. So, I need to convert E01 image file to dd…
Lorderon
  • 131
  • 1
  • 3
  • 13
0
votes
3 answers

Java as a frontend to dd to copy iso to usb

I'm trying to write a frontend to dd with java. specifically to flash an iso image over to a usbdrive. basically ask the user for the correct /dev path, then asking user for the path to the iso, then feeding everything into dd, and showing feedback…
0
votes
1 answer

How can I replace the first few bytes of a files with random data?

I made a script to create files with random data in them (mostly based on dd) in order to do performance testing of a caching server. I need to periodically update these files. The cache server will read the first 1000 bytes of a file and if it…
momeunier
  • 81
  • 9
0
votes
1 answer

Bad PBR signature in centOS

Please help,I had 80gb harddisk of CentOS 6 with full important files.Unfortunately it shows bad PBR signature.I want to copy all those files and configuration files to another fresh harddisk of size 80gb and run the programs well. Please suggest me…
user3088108
  • 11
  • 1
  • 1
  • 1
0
votes
1 answer

how to create an applescript for multiple dd terminal commands in sequence (for multiple USB Drives duplication)?

I need to create an apple script to perform DD Commands in sequence, to replicate the same .img file to multiple USB flash drives The context: the computer is connected to a powered USB hub with 7 usb flash drives connected and unmounted by…
0
votes
1 answer

Shell dd script - Fills zeros instead of skipping bytes

Ok for those who are interested i finally found the answer: dd seek=$(($offset)) bs=1 count=$c conv=notrunc if=$loc2 of=$loc1 So i want to copy the "text" of $loc2 and want to paste it in $loc1 at offset 0x2 without deleting the bytes before it.…
bvoq
  • 189
  • 7
0
votes
1 answer

dcfldd do trunc files when conv=notrunc

I want to work with dcfldd becouse it is faster and modern disks are bigger. dcfldd trunc file even if the option conv=notrunc is set. I work on CentOs5.x. Also, I tryed to compile the program from source but it gives the same results, dcfldd…
Udi
  • 117
  • 8