0% found this document useful (0 votes)
59 views20 pages

Clonezilla Server

Pablo Garcia describes how to set up a Clonezilla Server Edition on Ubuntu 10.04 to allow cloning multiple computers simultaneously via multicasting. The process involves installing DRBL (which includes Clonezilla), configuring networking with a main NIC and virtual NIC for Clonezilla, and running the DRBL and Clonezilla configuration programs. Key steps are adding the Clonezilla repository, installing DRBL, configuring the network interfaces file, and answering questions during DRBL and Clonezilla setup to configure the server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views20 pages

Clonezilla Server

Pablo Garcia describes how to set up a Clonezilla Server Edition on Ubuntu 10.04 to allow cloning multiple computers simultaneously via multicasting. The process involves installing DRBL (which includes Clonezilla), configuring networking with a main NIC and virtual NIC for Clonezilla, and running the DRBL and Clonezilla configuration programs. Key steps are adding the Clonezilla repository, installing DRBL, configuring the network interfaces file, and answering questions during DRBL and Clonezilla setup to configure the server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Setup a Clonezilla Server on Ubuntu

Pablo Garcia

At work I am solely in charge of approximately 200 computers, this has led me to become sort of an
expert in cloning. I have tested many commercial packages and none come close to Clonezilla. Clonezilla
has two versions: Clonezilla live, which as its name states, runs from a live CD and Clonezilla SE (Server
Edition). In this article I will describe how to install the SE version on the latest Ubuntu release (10.04
Lucid Lynx). Please note that this is a walkthrough so do not let the length of the article scare
you. The set-up is actually very easy with this article. I have also written a tutorial on how to use
Clonezilla.

One key advantage of the server version is that it allows for multicasting, which the live version does
not. Multicasting basically allows many computers to be cloned simultaneously and in the same
amount of time it would take cloning a single computer. Multicasting allows the user to restore a
large groups of computers across the network in a matter of minutes. As an example, let say that you
have 40 new computers that just arrived and you need to have them all up and running by tomorrow.
Clonezilla can get the job done in 10 minutes! and I am not talking about 10 minutes per computer, I am
talking about 10 minutes for the whole batch! Restoring a 5 GB compressed image on 40 computers at
once in 10 minutes; Sounds incredible? I could not believe it myself until I tried it. On the other hand, the
Clonezilla live CD communicates with each computer individually, making the restoration time dependent
on the amount of computers being restored. Another advantage of the server edition is the fact that you
can have your own cloning station ready to save or restore any computer at any given time and to
provide a storage location for all your images. If you are wondering what Clonezilla version is right for
you, read my article: Clonezilla Live Vs. Clonezilla Server (DRBL).

Prepare Ubuntu
Clonezilla SE works by providing a boo-table environment for clients though the network. For this
purpose a DHCP server will have to be installed. You will have to make sure that none of the computers
in your organization are set to boot from network as first boot device, otherwise they might boot to
Clonezilla instead of their own operating system. There is a way around this: A file can be created with
all MAC addresses of the computers to be cloned. This will prevent the server from booting unwanted
machines. However, from experience I have found that it is easier to just boot the desired machines from
network manually and once booted into Clonezilla the cloning process can be started from the server with
the click of a button.

1) Enable “Universe” and “Multiverse” repositories under: System -> Administration -> Software
Sources.

2) Open your sources list file to add the Clonezilla repository issuing the following command at your shell
prompt:

sudo gedit /etc/apt/sources.list

3) Add the following line at the bottom of the file and save it.
deb http://drbl.sourceforge.net/drbl-core drbl stable

4) Download the GPG Key for the new clonezilla source repository by issuing the following command at
your shell prompt:

wget http://drbl.sourceforge.net/GPG-KEY-DRBL

5) Add the key with the following command:

sudo apt-key add GPG-KEY-DRBL

6) Make sure operating system is fully updated by issuing the following command at your shell prompt:

