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.
First, you will need too configure two network cards. These can either be physical cards or one can be a virtual one. I am using a virtual interface for the second card.
Installing Clonezilla.
The first step is to install the key for the Clonezilla repository. Enter the following in the terminal to download the key:
wget http://drbl.nchc.org.tw/GPG-KEY-DRBL
Second, add the key:
sudo apt-key add GPG-KEY-DRBL
Third, we need to add the Clonezilla repository to the apt source.list file. Enter the following to open /etc/apt/source.list in the gedit or vi text editor:
sudo gedit /etc/apt/sources.list
Add the following two lines to the bottom of the file. Make sure to replace “karmic” with the name of the Ubuntu distribution you are using. I.E. Lucid, Natty or whatever ....
deb http://free.nchc.org.tw/ubuntu karmic main restricted universe multiverse
deb http://free.nchc.org.tw/drbl-core drbl stable
deb http://free.nchc.org.tw/drbl-core drbl stable
Once you have added the Clonezilla repository to your source list, you can run the following two commands to update your list and install drbl:
sudo apt-get update
sudo apt-get install drbl
sudo apt-get install drbl
Once drbl is installed we can go ahead and install all the dependencies for Clonezilla. NIS will fail to launch at this point. Just ignore it. We will configure it later.
sudo apt-get install util-linux tar gzip bzip2 procps dialog rsync parted pciutils tcpdump bc grub gawk hdparm sdparm netcat file ethtool etherwake ssh syslinux mtools mkisofs reiserfsprogs e2fsprogs psmisc locales wget disktype zip unzip initscripts dhcp3-server tftpd-hpa nfs-kernel-server nis ntp curl lftp iptables sysutils libdigest-sha1-perl
sudo apt-get install partclone mkpxeinitrd-net clonezilla mkswap-uuid drbl-partimage drbl-ntfsprogs drbl-chntpw drbl-lzop udpcast drbl-etherboot freedos
sudo apt-get install lvm2 ntfs-3g lshw
Setup Ubuntu’s Network Configuration
1) Uninstall Network Manager by issuing the following command at the shell prompt
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
Install DRBL
1) To install DRBL (which comes with Clonezilla in one package) issue the following command:
sudo apt-get install drbl
Setup DRBL
To start the DRBL setup, issue the following command:
sudo /opt/drbl/sbin/drblsrv -i
Clonezilla (DRBL) setup will begin. The first question basically asks you if you want to install other Linux images, answer “N“
Next question asks if you would like to use a serial console instead of a GUI, so choose “N“
Next question asks about the type architecture used in your CPU. Since practically all of today’s PCs are i586, choose ”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.
Configure Clonezilla
Enter the following command at your shell prompt to start configuring Clonezilla:
sudo /opt/drbl/sbin/drblpush -i
At the first question just press “enter” to leave the default name.
At the second question again just press “enter” to leave the default nis/yp domain name.
At the third question again just press “enter” to leave the default server name.
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“
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“.
Since we chose not to collect mac addresses we will choose “N” in the next question.
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.
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 “13” computers.
Do you accept what we did in the previous question? Select “Y” (self explanatory).
Next, Clonezilla will show you how your network configuration will look like; this is just information so press “enter“.
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“.
Choose Clonezilla box mode, option “1“. This way the whole cloning operation will be lighter on the server.
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.
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.
Choose “N” at the next question as well, you do not need a boot prompt for clients
Choose “N” at the next question as well, you do not need a boot prompt for clients
I recommend you choose “Y” in the next question; graphic backgrounds look friendlier.
Choose “N” in the next question
Choose “Y” of course to finish.
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“.
Atthe 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!
No comments:
Post a Comment