You are in Home page |
How to clone a Linux box using netcatDr. Emiliano Bruni
$Date: 2003/08/22 14:52:15 $ How to clone a Linux box using netcatCopyright © 2003-2003 by Emiliano Bruni
1. Introduction1.1. Why another method for cloning a Linux box?When i tried to find methods to clone a Linux box, i saw that the only good choise to do this was to use dd to duplicate an hard disk to a new one. This tool is a great tool when necessuty was to be sure that the cloned disk is identically to the original one, moreover thios method is indipendent to data present into the disk. Being a bit-to-bit copy of the original disk to the cloned one, it creates exactly the same partition structure and the same bootable flags. But this method suffers of some not secondary problems. First of all it's necessary to install a second disk to the linux box and so it's necessary to poweroff the computer that it's offline during installation. Even if it's possible to use the same tool we use in this document "netcat" to redirect data dd output to another computer, this possibility is negated from the fact that, to be a consistent copy, the original computer must be put in single-user mode to avoid that data changes during copy. In a copy bit-to-bit it's highly probabily to have data corruption if data changes during copy. Also if, in single-user mode, it's possible to make network link up, this is highly discouraged. Moreover, the fact that dd make a bit-to-bit copy, implies that it's necessary to copy empty disk sector too which, related to the increase of the dimension of disks, makes that it's necessary a lot of time to copy a disk to another. Owing to these problems this method it's not a good choise when the source computer it's a production online server. 1.2. Is there a solution?To find a satisfactory solution to the problem of backup an whole disk into another i try to find some tools that solve problems seen over but with same advantages of dd. Not having to use dd i try to use the other achive tool of unix family: tar. Locally tar program works well to produce an archive of whatever directory and, in union with a compressing tool like gzip or bzip is the standard way to distibute package programs. Now that I have found a good archive tool, I need a system to not install the destination disk into the source computer. Solution could be to install it to another computer and using network to transfer data to be copied. The problem is that the destination computer could have this only hard disk and so not to have an operating system and complex client-server software to support network operation. We'll see that the union of netcat tool with a CD linux distribution can solve the problem.
|