
Gnetic v0.4.1

Using gnetic.

 1 Introduction.
 	1.1 Gnetic description.
 	1.2 Nomenclature.
	1.3 Supported filesystems.
	1.4 Software required to use gnetic.
	1.5 Compiling gnetic.
	1.6 Supported platforms.
	1.7 Terms of distribution of gnetic.
 2 Using gnetic.
 	2.1 Local use.
	2.2 Network use.
		2.2.1 Point to point.
		2.2.2 Link mode.
	2.3 Command line options.
 3 After using gnetic.
	3.1 The boot sector.
	3.2 The partitions.
 4 Authors

  Copyright (C)  2008 Joan Lledó.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with the Invariant Sections being list their titles, with the
  Front-Cover Texts being list, and with the Back-Cover Texts being list.
  A copy of the license is included in the file "fdl-1.2.txt".


1. INTRODUCTION
1.1 Gnetic description
Gnetic is a free project developed in C to create and restore backups of a disk or partition. It is also possible to work over the network, sending the images through the network to its recipients, or "on the fly" to generate the image in real time while it is sent to the network.

1.2 Nomenclature
It is important to know the nomenclature of gnetic. All of the the terms form part of an analogy (more or less) between a chain of DNA and a chain of bits, which store all of the information of a living being or a computer, respectively. Also, the term "clone" is used in biology as in computing. The last case refers to the transfer of all the information from one computer to another, or from one CD to another, and make a perfect copy.
In Gnetic, the backup copies are files called DNA images, because they contain all of the information necessary for a computer to be able to create a perfect copy of another computer. Working over the internet, there are two types of computers in Gnetic: the server, and the client (or clients).
Server: There is only one in a Gnetic network. It is the computer that will transmit the image to the client or clients.
Client: There is at least one client in a Gnetic network, but there can be up to 64 (This number can increase or decrease if specified from the command line). It receives the image from the server. All data on disk or partition of the receptor to be cloned will be lost.
Gnetic programmers do not know anything about biology or genetic engineering.

1.3 Supported filesystems
All of the code of Gnetic that interacts with the physical devices, disks or partitions, is based on GNU Parted. So Gnetic depends to a great extent on the systems that Parted supports. You can see a list of the systems supported by Parted at http://www.gnu.org/software/parted/features.shtml. Some file systems like ext3 can not be created using the parted library. To this end gnetic use other applications, free.

Filesystem		Necessary support utility
ext2					libparted
ext3					mke2fs
ext4					mke2fs
jfs						jfs_mkfs
xfs						mkfs.xfs
reiserfs				mkreiserfs
linux-swap				libparted
hfs						hformat
fat16					libparted
fat32					libparted
ntfs					mkntfs

1.4 Required Software
It is necessary to have the library libparted-1.6 or later installed, without it Gnetic will not function. The libraries e2fs, uuid, and libselinux are also required. Also, in order to create some filesystems it is necessary to have some applications. Gnetic works fine without them, but you cannot restore images if you don't have the necessary utility associated with that filesystem. To know which utility is needed for a particular system you can refer to the the table of Filesystems.

1.5 Compliling Gnetic
As usual, to compile gnetic you only have to execute the classic commands:
	./configure
	make
And if you wish to install it on your system, execute as root:
	make install

It is necessary to make sure that you possess the development libraries necessary for the compiliation:
- libparted-dev (1.6 o posterior)
- e2fslibs-dev
- uuid-dev
- libselinux1-dev

1.6 Supported Platforms
Currently, Gnetic only has been compiled in GNU/Linux

1.7 Terms of Distribution
Gnetic is open source, with the GNU General Public License Version 2. The complete license is included with Gnetic in the file COPYING. In any case, you can write to Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

2 USING GNETIC
2.1 Local Use
Local use of Gnetic is limited to creating DNA images of a disk or partition, or restoring images created previously on a disk or partition.
If you have a system with LVM and wish to clone it with gnetic, you can follow the detailed instructions in the following HOWTO: http://gnetic.nongnu.org/en/howto-lvm.html

2.2 Uso en red
Gnetic permits you to work over the internet, and here is where it really becomes useful, as it allows you to restore images created on another computer. It is important to consider whenever working with Gnetic on a network, all of the clients should be waiting before launching Gnetic on the server. An explanation of the possibilities of Gnetic over a network follows.

2.2.1 Point to Point
Esta forma de trabajar abre una conexión TCP entre dos máquinas. El emisor debe especificar la dirección IP de la máquina que recibirá sus datos. Por otro lado, el receptor únicamente quedará esperando a que el emisor contacte con él para recibir sus datos.

2.2.2 Chain Mode
This mode is based on the formation of a network into a chain in which the server organizes all of the clients so that each node or link in the chain only sends data to the following link. To use this technique, the clients are left waiting while the server contacts each of them and gives them a place in the chain. Once this network is formed, the server begins to send its data and the clients will transmit this following in the order of the chain until the data arrives at the last. At the same time, they are writing this same information to their hard disk.
You can download a diagram explaining how the clients are organized at the following link: http://gnetic.nongnu.org/doc/esquema-en.png

2.3 Command line options.
Here will detail in the most depth how to use Gnetic from the command line.

Synopsis:
 		gnetic FUNCTION [ -d, --device DEVICE ] [ -f, --file  ] ] 
        [ -a, --address CLIENT IP ]  [ -m, --max-hosts NUMBER ] 
        [ -w, --wait SECONDS ]   [ -q, --quick ]
        [ -b, --broadcast IP-BROADCAST ]  [ -n, --no-data ]
        [ -g, --grub-install BOOT PARTITION ]

