Thursday, January 20, 2011

CloneZilla on Ubuntu 10.10

Install Ubuntu Base
Install Ubuntu Server AMD64 as a virtual machine in VMware ESXi. Take default options and when get to the software selection screen only choose 'OpenSSH Server'

References following are some of the sites I pulled ideas and info from. None of these sites had all the information I needed in one step by step formula plus I setup in virtual environment with 2 network cards.

Network Configuration
When completed type [sudo ifconfig] and discover IP address. The default of getting IP address from DHCP server is acceptable. Write down MAC address and IP address of eth0. I wanted to assign a specif IP address from my router, so I made the entry there then ran the following commands to renew IP address
  • [sudo dhclient -r]
  • [sudo dhclient]
  • or I could have used [sudo /etc/init.d/networking restart
In VMware I had provisioned 2 Ethernet cards. Eth0 is setup to access my main office network using the default setup. Eth1 is setup to manage the DRBL environment as DHCP server. First, I add the following lines to the network setup configuration file.
  • [sudo nano /etc/network/interfaces] then add the following:
    • #eth1 used for DRBL / Clonezilla environment
    • auto eth1
    • iface eth1 inet static
    • address 172.30.40.1
    • network 172.30.40.0
    • netmask 255.255.255.0
    • broadcast 172.30.40.255
  • ctrl-O to save, ctrl-X to exit
  • [sudo /etc/init.d/networking restart] to restart networking
  • [sudo ifconfig eth1] to verify changes

DHCP Server
Now to setup the DHCP server on eth1
  • [sudo apt-get install dhcp3-server] installs DHCP server
  • [sudo nano /etc/default/dhcp3-server] edits the server config file
  • change interface line to read 'INTERFACES="eth1"'
  • save and exit
Now configure DHCP server to dole out addresses from an address pool for any computer connecting to it.
  • [sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.bak] creates backup of configuration files just in case
  • [sudo nano /etc/dhcp3/dhcpd.conf] opens configuration file for editing
  • uncomment the 'authoritative;' ine
  • add the following lines
  • option subnet-mask 255.255.255.0;
  • option broadcast-address 172.30.40.255;
  • option routers 172.30.40.1;
  • subnet 172.30.40.0 netmask 255.255.255.0 {
  • range 172.30.40.10 172.30.40.100;
  • }
  • save and exit
Well, now that I am reading ahead, I find out that Clonezilla automatically installs DHCP server.... oh well.. the above may not have been needed, let's see what happens.

Install DRBL
  • [sudo -i] allows me to stay as super user without retyping sudo each time
  • [nano /etc/apt/sources.list] edit the sources to add the clonezilla repository to it via addition of the following two lines to the file
  • # needed for clonezilla
  • deb http://drbl.sourceforge.net/drbl-core drbl stable
  • then save (ctrl-o) and exit (ctrl-x)
  • [wget http://drbl.sourceforge.net/GPG-KEY-DRBL] downloads the GPG key for the clonezilla source
  • [apt-key add GPG-KEY-DRBL] adds the key
  • [apt-get update] updates the available packages list
  • [apt-get install drbl] installs DRBL
  • [apt-get upgrade] updates all packages
Setup drbl
[/opt/drbl/sbin/drblsrv -i] starts the setup process, then answer the following questions
  • [n] network installation boot images? [n] since I intend to only suck up and spit out pre-configured machines
  • [n] serial console output on client computers?
  • [n] upgrade the OS? [n] since I just did that

Configure Clonezilla
[/opt/drbl/sbin/drblpush -i] starts the clonezilla configuration, then answer the folowing questions
  • defaults used for the first several questions
  • Clonezilla determined (or guessed) correctly that my Internet connection was through eth0
  • for the eth1 DRBL environment, I received a warning that my IP address was a class A or B private network. It wanted me to use the class C private network of 192.168.*.* and warned me that performance of multicasting clone "will be terribly worse!" with current configuration. ... interesting.... I'll leave it alone for now and see what happens or read up a bit more.
  • Collect MAC addresses of clients? No
  • Offer same IP address? No since this is related to last question
  • Initial number in the last digit set? 11
  • number of clients? 20
  • accept setup? y
  • Diskless Linux service? 2, since we are only using DRBL for cloning, not for providing diskless linux services to client computers
  • Clonezilla mode? 1 [box mode] since it uses less server resources and is adequate for cloning
  • default directory to store your images? /clonezilla --since this is easier to remember than /home/partimag
  • pxelinux password? no
  • boot prompt for clients? no
  • graphic background for PXE menu when boot? yes
  • DRBL server as NAT server? no, since clients do not need to access the Internet through the DRBL server... just using for cloning and not for live usage
  • ready to deploy? yes
  • I now get a message that "The config file is saved as /etc/drbl/drblpush.conf. Therefore if you want to run drblpush with the same config again, you may run it as: /opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf"
Starting Clonezilla
[sudo /opt/drbl/sbin/dcs] this starts clonezilla
  • 1st screen: select All
  • 2nd screen (switch the mode): select clonezilla-start
  • 3rd screen (mode): select Beginner mode as I am doing normal system cloning
  • 4th screen(clonezilla mode): select select-in-client which allows choosing of save or restore from client.
  • 5th screen: leave default
  • 6th screen: choose poweroff - shut down client when the clone finishes
Results
  • Working... able to PXE boot on computers connected to second NIC
  • Problems... cannot PXE boot computers which don't support x64
  • Resolution... reinstall 32 bit server to be backward compatible with the older computers I need to image
FOG Server
  • Decided to try FOG server as well, so install on Ubuntu server image 32 bit
  • Generally following these two guides but without the GUI:
  • http://community.spiceworks.com/how_to/show/373
  • http://www.fogproject.org/wiki/index.php?title=Ubuntu_10.04
  • I had a bit of a challenge setting up a seperate lan on eth1 as I did for Clonezilla, so abandoning for now.
  • I think I will even consider setting up FOG on the same network. There are a couple ways of having FOG coexist with your current DHCP server and network. The preferred method is to have your existing DHCP server forward PXE requests to the FOG server. An alternate method is to setup FOG as a DHCP proxy server which pickups on PXE requests.
  • I'll leave this for another project for now, but go back to the more familiar clonezilla with easy dual NIC setup. FOG does look otherwise polished and promising so definitely worth a revisit.

Clonezilla on 32 bit Ubuntu server

    • Again based on Ubuntu 10.10, but 32 bit version.
    • Follow similar steps for Installation as listed above
    • while setting up the DRBL server was also asked which archetecture to install, I chose i486 (instead of i386 or same as DRBL server options)
      • Add second ethernet settings
      • [sudo nano /etc/network/interfaces] then add the following:
        • #eth1 used for DRBL / Clonezilla environment
        • auto eth1
        • iface eth1 inet static
          • address 172.30.45.1
          • network 172.30.45.0
          • netmask 255.255.255.0
          • broadcast 172.30.45.255
        • ctrl-O to save, ctrl-X to exit
        • [sudo /etc/init.d/networking restart] to restart networking
        • [sudo ifconfig eth1] to verify changes
  • Needed to perform steps under network configuration (above)
  • But did not need to perform steps listed in DHCP server configuration (above), this was setup automatically during the DRBL and Clonezilla server setup
  • SUCCESS