You are on page 1of 22

Cloning Linux Systems With CloneZilla Server Edition (CloneZilla SE)

Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Last edited 01/1 /!00" This tutorial sho#s ho# $ou can clone Linu% s$stems #ith &lone'illa (). This is useful for co*$in+ one Linu% installation to multi*le com*uters #ithout losin+ much time, e.+. in a classroom, or also for creatin+ an ima+e-.ased .acku* of a s$stem. / #ill install &lone'illa () on a 0e.ian )tch ser1er in this tutorial. The s$stems that $ou #ant to clone can use #hate1er Linu% distri.ution $ou *refer. / do not issue an$ +uarantee that this #ill #ork for $ou2

1 Preliminary Note
The 0e.ian ser1er on #hich / #ant to install &lone'illa () is in the local net#ork 1"!.134.0.0 5netmask !66.!66.!66.07 and has the /8 address 1"!.134.0.100. To clone a s$stem, the tar+et s$stems should use the same or at least similar hard#are, other#ise clonin+ mi+ht not #ork2

2 Installing CloneZilla SE
First #e im*ort the 989 ke$ of the 0:;L 50iskless :emote ;oot in Linu%, needed to .oot the client s$stems from the net#ork 58<)7 later on7 and &lone'illa re*ositor$: #+et -= htt*://dr.l.sourcefor+e.net/989->)?-0:;L -@- A a*t-ke$ add Then #e o*en /etc/a*t/sources.list... 1i /etc/a*t/sources.list ... and add the 0:;L/&lone'illa 0e.ian re*ositor$ to it:
[...] deb http://drbl.sourceforge.net/drbl-core drbl stable [...]

:un a*t-+et u*date after#ards. Bo# #e can install 0:;L and &lone'illa like this: a*t-+et install dr.l Then #e run /o*t/dr.l/s.in/dr.l im* to confi+ure 0:;L and &lone'illa #ith default 1alues 5should #ork in most en1ironments7: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.

This scri*t is for those im*atient, it #ill setu* the 0:;L ser1er .$ the default 1alue #hich mi+ht not fit $our en1ironment. Are $ou im*atient D [?/n] <-- )BT): CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. @k, LaEiness is a 1irtue2 Let us setu* 0:;L ser1er #ith the default 1alues222 8ress F)nterF to continue... <-- )BT): [...] (tartin+ the BAT ser1ices for 0:;L clients... done2 i*Gfor#ard is alread$ on. The 90H or >0H confi+ file is B@T found2 (ki* settin+ the 0H2 Ha$.e $ou #ill not .e a.le to make this 0:;L ser1er as thin client ser1er2 &lean all the *re1ious sa1ed confi+ file if the$ e%ist...done2 Turn on the .oot *rom*t for 8<) client...done2 Turn off the thin client o*tion in 8<) .oot menu...done2 Hodif$in+ /tft*.oot/n.iGim+/*%elinu%.cf+/default to let 0:;L client use +ra*hical 8<) .oot menu... done2 Full 0:;L mode. :emo1e clientdir o*t for la.el dr.l in *%elinu% confi+... (ettin+ dr.lGmodeIFfullGdr.lGmodeF in /etc/dr.l/dr.lGde*lo$.conf and /etc/dr.l/dr.l*ush.conf... done2 Full cloneEilla mode. :emo1e clientdir o*t for la.el cloneEilla in *%elinu% confi+... (ettin+ cloneEillaGmodeIFfullGcloneEillaGmodeF in /etc/dr.l/dr.lGde*lo$.conf and /etc/dr.l/dr.l*ush.conf... done2 ?ou ha1e to use F/o*t/dr.l/s.in/dcsF -> cloneEilla-start to start cloneEilla seri1ce, so that there #ill .e a cloneEilla menu #hen client .oots CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. Addin+ normal users to +rou* Faudio cdrom *lu+de1 flo**$ 1ideoF........ done2 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. J*datin+ the ?8/B/( for +rou*... Bote2 /f $ou add ne# or remo1e accounts in the 0:;L ser1er in the future, remem.er to run the follo#in+ command a+ain, so that some +rou* 5)<:*lu+de17 #ill .e u*dated: tune-de.ian-de1-+rou*-*erm -+ Faudio cdrom *lu+de1 flo**$ 1ideoF -e CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. )nKo$ 0:;L222 htt*://dr.l.nchc.or+.t#L htt*://dr.l.name B&M& Free (oft#are La.s, Tai#an. htt*://free.nchc.or+.t# CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. /f $ou like, $ou can re.oot the 0:;L ser1er no# to make sure e1er$thin+ is read$...5This is not necessar$, Kust an o*tion.7. CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC. 0:;L ser1er is read$2 Bo# set the client machines to .oot from 8<) or )ther.oot 5refer to htt*://dr.l.sourcefor+e.net for more details7. B@T)2 /f )ther.oot is used in client machine, 1ersion 6. .0 or ne#er is re=uired2 8(. The confi+ file is sa1ed as /etc/dr.l/dr.l*ush.conf. Therefore if $ou #ant to run dr.l*ush #ith the same confi+ a+ain, $ou ma$ run it as: /o*t/dr.l/s.in/dr.l*ush -c /etc/dr.l/dr.l*ush.conf ser1er1:NO ThatPs it for the installation.

