![]() Examples:ĭd if = / dev / urandom of = / dev / sda bs = 4k - ✿ill the disk with random dataĭd if = / dev / sda of = / dev / sdb bs = 4096 - » Disk-to-disk mirroringĭd if = / dev / zero of = / dev / sda bs = 4k - » Clean a hard drive (may need to be repeated)ĭd if = inputfile of = / dev / st0 bs = 32k conv = sync - » Copy from file to tape deviceĭd if = / dev / st0 of = outfile bs = 32k conv = sync - » The former, reversedĭd if = / dev / sda | hexdump -C | grep - » Check if the disk is really zeroedĭd if = / dev / urandom of = / home / $ user / hugefile bs = 4096 - » Populate a partition (Beware of system partitions!)ĭd if = / dev / urandom of = myfile bs = 6703104 count = 1 - » Encode a file (maybe before deleting)ĭd if = / dev / sda3 of = / dev / sdb3 bs = 4096 conv = notrunc, noerror - » Copy a partition to another partitionĭd if = / proc / filesystems | hexdump -C | less - » View available file systemsĭd if = / proc / partitions | hexdump -C | less - » View available partitions in kbĭd if = / dev / sdb2 ibs = 4096 | gzip> conv = noerror - » Create a gzip image of the second partition of the second diskĭd bs = 10240 cbs = 80 conv = ascii, unblock if = / dev / st0 of = ascii.out - » Copies the contents of a tape to a file, converting from EBCDIC to ASCIIĭd if = / dev / st0 ibs = 1024 obs = 2048 of = / dev / st1 - » Copying a 1KB Block Device to a 2KB Block Deviceĭd if = / dev / zero of = / dev / null bs = 100M count = 100ĭd if = / dev / zero of = / dev / sda bs = 512 count = 2ĭd if = / dev / zero of = / dev / sda seek = (number_of_sectors - 20) bs = 1kĮrase GPT from disk. All of these will be dealt with in the following list. You can have only the input part of your dd command, or only the output command, and you can even remove both in some cases. As you will see, you can use dd in a network context to send data streams over your LAN, for example. ![]() mainly anything you can write to or read from. Input_data y output_data they can be disks, partitions, files, devices. # dd if = $ input_data of = $ output_data So we recommend extra care when using dd because a moment of carelessness can cost you your valuable data. First of all, the name comes from data duplicator, but humorously it is also said to mean disk destroyer or data destroyer because it is a very powerful tool. General use:īefore we start we wanted to give you a general idea of how it is used dd. Yes, this term (Swiss Army Knife) is used more than it should by Linux-oriented article writers, so we couldn't pass up the opportunity to use it ourselves. This almost makes it one of the Swiss Army knives of the Linux world. We chose dd as the first contender in our series because it is a useful tool that has many options, as you will see.
0 Comments
Leave a Reply. |