Arguments:
-d, --device: 		The device you are going to use. Examples: "/dev/hda", "/dev/hdb2"
-f, --file: 		The file you are going to make. Example: "~/backups/hda.dna"
-a, --address: 		IP address you are going to contact. Example: "192.168.1.3"
-m, --max-hosts:	Number of links the network will support. The bigger this number is, the
 					more RAM gnetic will consume. If you don't use this, the figure will be 64.
-w, --wait			Time in seconds that the server should wait while the clients answer.
					By default it is 5 seconds.
-q, --quick			This option eliminates the progress bar to gain speed.
-b, --broadcast		With this option you can specify the address to broadcast over the network in case gnetic is unable to 						determine it.
-n, --no-data		Use this option to save the structure of the partitions without data.
-g, --grub-install	Install grub without performing any other operation

OPTIONS:
These options don't involve the use of any other, and they can be used locally as well as over the network.
-m, --max-hosts		Specify the maximum number of clients the network will support.
					If none are specified, a maximum of 64 nodes will be established.
					Only takes affect if used by the server of the chain.
	Example: gnetic -sd /dev/hda -m 100
	Send the contents of /dev/hda over the network and specify that it can support up 99 clients

-w, --wait			Establish the time to wait until the clients respond
					By default 5 seconds.
					Only has effect if used by the server of a chain.
	Example: gnetic -sd /dev/hda -w 20
	Wait 20 seconds for the clients to answer and after that send the contents of /dev/hda

-q, --quick			This option eliminates the progress bar to gain speed.
					Only has effect if you use the option -d, when you only use option -f, the progress bar
					does not appear in either mode.
	Example: gnetic -cd /dev/hda -f ~/hdb1.dna -q
	Saves the data of /dev/hda1 in /home/usuario/hda1.dna without displaying the progress bar
	
-n, --no-data		Saves in the image only the partition table, with no data.
					It can be used both locally and networking.
					It only haves effect if you clone a disk, not a single partition.
	Example: gnetic -cd /dev/hda -f ~/hdb1-nodata.dna -n
	Only save the partition table of /dev/hda, without data.

FUNCTIONS:
For local use:
All of these options involve the use of -d and -f. In all of the cases the order of the parameters is irrelevant.
-c, --create		Create an image of a disk or partition.
	Example: gnetic -cd /dev/hda -f ~/backups/hda.dna
	Save the contents of /dev/hda in ~/backups/hda.dna
	
-r, --restore		Restore an image to a disk or partition.
	Example: gnetic -rf ~/backups/hda.dna -d /dev/hda
	Restore the contents of ~backups/hda.dna to /dev/hda
	
-g, --grub-install	Install grub in the device specified
	Example: gnetic -g /dev/hda1 -d /dev/hda
	Install GRUB in the MBR of /dev/hda using the configuration files of GRUB located in /dev/hda1

Network Use:
All of the network options involve the use of -d or -f. Depending on whether what you want to send or receive is an image or a device.

Point to Point connection:
-S, --p2p-server	Send the data (the option involves -a)
	Example: gnetic -Sa 192.168.1.3 -d /dev/hda
	Send the contents of /dev/hda to 192.168.1.3. If the number of the host DNS is entered in place of an IP, gnetic will determine your IP.
	
-C, --p2p-client	Recibe los datos.
	Receive the data
	Example: gnetic -Cd /dev/hda
	Receive information from the network and save it in /dev/hda.

	Example: gnetic -Cf ~/backups/hda.dna.
	Receive information from the network and save in ~/backups/hda.dna
	(Useful to create remote images)
	
Chain Mode connection:
-s, --sender-mode	Server, first link, transmission data.
	Example: gnetic -sd /dev/hda
	Send to the data of /dev/hda to the chain.

	Example: gnetic -sd /dev/hda -b 192.168.1.255
	Send the data of /dev/hda to the chain and specify the broadcast address of this network to 192.168.1.255
	
-l, --link-mode		Client, receive the data of the server
	Example: gnetic -ld /dev/hda
	Transfer to the computer in a node of the chain and save the data received to /dev/hda

	Example: gnetic -lf ~/backups/hda.dna
	Transfer to the computer in a node of the chain and save the data received in a .DNA file.
	This is useful if you want to clone computers on the fly and then save an
 	image in one of the nodes, for example the last one.

3. After using Gnetic
3.1 The boot sector
When you decide to create an image of an entire hard disk, the boot sector is also saved. This means that you have installed GRUB, this will be cloned as well with all of its options to the receiving machine. This will not be so if you only clone a partition.
If you wish, you can use gnetic to install GRUB after restoring a system or partition.

3.2 Partitions
It is possible that you created an image of a 40GB hard disk in the server, but afterwards you intend to restore this information on a 20GB hard disk (for example). This is not a problem for gnetic, the program only saves your files in the image, so if your files only occupy 10GB, the image will restore without problems. Additionally, the partitions adjust to the proportion they occupied in the original, which is to say, if you have a partition that occupied 70% of a 40GB disk, on the client the partition will occupy 70% of the 20GB disk, so long as your files can fit on that space, in any other case gnetic will return an error. If the original disk is smaller than the destination, the partitions will increase proportionally.

4 Autores
Gnetic was written by Jesús Burgos <jburmac@gmail.com>
with thJoan Lledójoanlluislledo@gmail.comdo@gmail.com>

