Multi-Copy Device

SourceForge Project Page | Public License GPL | Download Logo


Multi-Copy Device
  What is mdcp?
  License of use
  How to use mdcp
  When use mdcp
  Comparative Analysis
  SF Project Page



lastest release: 0.1.2 "shine" @ 12 Apr 2008


13 Apr 2008

Binary packeges for version 0.1.2 Shine

Now are available binary packages in RPM format (for linux based on rpm) and TBZ for FreeBSD 6.2 and 7.0 (tbz).

12 Apr 2008

New Release 0.1.2 "Shine" avaliable!

- Included a man page.
- Improved the copy for many devices: Now, when a disk fails (ex. when is full) it is removed from work, and the system still coping to others destinations.
- Improved style of statistics at and of copies.

- Fixed a problem when compiling on sistems that no need for librt.
- Fixed segmentation fail when try to refer to inacessible/inexistent files.
- Fixed a integer overflow on showing readed/written bytes.
- Fixed a problem when verifing inconsistent arguments.

9 Apr 2008

First Release of mdcp 0.1.1 "morning" avaliable!

^ Top



mdcp is a command-line utility for *nix that provide to copy from a disk device to many. The data transfer rate is improved by making use of a much more efficient use of the disks transfer rate.

The origin data is read only once, and is replicated in the destination devices. All working in parallel: all disks working at the same time, almost without interruption.

Thus, the time to copy between devices falls considerably in relation to others existing utilities used to same propose - such as "dd".

This system was developed aiming to reduce the time of the cloning of discs with pre-installed operating systems for multiple machines, but can be used for a big variety of porpouses.

^ Top 



This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <>.

^ Top 



The sintax of comand-line utility is of form:

mdcp <bs> <count> <fileIn> <fileOut1> ... <fileOutN>
< bs> : Block size. Leave it 0 to default size 32768
< count> : Copy only <count> blocks. Leave it 0 for copy until find EOF
< fileIn> : Device to be read
< fileOutN> : Device to be written

To copy from file "linux-hd1.img" to the devices hdb, hdc, and hdd:
# mdcp 0 0 linux-hd1.img hdb hdc hdd

To copy from device hda to hdb and hdc, first 1GB of data:
# mdcp 32768 32768 /dev/hda /dev/hdb /dev/hdc

note that 32768 * 32768 = 1073741824 = 1GB

To zero-fill the firsts 10GB from devices hdb, hdc and hdd you can do:
# mdcp 0 327680 /dev/zero /dev/hdb /dev/hdc /dev/hdd

Note that the name of the devices will can be change acordling to wich OS you are.

At FreeBSD OS, a copy would like as:
# mdcp 0 0 myimg.img /dev/ad1 /dev/ad2 /dev/ad3

^ Top 



Copying 1 gigabyte (1,073,741,824 bytes) among IDE hard disks (UDMA 133)


UTILITY FROM TO TIME(secs) Rate (b/s)
dd 0:0 1:0 29 37,025,580
dd 1:0 1:1 40 26,843,545
mdcp 0:0 1:0 20 53,687,091
mdcp 1:0 1:1 38 28,256,363
mdcp 0:0 0:1, 1:0 32 67,108,864
mdcp 0:0 1:0, 1:1 38 56,512,727
mdcp 0:0 0:1, 1:0, 1:1 40 80,530,636

0:0 = IDE 0 : Master
0:1 = IDE 0 : Slave
1:0 = IDE 1 : Master
1:1 = IDE 1 : Slave Teste Details:
Parameters passed to utilitys: block Size = 32768, count = 32768
Hardware: Pentium 4, 1.8GHz, 512MB of RAM
OS: FreeBSD 7

^ Top 



Based in the analysis, the conclusion is that the the copy using mdcp is much fast when copying for more then one fisical disk devices, and is recomended its use in this case: it was designed for this.

To copy from a disk to another single disk, your performance is still better that the conventional mode.

Although, when copying for diferent slices (or files) at same physical disk, the performance is decreased because cause a disk's overhead. Thus, for this situations is more indicated the convencional mode of copying.

^ Top 



Written by Wagner Monzyne, email <>

^ Top 



Copyrigth Wagner Monzyne 2008