# Disk Duplication

`dd`is a command for low-level copying. As the disks on \*nix platform are represented like normal files, so `dd` can take input from/output to these devices. We can also use `dd` to create a `virtual disk`.

To begin with, let 's try the following command:

```
sudo dd if=FILE of=FILE bs=BYTES count=BLOCKS
```

`dd`takes few arguments:

* `if`

  : Input file FILE (e.g., /dev/zero,/dev/urandom)
* `of`

  : Output file FILE
* `bs`

  : Block size: read and write BYTES bytes at a time.
* `count`

  : copy only BLOCKS input blocks.

## Example <a href="#example" id="example"></a>

Now we wish to create a file with zeros about 64MB

```
$ dd if=/dev/zero of=test.disk bs=64M count=1
```

After that, you can see the result showing:

![](https://2015623591-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lp-5TQpuuM0wVgRDmqL%2F-Lp-5WZ7mVLwEZ2xvCJW%2F-Lp-5n5do7CS5oBj6pcW%2Fdd.png?generation=1568738643042871\&alt=media)

PLEASE BE CAREFUL – `dd` is often nicknamed `disk destroyer` because it will happily overwrite any data you tell it to, including the stuff you wanted to keep if you make a mistake typing the command!