sudo apt-get update

Setup Ubuntu’s Network Configuration


1) Uninstall Network Manager by issuing the following command at the shell prompt (This is optional, it
is done because network manager sometimes does not like the virtual interface created for
Clonezilla. I had no problems with network manager in Ubuntu 10.04)

sudo apt-get remove network-manager

2) Type the following command at a terminal screen to open your network interfaces configuration file:

sudo gedit /etc/network/interfaces

Edit the file to look as the one displayed below; you can copy – paste this information to your interfaces
file. As you can see on the configuration below we have two interfaces, eth0 and eth0:0. Eth0 is your
main network card’s IP configuration; we are going to use this to connect to the web, etc. eth0:0 is
a “virtual” interface which we will use for Clonezilla. Just remember to match eth0’s IP
configuration with that of your local network and to make eth0:0 IP a totally different subnet from
that of eth0, look at the example down below. etho is 192.168.1.200 and eth0:0 is 192.168.99.200 is
eth0:0, so they don’t conflict. Also, Clonezilla’s virtual interface, eth0:0 must use a “class C” IP
address (e.g. 192.168.x.x) otherwise muticasting effectiveness will be greatly reduced.

#Loopback
auto lo

iface lo inet loopback

#Network Interface, this should match your network

auto eth0

iface eth0 inet static

address 192.168.1.200

netmask 255.255.255.0

gateway 192.168.1.1

#Virtual Interface for Conezilla, make sure you use a "class C" IP
(192.168.x.x)

auto eth0:0

iface eth0:0 inet static

address 192.168.99.200

netmask 255.255.255.0

Install DRBL
1) To install DRBL (which comes with Clonezilla in one package) issue the following command:

sudo apt-get install drbl

This is all you have to do. You do not need to install any dependencies, since it all comes in one package.

Setup DRBL
To start the DRBL setup, issue the following command:

sudo /opt/drbl/sbin/drblsrv -i

Clonezilla (DRBL) setup will begin. Answer everything as you see it below. Do not worry if you make a
mistake, you can always start the set-up again issuing the same previous command.
The first question basically asks you if you want to install other Linux images, answer “N”

Do you want to install the network installation boot images so that you can let the client
computer install some GNU/Linux distributions (Debian, Ubuntu, RedHat Linux, Fedora Core,
Mandriva, CentOS and OpenSuSE…) via a network connection? !!NOTE!! This will download a lot
of files (Typically > 100 MB) so it might take a few minutes. If the client computer has a
hard drive that you may install GNU/Linux onto, put a Y here. If you answer “no” here, you can
run “drbl-netinstall” to install them later.
[y/N] N

Next question asks if you would like to use a serial console instead of a GUI, so choose “N”

Do you want to use the serial console output on the client computer(s)?
If you do NOT know what to pick, say “N” here, otherwise the client computer(s) may show
NOTHING on the screen!
[y/N] N

Next question asks about the type architecture used in your CPU. Since practically all of today’s PCs are
i586, choose “1“.

Which CPU architecture kernel do you want to assign for the DRBL client computer(s)?
0 -> i386 CPU architecture
1 -> i586 CPU architecture
2 -> Use the same architecture as this DRBL server
Note! Note Note! Note! Note! Note! Note!
NOTE!!! If the client computer(s) is not the same architecture as this server, please pick “0”
or “1”, otherwise your client computer(s) will NOT be able to boot.
If you use wrong architecture type kernel, the glibc and openssl package might use i686 or
i386 while the kernel might use i686, i586, or i386, which might be not suitable for all your
computer(s).
[2] 1

Select “N” in the next question. You do not want DRBL to upgrade your operating system. Next, DRBL
will begin downloading and installing all its dependencies.

Do you want to upgrade the operating system?


[y/N] N

After DRBL finishes downloading and installing all its dependencies, we are done installing DRBL. Next we
will be configuring Clonezilla.

