29
CHAPTER 2
Using Ubuntu Server for
System Imaging
Clonezilla on Ubuntu Server
I
n the first chapter of this book, you read how to perform an enterprise network instal-
lation of Ubuntu Server. The topic of this chapter is somewhat related to installation of
Ubuntu Server. In this chapter you’ll learn how to set up a Clonezilla imaging server.
There may be several reasons why you would want to set up such a server. The most
important of them is that working with workstation images reduces help desk expenses.
If after a minimal period of troubleshooting it turns out that repairing a workstation is
going to take too long, it’s much faster just to restore the image of that workstation. Of
course, this assumes that all work- related files will be written to some other server first.
In this chapter you’ll learn how to set up Clonezilla for imaging.
Setting Up a Clonezilla Imaging Server
The Clonezilla imaging server is currently the most popular open source imaging solu-
tion. It has two versions, a stand- alone version and a server version. Whereas the stand-
alone version does well to make and restore images of single machines, you’ll need the
server version if you need to make images of multiple systems. In its current version, up
to 40 workstations can be imaged simultaneously using a method that uses broadcast or
multicast to ensure optimal use of network bandwidth.
Before installing the required software, make sure that your environment is set up for
imaging. Basically, it comes down to two elements:
CHAPTER 2
N
USING UBUNTU SERVER FOR SYSTEM IMAGING
30
s !FASTDEDICATEDNETWORKFORIMAGINGYOUDOABSOLUTELYWANT'IGABITORBETTER
This means that you need a second network card installed on your server and
a dedicated Ethernet network connected to that network card.
s 7ORKSTATIONSTHATCANBOOTFROMTHENETWORKCARD08%BOOT!LLMODERNNETWORK
CARDSSUPPORT08%BOOTSOTHATSHOULDNTBEAPROBLEM*USTMAKESURETHATYOU
enable network boot in the BIOS of your workstation.
I’ll assume that you have both elements. If not, save yourself a great deal of hassle
and make sure that these are in place before you start.
Setting Up Diskless Remote Boot in Linux
To use Clonezilla in a server environment, you need to set up diskless remote boot first.
4HESOLUTIONFORTHATIS$ISKLESS2EMOTE"OOTIN,INUX$2",YOUCANDOWNLOADIT
from
dppl6++`n^h*okqn_abknca*jap+kja0]hh
. Before setting up DRBL, you must set up the
NETWORKINTERFACECARD!SSUMINGTHATYOUVEJUSTINSTALLEDONYOUR5BUNTUSERVER
a second network card for use with DRBL and the network card hasn’t been set up yet,
follow this procedure to set up the second network card:
1. Using root permissions, open the file
+ap_+japskng+ejpanb]_ao
.
2. To add a second network card that is meant to be used for Clonezilla only, add the
FOLLOWINGINFORMATIONTOTHEFILE/FCOURSEYOUAREFREETOUSEANY)0INFORMATION
that you want to use.
]qpkapd-
eb]_aapd-ejapop]pe_
]``naoo-,*,*,*-,
japi]og.11*.11*.11*,
japskng-,*,*,*,
^nk]`_]op-,*,*,*.11
3. Restart the network to activate the new configuration. Don’t forget to make sure
THATYOURNEWNETWORKCARDYOUSHOULDSEEITAS
apd-
REALLYISAVAILABLE
CHAPTER 2
N
USING UBUNTU SERVER FOR SYSTEM IMAGING
31
Installing the DRBL Software
Now that the network is prepared, you can install the DRBL software. It is a good idea to
use Ubuntu’s secure
]lp
TODOTHISSOYOUFIRSTNEEDTODOWNLOADTHE$2",'0'KEYAND
install it. Use the following two commands to do that:
scapdppl6++`n^h*j_d_*knc*ps+CLC)GAU)@N>H
]lp)gau]``CLC)GAU)@N>H
Next, you need to change the
+ap_+]lp+okqn_ao*heop
file to add the new installation
sources that allow you to add the DRBL software and keep it up to date. Make sure to add
the following two lines to the
okqn_ao*heop
file:
`a^dppl6++bnaa*j_d_*knc*ps+q^qjpqd]n`ui]ejnaopne_pa`qjeranoaiqhperanoa
`a^dppl6++bnaa*j_d_*knc*ps+`n^h)_kna`n^hop]^ha
Next, execute the following commands to install the software:
]lp)capql`]pa
]lp)capejop]hh`n^h
$EPENDINGONTHESPEEDOFYOUR)NTERNETCONNECTIONTHISMAYTAKEAWHILE!FTER
this command has finished execution, all required software is downloaded but nothing is
installed yet.
When you run the
]lp)capejop]hh`n^h
command, the installation program asks the
following questions, the recommend answers to which are provided:
1. Do you want to install some network boot images for different Linux distributions?
Doing so would download more than 100 MB from the Internet to allow you to
perform an easy installation of workstations. Normally, you don’t need to do this,
so press Enter to accept the default value No and proceed.
2. Do you want serial console output for typical clients? Unless you know you do
need it, choose the default option, which is No.
CHAPTER 2
N
USING UBUNTU SERVER FOR SYSTEM IMAGING
32
3. What kind of kernel do you want to use on the clients to do imaging? Typically,
YOUWOULDCHOOSEOPTIONWHICHOFFERSIANDBETTER/PTIONISFOROLD
PRE0ENTIUMCLIENTSONLYANDOPTIONISONLYFORIFYOUR#05ISTHESAMEONTHE
DRBL server and clients. This would typically not be the case, so choose 1 here
and proceed.
4. $OYOUWANTTOUPGRADEYOUROPERATINGSYSTEM!SSUMINGYOUDONTNEEDTODO
THATATTHISPOINTPRESS%NTERTOACCEPTTHEDEFAULTVALUEOF.O'OHAVEACUP
of coffee now, because several megabytes of files need to be downloaded at this
stage.
Configuring the DRBL Software
!FTERthe download is finished, you can start the configuration. I’ll assume that your DRBL
SERVERHASTWONETWORKINTERFACESSEE&IGURE
apd,
, which is used for normal Internet
and user traffic, and
apd-
, which is used for DRBL.
apd-
ISCONFIGUREDWITHTHE)0ADDRESS
INTHISEXAMPLEOFCOURSEYOUAREFREETOUSEANYOTHERADDRESSRANGEYOULIKE
$OMAKESUREHOWEVERTHATYOUAREUSINGABITSUBNETMASKBECAUSEOTHERWISETHE
broadcast/multicast performance will be very bad.
Figure 2-1. Schematic overview of the imaging network
Now to configure DRBL, use the
+klp+`n^h+o^ej+`n^hlqod)e
command. This will set
up your server. Setting up your server this way is easy, because the program will detect
almost all settings automatically.
CHAPTER 2
N
USING UBUNTU SERVER FOR SYSTEM IMAGING
33
The first couple of questions ask you about the DNS configuration you want to use.
0AYATTENTIONWHENYOUREASKEDWHICHNETWORKCARDISUSEDFORYOUR)NTERNETCONNEC-
TIONSPECIFYTHECORRECTCARDHEREORELSEYOULLHAVE$2",TRAFFICONTHATCARD!FTERYOU
select the Internet interface, the DRBL interface is selected automatically.
.EXTYOUCANPOPULATETHEDATABASEOFYOUR$2",SERVERWITHTHE-!#ADDRESSESOF
THECLIENTS(OWDOESTHISWORK0RESS9TOTELL$2",THATITSHOULDSTARTCOLLECTING-!#
addresses now.
&INALLYSTARTUPALLTHECLIENTCOMPUTERSONEBYONEANDMAKESURETHEYBOOTFROM
THEIRNETWORKCARD!SINDICATEDINTHEMENUPRESSTOFINDOUTIFALLTHECLIENTSHAVE
BEENFOUND/NCEYOUARECONFIDENTTHATALLCLIENTSHAVEBEENDETECTEDPRESSTOFINISH
COLLECTING-!#ADDRESSESOFCONNECTEDCLIENTSANDQUIT4HEADVANTAGEOFDOINGTHIS
ISTHATYOUCANBINDPARTICULARCONFIGURATIONSTOPARTICULARWORKSTATIONS9OUARENOT
REQUIREDTODOTHISTHOUGH7ITHOUTTHEFIXED-!#ADDRESSTO)0ADDRESSCONNECTION
$2",ALSOWORKSWELL!NDAFTERALLYOUHAVEMOREFLEXIBILITYIFYOUDONTHAVETOCREATE
FIXED)0ADDRESSTO-!#ADDRESSMAPPINGSfirst.
N
Note
You also can use DRBL to boot workstations with a Ubuntu image. The software even allows you
to store private configuration environments on the server for each of these workstations. If you want to go
this way, it is a very good idea to make a mapping between IP addresses and MAC addresses of the work-
stations. If you just want to do imaging, there is no reason to create this mapping.
Setting Up the DHCP Server
In the NEXTSTEPSEE,ISTINGTHE$2",PROGRAMASKSYOUWHETHERYOUWANTTHE
$(#0SERVERWHICHISCONFIGUREDAUTOMATICALLYTOHANDOUTTHESAME)0ADDRESSTO
clients at all times. This is useful if you want the same client to work with the same con-
FIGURATIONATALLTIMES)FTHISISTHECASEPRESS9OTHERWISEPRESS%NTERTOCONTINUE)N
CASEYOUDOWANTTHECLIENTSTOWORKWITHTHESAME)0ADDRESSESATALLTIMESTHEIR-!#
addresses must be stored in a configuration file. The DRBL setup program creates this file
AUTOMATICALLYFORYOU*USTPRESS%NTERTOaccept the default name for this file.
CHAPTER 2
N
USING UBUNTU SERVER FOR SYSTEM IMAGING
34
Listing 2-1. The DRBL Program Sets Up a DHCP Server Automatically
@kukqs]jppkhappda@D?Loanre_aej@N>Hoanrankbbano]iaEL]``naoopkpda
_heajparanupeiasdaj_heajp^kkpo$Ebukqs]jppdeobqj_pekj(ukqd]rapk
_khha_ppdaI=?]``naooaokb_heajpo(]j`o]rapdaiejbeha$o%$]oejpda
lnarekqolnk_a`qna%%*Pdeoeobknpda_heajpo_kjja_pa`pk@N>Hoanran#o
apdanjapjapskngejpanb]_aapd-;
Wu+JY
.EXTYOUMUSTSPECIFYTHE)0ADDRESSTHATTHE$(#0SERVERWILLHANDOUTFORTHE
FIRSTCLIENT9OUDOTHISBYSPECIFYINGTHELASTBYTEONLYSEE,ISTING3OFOREXAMPLE
IFYOUAREONTHENETWORKANDYOUWANTTHEFIRSTCLIENTTOHAVETHE)0ADDRESS
JUSTENTERHERE!$(#0RANGEWILLTHENBECONFIGUREDAUTOMATICALLY
0RESS9TOACCEPTTHISRANGE9OUWILLSEEANOVERVIEWOFTHENETWORKCONFIGURATIONOF
your DRBL server. Happy with it? Then press Enter to continue.
Listing 2-2. Specify How the DHCP Range to Be Used Must Be Configured
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
@kukqs]jppkhappda@D?Loanre_aej@N>Hoanrankbbano]iaEL]``naoopkpda
_heajparanupeiasdaj_heajp^kkpo$Ebukqs]jppdeobqj_pekj(ukqd]rapk_khha_p
pdaI=?]``naooaokb_heajpo(]j`o]rapdaiejbeha$o%$]oejpdalnarekqo
lnk_a`qna%%*Pdeoeobknpda_heajpo_kjja_pa`pk@N>Hoanran#oapdanjapjapskng
ejpanb]_aapd-;
Wu+JYj
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
KGHapÑo_kjpejqa(sasehhoappdaEL]``naookb_heajpo^ubenop^kkpcapoEL
benopejopa]`kbbeta`kja
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Sd]peopdaejepe]hjqi^an`kukqs]jppkqoaejpdah]opoapkb`ecepoejpdaEL
$e*a*pdaejepe]hr]hqakb`ejpdaEL]``naoo]*^*_*`%bkn@N>H_heajpo_kjja_pa`
pkpdeoapdanjaplknpapd-*
W-Y
Once THE$(#0SERVERHASBEENFULLYCONFIGUREDTHECONFIGURATIONPROGRAMTELLS
YOUWHATTHE$2",NETWORKSHOULDCURRENTLYLOOKLIKESEE,ISTING#HECKTHATTHISIS
what you expected, and if it is, proceed with the configuration.