Creating !n Image "# ! Linux System


To create an ima+e, #e first start &lone'illa on the 0e.ian s$stem and tell it to store an ima+e 5the ser1er #ill then #ait until a client connects to store the ima+e7, and then #e .oot the client s$stem of #hich #e #ant to create the ima+e from the net#ork - it should then .oot into a &lone'illa Linu% s$stem that connects to the ser1er and creates the ima+e. :un /o*t/dr.l/s.in/dcs on the 0e.ian ser1er and select All (elect all clients:

Be%t *ick cloneEilla-start (tartGcloneEillaGmode:

&hoose sa1e-disk (a1e client disk as an ima+e:

(elect LaterGinGclient Later in*ut ima+e and de1ice name in client 5$ou #ill then .e *rom*ted for an ima+e name later on the client, instead of ha1in+ to *ro1ide an ima+e name no#7:

@n the ne%t t#o screens $ou can sim*l$ *ress )BT): to select the default 1alues:

(elect the action #hen the client finishes clonin+ 5/ #ant to shut do#n the client after the ima+e has .een created, so / select -* *o#eroff7:

8ress )BT): a+ain on the ne%t t#o screens to acce*t the default 1alues:

8ress )BT): a+ain:

The ser1er is no# read$. Bo# start the client s$stem that $ou #ant to clone. /t is im*ortant that $ou .oot it from the net#ork 51ia 8<)7 - $ou mi+ht ha1e to adKust the .oot order in the clientPs ;/@( so that it .oots 1ia 8<):

After $ouP1e confi+ured the client to .oot from the net#ork, $ou should see a 0:;L .oot menu. (elect &loneEilla: sa1e disk 5choose later7 as ima+e 5choose later7:

Be%t *ro1ide a name for the ima+e 5or acce*t the default 1alue7:

(elect the source hard dri1e:

After#ards, the ima+e is .ein+ created and transferred to the &lone'illa ser1er:

Then the &lone'illa ser1er is notified that the ima+e creation *rocess has finished...

... and the client s$stem is shut do#n 5or re.ooted - that de*ends on the action $ouP1e chosen on the ser1er7:

ThatPs it, #e no# ha1e an ima+e of our Linu% s$stem that #e can clone to other s$stems.

$ Cloning%&estoring 'he Image


To clone or restore the ima+e to other s$stems, run /o*t/dr.l/s.in/dcs a+ain on the &lone'illa (er1er. (elect All (elect all clients:

&hoose cloneEilla-start (tartGcloneEillaGmode:

(elect restore-disk :estore an ima+e to client disk:

?ou can acce*t the default 1alues on the ne%t four screens .$ *ressin+ )BT)::

8ick the ima+e that $ou #ant to restore:

&hoose the tar+et hard dri1e:

(elect multicast multicast restore:

&hoose clientsQtime-to-#ait:

Fill in the num.er of s$stems on #hich $ou #ant to restore the ima+e 5/ #ant to restore Kust one s$stem in this e%am*le7:

Fill in the ma%. time 5in seconds7 that the ser1er #ill #ait until all clients are *o#ered on 5i.e., if $ou #ant to restore the ima+e on ten clients, $ou ha1e R00 seconds to *o#er on the other nine com*uters after $ou ha1e *o#ered on the first one - if $ou are too slo#, &lone'illa #ill start to restore the ima+e onl$ on the s$stems that ha1e .een *o#ered on in time7:

After#ards, *ress )BT): t#ice:

Bo# *o#er on the clients. Hake sure the$ are confi+ured to .oot from the net#ork 51ia 8<)7:

/n the .oot menu, select &loneEilla: multicast restore:

The clonin+ *rocess #ill then .e+in:

After#ards, the ser1er #ill .e notified that the *rocess has finished...

... and the client s$stem #ill re.oot:

;efore the client s$stem .oots, enter its ;/@( a+ain and confi+ure it to .oot from the hard dri1e2 /f all +oes #ell, the com*uter should .oot into the cloned o*eratin+ s$stem.

( 'rou)leshooting
/t is *ossi.le that $ou see this messa+e durin+ the restore: Failed to install +ru. and that the s$stem #ill not .oot after#ards: 9ru. error ! 5/P1e had this #ith J.untu s$stems.7 The solution is to .oot into a rescue s$stem 5e.+. >no**i% or the J.untu Li1e-&07 and install

9:J; from the rescue s$stem. @nce >no**i% or the J.untu Li1e s$stem has started, o*en a terminal and .ecome root: >no**i%: su J.untu: sudo su :un fdisk -l to learn more a.out $our *artitionin+: rootS>no**i%:NO fdisk -l 0isk /de1/sda: R!.! 9;, R!!1!!6 T!0 .$tes !66 heads, 3R sectors/track, R"13 c$linders Jnits I c$linders of 13036 C 61! I 4!!6!40 .$tes 0e1ice ;oot /de1/sda1 C /de1/sda! RT60 /de1/sda6 RT60 rootS>no**i%:NO (tart 1 R"13 R"13 )nd RT " 1R 1 !TQ 1R 1R"3 ;locks R011R411 6 4! /d ($stem 4R Linu% )%tended Linu% s#a*/(olaris

/n this e%am*le, / ha1e one .i+ *artition 5/de1/sda17 that also contains the /.oot director$ 5the ;oot column is marked #ith a star7. / #ill no# mount that *artition to the /mnt director$: mount /de1/sda1 /mnt mount -o .ind /de1 /mnt/de1 mount -o .ind -t *roc /*roc /mnt/*roc 5/f $ou ha1e a se*arate /.oot *artition, e.+. /de1/sda!, $ouPd mount it to /mnt/.oot after $ou ha1e mounted /de1/sda1 to /mnt.7 Bo# #e install 9:J; as follo#s: chroot /mnt +ru.-install --no-flo**$ F5hd07F This #ill +i1e $ou the follo#in+ error: rootS>no**i%:NO chroot /mnt +ru.-install --no-flo**$ F5hd07F ?ou shouldnPt call /s.in/+ru.-install. 8lease call /usr/s.in/+ru.-install instead2 /de1/sda1 does not ha1e an$ corres*ondin+ ;/@( dri1e. rootS>no**i%:NO To o1ercome the error, run chroot /mnt +ru.-install --no-flo**$ F5hd07F --root-director$I/ --recheck rootS>no**i%:NO chroot /mnt +ru.-install --no-flo**$ F5hd07F --root-director$I/ --recheck ?ou shouldnPt call /s.in/+ru.-install. 8lease call /usr/s.in/+ru.-install instead2 8ro.in+ de1ices to +uess ;/@( dri1es. This ma$ take a lon+ time. /nstallin+ 9:J; to 5hd07 as 5hd07... /nstallation finished. Bo error re*orted. This is the contents of the de1ice ma* //.oot/+ru./de1ice.ma*.

&heck if this is correct or not. /f an$ of the lines is incorrect, fi% it and re-run the scri*t U+ru.-installP. 5hd07 /de1/sda rootS>no**i%:NO ThatPs it - no# re.oot... re.oot ... and donPt for+et to remo1e the >no**i% or J.untu &0 from the &0 dri1e. /f e1er$thin+ +oes #ell, the 9:J; error should .e +one, and the s$stem should .oot #ithout an$ *ro.lems.

* Lin+s
&lone'illa (): htt*://cloneEilla.or+/cloneEilla-ser1er-edition/ 0e.ian: htt*://###.de.ian.or+/