Configure Clonezilla
Enter the following command at your shell prompt to start configuring Clonezilla:
sudo /opt/drbl/sbin/drblpush -i

Again, do not worry about making a mistake you can always issue the same command to start
over.

At the first question just press “enter” to leave the default name.

Please enter DNS domain (such as drbl.sf.net):


[DRBL.name]

At the second question again just press “enter” to leave the default nis/yp domain name.

Please enter NIS/YP domain name:


[penguinzilla]

At the third question again just press “enter” to leave the default server name.

Please enter the client hostname prefix:


This prefix is used to automatically create hostname for clients. If you want to overwrite
some or all automatically created hostnames, press Ctrl-C to quit this program now, edit
/opt/drbl/conf/client-ip-hostname, then run this program again.
[servername]

The fourth question asks to choose which card to use to go to the internet, previously we chose eth0 as
our connection to the web and eth0:0 as our virtual interface for Clonezilla, so enter “eth0”

eth0: IP address 192.168.1.200, netmask 255.255.255.0


eth0:0: IP address 192.168.99.200, netmask 255.255.255.0
Configured ethernet card(s) found in your system: eth0 eth0:0
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
The public IP address of this server is NOT found.
Which ethernet port in this server is for public Internet accsess, not for DRBL connection?
Available ethernet ports in this server:
eth0 (192.168.1.200), eth0:0 (192.168.99.200),
[eth0] eth0

If you get a message telling you that your Clonezilla IP (eth0:0) is on a class A or B network, make sure
you change it to a “Class C” (e.g. 192.168.x.x) and start Clonezilla’s configuration over, otherwise
multicasting’s effectiveness will be greatly reduced.

Next question asks if you want to collect MAC addresses of computers to be cloned; this is done so that
only computers that are going to be cloned get assigned an IP from DRBL. I find this time consuming
and unnecessary, since it is easier to turn DRBL off once you are done cloning so that it does not conflict
with your network’s DHCP server. DRBL is very easy to turn on and off with a simple short-cut on your
server’s desktop. So we are going to choose “N“.
(…summary…) Now we can collect the MAC address of clients!
Do you want to collect them?
[y/N] N

Since we chose not to collect mac addresses we will choose “N” in the next question.

Do you want to let the DHCP service in DRBL server offer same IP address to the client every
time when client boots (If you want this function, you have to collect the MAC addresses of
clients, and save them in file(s) (as in the previous procedure)). This is for the clients
connected to DRBL server’s ethernet network interface eth0:0 ?
[y/N] N

Next question asks what will be the starting IP number assigned to client computers; you can leave it at
“1” since no other computers should be using the Clonezilla subnet.

What is the initial number do you want to use in the last set of digits in the IP (i.e. the
initial value of d in the IP address a.b.c.d) for DRBL clients connected to this ethernet port
eth0:0.
[1] 1

Next question asks how many computers do you want to clone at a time; you can set this to whatever
you want as long as it is not ridiculously high, for this example we are going to leave it at “12”
computers.

How many DRBL clients (PC for students) connected to DRBL server’s ethernet network interface
eth0:0 ?
Please enter the number:
[12] 12

Do you accept what we did in the previous question? Select “Y” (self explanatory).

The final number in the last set of digits in the client’s IP address is “12”. We will set the
IP address for the clients connected to DRBL server’s ethernet network interface eth0:0
as: 192.168.99.1 – 192.168.99.12 Accept ?
[Y/n] Y

Next, Clonezilla will show you how your network configuration will look like; this is just information so
press “enter“.

The Layout for your DRBL environment:


******************************************************
NIC NIC IP Clients
+———————————————————————————+
| DRBL SERVER |
| |
| +– [eth0] 10.0.2.100 +- to WAN
| |
| +– [eth0:0] 192.168.99.200 +- to clients group 0:0 [12 clients, IPs 192.168.99.1 – 12]
| |
+———————————————————————————+
******************************************************
Total clients: 12
******************************************************
Press Enter to continue…

