Using Ubuntu Server for System Imaging

15 344 0
Using Ubuntu Server for System Imaging

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

CHAPTE R 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 installation 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 solution It has two versions, a stand-alone version and a server version Whereas the standalone 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: 29 30 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G 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%BOOT SOTHATSHOULDNTBEAPROBLEM*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: Using root permissions, open the file +ap_+japskng+ejpanb]_ao To add a second network card that is meant to be used for Clonezilla only, add the FOLLOWINGINFORMATIONTOTHEFILE/FCOURSE YOUAREFREETOUSEANY)0INFORMATION that you want to use ]qpkapdeb]_aapd-ejapop]pe_ ]``naoo-,*,*,*-, japi]og.11*.11*.11*, japskng-,*,*,*, ^nk]`_]op-,*,*,*.11 Restart the network to activate the new configuration Don’t forget to make sure THATYOURNEWNETWORKCARDYOUSHOULDSEEITASapd- REALLYISAVAILABLE C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G 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 ]lpTODOTHIS SOYOUFIRSTNEEDTODOWNLOADTHE$2",'0'KEYAND install it Use the following two commands to 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)NTERNETCONNECTION THISMAYTAKEAWHILE!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: 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 this, so press Enter to accept the default value No and proceed Do you want serial console output for typical clients? Unless you know you need it, choose the default option, which is No 31 32 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G What kind of kernel you want to use on the clients to imaging? Typically, YOUWOULDCHOOSEOPTION WHICHOFFERSIANDBETTER/PTIONISFOROLD PRE 0ENTIUMCLIENTSONLY ANDOPTIONISONLYFORIFYOUR#05ISTHESAMEONTHE DRBL server and clients This would typically not be the case, so choose here and proceed $OYOUWANTTOUPGRADEYOUROPERATINGSYSTEM!SSUMINGYOUDONTNEEDTODO THATATTHISPOINT PRESS%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 INTHISEXAMPLEOFCOURSE YOUAREFREETOUSEANYOTHERADDRESSRANGEYOULIKE $OMAKESURE HOWEVER THATYOUAREUSINGA BITSUBNETMASK BECAUSEOTHERWISETHE 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 C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G The first couple of questions ask you about the DNS configuration you want to use 0AYATTENTIONWHENYOUREASKEDWHICHNETWORKCARDISUSEDFORYOUR)NTERNETCONNECTIONSPECIFYTHECORRECTCARDHERE ORELSEYOULLHAVE$2",TRAFFICONTHATCARD!FTERYOU select the Internet interface, the DRBL interface is selected automatically .EXT YOUCANPOPULATETHEDATABASEOFYOUR$2",SERVERWITHTHE-!#ADDRESSESOF THECLIENTS(OWDOESTHISWORK0RESS9TOTELL$2",THATITSHOULDSTARTCOLLECTING-!# addresses now &INALLY STARTUPALLTHECLIENTCOMPUTERSONEBYONEANDMAKESURETHEYBOOTFROM THEIRNETWORKCARD!SINDICATEDINTHEMENU PRESSTOFINDOUTIFALLTHECLIENTSHAVE BEENFOUND/NCEYOUARECONFIDENTTHATALLCLIENTSHAVEBEENDETECTED PRESSTOFINISH COLLECTING-!#ADDRESSESOFCONNECTEDCLIENTSANDQUIT4HEADVANTAGEOFDOINGTHIS ISTHATYOUCANBINDPARTICULARCONFIGURATIONSTOPARTICULARWORKSTATIONS9OUARENOT REQUIREDTODOTHIS THOUGH7ITHOUTTHEFIXED-!#ADDRESSTO)0ADDRESSCONNECTION $2",ALSOWORKSWELL!NDAFTERALL YOUHAVEMOREFLEXIBILITYIFYOUDONTHAVETOCREATE FIXED)0ADDRESSTO-!#ADDRESSMAPPINGSfirst NNote 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 workstations If you just want to imaging, there is no reason to create this mapping Setting Up the DHCP Server In the NEXTSTEPSEE,ISTING  THE$2",PROGRAMASKSYOUWHETHERYOUWANTTHE $(#0SERVER WHICHISCONFIGUREDAUTOMATICALLY TOHANDOUTTHESAME)0ADDRESSTO clients at all times This is useful if you want the same client to work with the same conFIGURATIONATALLTIMES)FTHISISTHECASE PRESS9OTHERWISE PRESS%NTERTOCONTINUE)N CASEYOUDOWANTTHECLIENTSTOWORKWITHTHESAME)0ADDRESSESATALLTIMES THEIR-!# addresses must be stored in a configuration file The DRBL setup program creates this file AUTOMATICALLYFORYOU*USTPRESS%NTERTOaccept the default name for this file 33 34 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G 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 EXT YOUMUSTSPECIFYTHE)0ADDRESSTHATTHE$(#0SERVERWILLHANDOUTFORTHE FIRSTCLIENT9OUDOTHISBYSPECIFYINGTHELASTBYTEONLYSEE,ISTING  3O FOREXAMPLE 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$(#0SERVERHASBEENFULLYCONFIGURED THECONFIGURATIONPROGRAMTELLS YOUWHATTHE$2",NETWORKSHOULDCURRENTLYLOOKLIKESEE,ISTING  #HECKTHATTHISIS what you expected, and if it is, proceed with the configuration C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G Listing 2-3 The DRBL Setup Program Shows What It Is Going to Configure PdaH]ukqpbknukqn@N>Hajrenkjiajp6 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& JE?JE?EL?heajpo ')))))))))))))))))))))))))))))' x@N>HOANRANx xx x'))Wapd,Y-5.*-24*-*2,')pkS=J xx x'))Wapd-Y-,*,*,* -')pk_heajpocnkql-W-._heajpo(pdaenEL xxbnki-,*,*,*1,)-,*,*,*2-Y ')))))))))))))))))))))))))))))' &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Pkp]h_heajpo6- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LnaooAjpanpk_kjpejqa*** Next you need to specify which DRBL mode you want to use There are two differENTSCENARIOSHERE&IRST YOUCANUSE$2",TOPROVIDEEACHCLIENTWITHABOOTIMAGETHAT you’ll use to give them a useable operating system Do this at all times, because it gives you a complete working environment available on the client, and that may be useful if YOUNEEDTOSETADDITIONALPARAMETERSFROMTHECLIENTS08% DELIVEREDOPERATINGSYSTEM During the next step, specify that you want to use full Clonezilla mode This provides everything a client needs to boot and its work in the Clonezilla environment, which enables you to easy workstation imaging Completing Clonezilla Configuration Now YOUAREGETTINGTOTHENEXTSTEPOFTHECONFIGURATION9OUNEEDTOASSIGNADIRECTORY that can be used by Clonezilla I suggest using a rather large storage device, formatTINGITWITH8&3 ANDMOUNTINGITONADIRECTORY+_hkjavehh] might be suitable Do not USE2EISER&3FORTHISFILESYSTEM BECAUSEITISNTVERYSTABLE!LSOMAKESURETHATYOUR +ap_+bop]^ file is modified to activate this directory the next time your server boots To configure this, follow these steps: 35 36 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G !SSUMINGTHATYOUHAVEADEDICATEDHARDDISKWITHANEXISTINGPARTITIONONIT which is reachable via the device +`ar+o`^-, use igbo*tbo+`ar+o`^- to format the DEVICEWITHTHE8&3FILESYSTEM Use ig`en+_hkjavehh] to create the Clonezilla directory Make sure your +ap_+bop]^ includes the following line to mount the Clonezilla directory automatically: +`ar+o`^-+_hkjavehh]tbo`ab]qho,, !FTERyou specify which file system to use, the configuration program asks you if you want to set a password as well If you use a password, only authenticated clients can use Clonezilla services Do what fits your situation best here Now the installer asks if you want to define a boot prompt for clients It may be a good idea to so, so that your clients have the option to specify what they want to WHENBOOTINGWITHANIMAGETHEYVEOBTAINEDFROMTHE$2",SERVER!DEFAULTTIMEOUT of seconds is generated for this boot prompt If this is not enough time, change it in the NEXTSTEP&OLLOWINGTHAT JUSTPRESS%NTERTOSPECIFYTHATYOUDONTWANTTOSEEAGRAPHICAL boot menu on the client computers .EXTTHECONFIGURATIONPROGRAMASKSIFYOUWANTTOUSETHE$2",SERVERASA.!4 SERVER)FYOUJUSTWANTTOUSE#LONEZILLAFORCLONING SELECT.OHERE&ORTHENEXTTHREE QUESTIONS PRESS%NTERTOSELECTTHEDEFAULTOPTIONS4HISWILLSTARTTHE#LONEZILLA$(#0 SERVER ANDALLRELATEDSERVICES!TTHISSTAGE YOUCANUSE08%BOOTONTHECLIENTSTOBOOT them into the Clonezilla server Configuring the Clients for Cloning Now that you’ve set up a basic Clonezilla environment, you are going to use the `n^h)_heajp)osep_d command to add the appropriate Clonezilla options to the boot menu, thus enabling end users to specify what they want to on their client workSTATIONS9OUCANCONFIGURETHEENVIRONMENTINDIFFERENTWAYSˆFORFULLYAUTOMATICSETUP or in such a way that the administrator starts the cloning process manually after using 08%BOOTONTHECLIENT&IRSTYOULLLEARNHOWTOUSETHE`n^h)_heajp)osep_d command to set up the server, and then you’ll learn how to start cloning on the clients C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G Setting Up the Server for Cloning The following procedure, typically a one-time-only procedure, allows you to set up the Clonezilla server for cloning: /NTHESERVEREITHERBY33(ORDIRECTLY STARTthe +klp+`n^h+o^ej+`n^h)_heajp) osep_dCOMMANDTOACCESSTHESCREENSHOWNIN&IGURE  Figure 2-2 You can set up imaging for all nodes, or for a limited selection of nodes only Specify INWHATMODEYOURCLIENTWILLBESTARTINGAUTOMATICALLY!SSUMINGTHAT YOULLBEUSING08%BOOTONLYWHENYOUWANTTOCLONETHECLIENT SELECTTHEOPTION _hkjavehh])op]RT ASSHOWNIN&IGURE 4HISAUTOMATICALLYSTARTSTHECLONING engine 37 38 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G Figure 2-3 Make sure to select clonezilla-start to start the cloning process automatically after your workstation boots from its network card 9OUCANnow select an option to start a clone or restore process automatically SEE&IGURE  !FTERYOUCHOOSEONEOFTHESEAUTOMATICOPTIONS #LONEZILLAWILL use multicast mode, thus allowing you to clone at the highest possible speed The disadvantage of using an automatic option, where your selection is predefined, is that you’ll always need to run the `n^h)_heajp)osep_d command before every major job The alternative is to use the option oaha_p)ej)_heajp, which uses unicast but gives more flexibility from within the client Because it is more flexible, I’ll use this option Specify what to offer as the default client boot option Make sure to select the option )u-, which halts to show you the boot menu In the next and last screen, select )lna^kkp, which will reboot the client machine automatically after it has been cloned C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G Figure 2-4 For optimal performance, use one of the first four options; for optimal flexibility, use the select-in-client option Cloning the Client Now that everything is set up, you are ready to start cloning your client: Make sure the workstation that you want to boot boots from its network card 9OULLSEETHE$2",BOOTMENU WITHTHE#LONEZILLAOPTIONSELECTEDBYDEFAULTSEE &IGURE  -AKESUREYOURWORKSTATIONBOOTSTHISOPTION &ROMthe Clonezilla menu, you can choose from two different options, as shown IN&IGURE 5SEthe option `are_a)ei]ca to write an image file to the Clonezilla server The `are_a)`are_a option is useful only if you want to clone the contents of AHARDDRIVETOANEXTERNALSTORAGEDEVICE4HISDOESNTWRITEANIMAGEFILEITJUST CLONESYOURHARDDRIVETOTHESELECTEDSTORAGEDEVICE!NYSTORAGEDEVICECANBE used for this purpose, as long as it is at least as big as the hard drive you want to clone 39 40 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G Figure 2-5 When booting the workstation from the network card, the Clonezilla option automatically pops up Figure 2-6 Use the device-image option to write the cloned disk to an image file on the Clonezilla server Specify WHATACTIONYOUWANTTOTAKESEE&IGURE  4HEMOSTIMPORTANTOPTIONS are o]ra`eog, which clones the entire disk to the image file, and naopkna`eog, which restores the client from an image file The other two options allow you to save and restore individual partitions only C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G Figure 2-7 Select savedisk to write the contents of the entire hard drive to an image file 3PECIFYWHATPRIORITYSHOULDBEUSED4HEDEFAULTPRIORITYFITSWELLITWILLTRYTHE jpbo_hkjaPROGRAM WHICHOBVIOUSLYISFOR.4&3FILESYSTEMSONLYIFYOURENOT USING.4&3 ITTRIESl]npei]ca ANDIFTHATALSODOESNTWORK ITWILLUSETHEVERY SLOW `` command to clone the disk Count on that to take a couple of hours, though, because `` is rather inefficient Make sure that the option is selected that forces the client to wait before cloning This option makes sure that nothing will happen by accident, and as you can imagine, that’s rather important In the following screen, you need to specify what command you want to use to compress the cloned image The default value, which uses cvel, will rather well HERE&OLLOWINGTHAT YOUNEEDTOGIVEANAMETOSAVETHEIMAGESEE&IGURE   This is very important, because when restoring the original state of your hard drive, this image name will be the only thing that you’ve got So, make sure that ALLYOURMACHINESHAVEAUNIQUENAME ANDUSETHATMACHINENAMEAPPENDED BYTHEDATEONWHICHYOUVECREATEDTHEIMAGEIFYOUDLIKE TOSTORETHEimage 41 42 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G Figure 2-8 Make sure to use something more descriptive than the default name for your image 3ELECTTHEHARDDISKS THATYOUWANTTOCLONESEE&IGURE  4YPICALLYONLYONE disk will be offered, but if the machine you’re cloning has more than one hard drive, you can clone all of them with Clonezilla Figure 2-9 Select all disks that you want to include in your image C HA P TER N U S I N G U B U N T U S E R V E R F O R S Y S T E M I M A G I N G That’s all The cloning process will start now Be patient, because it can take some time to complete Summary In this chapter you’ve learned how to use Ubuntu Server as a system imaging solution This is a very useful solution that allows you to recover from problems on workstations fast and easily In the next chapter you’ll learn all about performance monitoring on Ubuntu Server 43 ... ER VER FOR S YS TEM I M A G I N G s !FASTDEDICATEDNETWORK FOR IMAGING YOUDOABSOLUTELYWANT''IGABITORBETTER  This means that you need a second network card installed on your server. .. to imaging? Typically, YOUWOULDCHOOSEOPTION WHICHOFFERSIANDBETTER/PTIONIS FOR OLD PRE 0ENTIUMCLIENTSONLY ANDOPTIONISONLY FOR IFYOUR#05ISTHESAMEONTHE DRBL server. .. AUTOMATICALLY FOR YOU*USTPRESS%NTERTOaccept the default name for this file 33 34 C HAPTER N USI NG U B U NTU S ER VER FOR S YS TEM I M A G I N G Listing 2-1 The DRBL Program Sets Up a DHCP Server

Ngày đăng: 19/10/2013, 02:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan