Sei in Home page
$Date: 2003/08/22 14:52:15 $
Many times it's necessary to have a clone of a linux box without modifying the original box. With a clone box you can have a backup or failover server, testing and developing new software solutions witho no trouble for the original services. The best way that I had found, was to use dd to clone the original hard disk to a new one. This solution take a lot of time with current large disks and requires, to work well, to be in single-user mode and to add and then remove the backup hard disk. This document describes an alternative solution of the problem that is more faster, works while the original box is working and it's no necessary to power off it because copy will be made to another box using netcat.
How to clone a Linux box using netcat
Copyright © 2003-2003 by Emiliano Bruni
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.
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.
|Copyrightę 1997-2006 Emiliano Bruni||Online dal 16/08/1998 con visitatori||Scrivimi all'indirizzo:|