Clonezilla will then ask you if you want to have the option of booting computer to Linux using the
network, we are just setting the server for cloning so choose option “2“.

In the system, there are 3 modes for diskless linux services:


[0] Full DRBL mode, every client has its own NFS based /etc and /var.
[1] DRBL SSI (Single system image) mode, every client uses tmpfs based /etc and /var. In this
mode, the loading and necessary disk space of server will be lighter. NOTE! (a) The client
machine memory is recommended at least 256 MB. (b) The setting and config files of client will
not be saved to the DRBL server! They are just used once and will vanish after the machine
shutdowns! Besides, if you modify any file in the template client (located in
/tftpboot/nodes), you have to run /opt/drbl/sbin/drbl-gen-ssi-files to create the template
tarball in /tftpboot/node_root/drbl_ssi/. (c) If you want to provide some file to overwrite
the setting in the template tarball when client boots, check
/tftpboot/node_root/drbl_ssi/clients/00_README for more details.
[2] I do NOT want to provide diskless Linux service to client.
Which mode do you prefer?
[0] 2

Choose Clonezilla box mode, option “1“. This way the whole cloning operation will be lighter on the
server.

In the system, there are 4 modes available for clonezilla:


[0] Full Clonezilla mode, every client has its own NFS based /etc and /var.
[1] Clonezilla box mode, every client uses tmpfs based /etc and /var. In this mode, the
loading and necessary disk space of server will be lighter than that in Full Clonezilla mode.
Note! In Clonezilla box mode, the setting and config files of client will not be saved to the
DRBL server! They just use once and will vanish after the machine shutdowns!
[2] I do NOT want clonezilla.
[3] Use Clonezilla live as the OS (Operating System) of clients (Testing).
Which mode do you prefer?
[0] 1

Next question asks what will be the default directory where you want to store your images. To me the
default “/home/partimag” is not intuitive, so I change it to “/clonezilla” so it can be easily accessible
in the file-system. But this is up to you; just remember that if you decide to change it make sure you
create the new folder manually, since the setup will not do it for you.

The CPU arch for clients when running Clonezilla job: i486
——————————————————
When using clonezilla, which directory in this server you want to store the saved image
(Please use absolute path, and do NOT assign it under /mnt/, /media/ or /tmp/)?
[/home/partimag] /clonezilla

Unless you want to be annoyed with a password prompt every time you want to clone a computer or you
are a security freak, choose “N” in the next question.
Do you want to set the pxelinux password for clients so that when client boots, a password
must be entered to startup (For better security)
[y/N] N

Choose “N” at the next question as well, you do not need a boot prompt for clients

Do you want to set the boot prompt for clients?


[y/N] N

I recommend you choose “Y” in the next question; graphic backgrounds look friendlier.

Do you want to use graphic background for PXE menu when client boots?
Note! If you use graphical PXELinux menu, however client fails to boot, you can switch to text
mode by running “/opt/drbl/sbin/switch-pxe-bg-mode -m text”.
[y/N] Y

Choose “N” in the next question (self explanatory).

Do you want to use DRBL server as a NAT server? If not, your DRBL client will not be able the
internet.
[y/N] Y

Choose “Y” of course to finish.

We are now ready to deploy the files to the system!


Warning! If you go on your firewall rules will be overwritten during setup…
[Y/n] Y

Start Clonezilla Server


Now that we have finished configuring Clonezilla we need to start our server to get it ready for cloning.
Type the following at the command prompt:

sudo /opt/drbl/sbin/dcs

At the first screen Choose “Select all the clients“.


At the second Screen Choose “clonezilla-start“.

At the third screen I recommend using “Beginner mode” for now. However, if the cloning process gets
stuck when trying to clone your clients, you will have to restart the server later on and choose “Expert
Mode”, since it gives you more options you can tweak to make it work.

In the fourth screen choose “select-in-client“. This gives you to option to choose whether to restore or
save the image during Clonezilla’s booting process in the client itself.
Leave the two last options as they are and click “ok” and we are done!

Create desktop shortcuts to start and stop


Clonezilla (Optional)

I highly recommend you create shortcuts on your server’s desktop to “start”, “start using multicasting”
and “stop” clonezilla server. This will make it a lot easier, since, sometimes you might want to clone a
group of computers at the same time using multicasting. This way you can do it by the click of a button
instead of having to reconfigure the server. Also, multicasting is picky and it does not always work on all
computers. In case multicasting does not work for you, you can always go back to regular Clonezilla
operating mode just by clicking on a shortcut, etc. Stopping the Clonezilla is also convenient when you
need to restart, or to disable the DRBL so it does not interfere with other DHCP servers on the network.

“Start Clonezilla” Shortcut

Right click on your desktop and select “Create Document” -> “Empty File”. Paste the following
information inside the file and save it with the name “Start-Clonezilla.sh”.

#!/bin/bashecho "Clonezilla Starting"

'/etc/init.d/dhcp3-server' start
/opt/drbl/sbin/drbl-ocs -b -l en_US -y1 -p choose select_in_client

Right-click on your newly created shortcut; select “Properties” and click on the “Permissions” tab and
check “Enable executing file as a program“.

“Start Clonezilla Using Multicasting” Shortcut

Right click on you desktop and select “Create Document” -> “Empty File”. Paste the following information
inside the file and save it with the name “Start-Clonezilla-Multicasting.sh”.

#!/bin/bashecho "Clonezilla Starting"'/etc/init.d/dhcp3-server' start

/opt/drbl/sbin/drbl-ocs -b -g auto -e1 auto -e2 -x -j2 -p reboot --clients-


to-wait 8

--max-time-to-wait 250 -l en_US.UTF-8 startdisk multicast_restore CLIENT-NAME


sda

Substitute “CLIENT NAME” with the name of the image you wish to use for cloning your clients. Right-
click on your newly created shortcut, select “Properties” and click on the “Permissions” tab and check
“Enable executing file as a program“.

“Stop Clonezilla” Shortcut

Right click on your desktop and select “Create Document” -> “Empty File”. Paste the following
information inside the file and save it with the name “Stop-Clonezilla.sh”.

#!/bin/bash echo "Clonezilla Stopping"

/opt/drbl/sbin/clean-dhcpd-lease

'/etc/init.d/dhcp3-server' stop

/opt/drbl/sbin/drbl-ocs stop

Right-click on your newly created shortcut, select “Properties” and click on the “Permissions” tab and
check “Enable executing file as a program“.
Making and Restoring an Image
Now that you have your server up and running you need to learn how to use clonezilla, I have written a
tutorial for this.

How to Use Clonezilla – Tutorial


Pablo Garcia

In past I have written articles describing differences between Clonezilla SE and CLonezilla Live and how
to setup a Clonezilla server. However, many people kept asking me for instructions on how to use
Clonezilla. That is why I decided to write this tutorial. For those of you not familiar with Clonezilla, it is a
free disk cloning utility that will let you image hard drives via a USB or Ethernet connection. In this
tutorial we are going to be using Clonezilla Live to clone a computer’s internal hard drive to a USB
external drive. The instructions, however,0 should be pretty much the same for Clonezilla Server Edition.
As opposite to other Clonezilla tutorials on the web, I have tried to make this tutorial as detailed as
possible, including instructions for “saving” as well as “restoring” the image. Do not be scared by the
length of the article; this is actually a walkthrough, so it should be very easy for everybody to
understand.

Download Clonezilla Live, burn the iso image (you can use the free Imgburn for this) and boot the
computer from the CD. As I previously stated, for those of you using Clonezilla Server the instructions
should be pretty much the same, except that instead of booting from a LiveCD, you will be booting from
the network connecting to a Clonezilla server which will store your image. The server will provide the
Clonezilla wizard via the network connection.

Most of the items in this tutorial are self explanatory, but I will go through all of them in case of doubts in
any particular step.

Saving the Image


Insert the liveCD in you CD-ROM and boot from it.

1) At the first screen just click enter.


2) Next, choose your language.

3) Choose the way your keyboard is laid out. If you are in North America just click enter. If you are not in
North America your keyboard most likely has a different layout than the default chosen by Clonezilla.
Choose the one that pertains to your country.
4) If your “destination” drive is already partitioned and formated in a filesystem Linux understands (e.g.
Ext2, Ext3, Ext4, Fat32, etc.), choose “Start_Clonezilla“. If it is not, then click “Enter_shell” and
format it. Make sure you identify the drive properly before formatting it, otherwise you can format the
wrong one and lose your data. When done, type “ocs-live” to return to the Clonezilla wizard.

5) For this tutorial we are going to make an “image“. Images are compressed files not designed to be
accessible, they are meant to be stored away for later use. So, we are going to choose “device-image“.
The next option “device-device” as its name indicates, is used when you want to clone two hard drives
in one step without creating an image.
6) Select the destination location. This is where you are going to save your image to. For this tutorial, we
are going to be choosing the first option “local_dev“. However, if you do not have a USB drive available,
notice that you can also save the image to a wide variety of shared drives on your network.

7) Next, Clonezilla will try to detect your USB drive. Connect the USB drive when Clonezilla asks you
to do so, then wait a few seconds to give Linux time to recognize the drive and click enter to
continue.

8) Select the destination drive. This is the drive you are going to be saving your image to. If your USB
hard drive did not get detected on the previous step and it is not appearing on the list, appears
intermittently or just won’t format at all, read the section “Problematic Drives” in my article: How to
Format a USB External Hard Drive for Linux.
9) Next, Clonezilla will ask you for a directory in your destination drive, where you would like to save
your image to. If your destination drive is empty (like the one in the picture below), just choose
“Top_directory_in_the_local_device“.

10) To shorten the steps needed to finish, choose “Beginner“. If you have limited space on your
destination drive and want to choose a more suitable compression method, other than the default chosen
by Clonezilla, choose “Expert”. Expert mode also lets you modify other settings which are useful
whenever you have trouble during the cloning process.

11) For this tutorial choose “savedisk“. This will make an image of the entire “source” hard drive. If you
wish to make an image of only one partition, choose “saveparts“.
12) Type the name you wish to have for your image; I usually make it the model of the computer and the
date, for example: toshiba-satellite-02-27-11, but this is entirely up to you.

13) Choose the “source” drive. This is the hard drive you wish to clone. Move up and down the list using
the arrows on your keyboard to the desired drive and then click on the space bar to select it.

14) Make sure everything looks good and click “enter” to continue.
15) Again make sure everything looks good, type “y” and click “enter” to start the imaging process.

Restoring the Image


To restore the image, follow steps 1 through 10 on the previous section of this tutorial.

11) Choose “restore_disk“. If you previously backed up a partition instead of an entire drive, choose
“restoreparts”.

12) Choose the image you would like to restore.


13) Choose the “destination“. This is the drive where you will be extracting the image to. Make sure it is
empty, since all its contents will be erased.

14) Finally, Clonezilla will ask you twice if you would like to start the process. If you are sure the
destination drive is empty, choose yes to start the process.
Final thoughts
Clonezilla is a proven imaging solution; a solution which is powerful, reliable, versatile and free. It is
certainly my favorite disk cloning utility. I hope this Clonezilla Live tutorial has been useful to you. If you
have any questions about Clonezilla Live or Clonezilla Server, feel free to ask.

- See more at: http://www.geekyprojects.com/cloning/how-to-use-clonezilla-


tutorial/#sthash.oEBIUTCG.dpuf

You might also like