Imaging Guide

(Difference between revisions)
Jump to: navigation, search
(Precautions!)
(Setup after configuring DRBL)
Line 128: Line 128:
 
When done, reboot the NFS server:
 
When done, reboot the NFS server:
 
<pre>sudo /etc/init.d/nfs-kernel-server restart</pre>
 
<pre>sudo /etc/init.d/nfs-kernel-server restart</pre>
 +
 +
====Cleanup the var folder====
  
 
===Get Image From Source Tablet ===
 
===Get Image From Source Tablet ===

Revision as of 04:18, 16 January 2011

Decprecated incarnations of tablet imaging walkthroughs are located at the Deprecated Imaging Guides.

Contents

CloneZilla Implementation

There is some patchy original documentation at the Clonezilla Guide and DRBL homepage.

Vocabulary

  • Server
    • machine that will NOT be imaged
    • runs Ubuntu 10.04 LTS <= server edition (or desktop edition)
    • running DRBL/Clonezilla/DHCP/NFS for clients on LAN
    • will pull hard drive image from host client
    • will push stored hard drive image to slave clients
    • hosts DHCP server for clients
    • can be connected to the internet, but also to a LAN with clients
  • Client
    • Machine whose hard drive will be imaged
    • On server LAN
    • Can PXE boot to server, but not connected to internet
  • Host Client
    • client with everything necessary installed on it
    • acts as a base for rest of (slave) clients
    • server pulls hard drive image from it
    • after server pulls hard drive image from it, it acts as a slave client
  • Slave Client/s
    • clients with old or outdated software or OS
    • receives image from server to write to hard drive

Precautions!

Only do this if you're not using some other DHCP server for managing the IP addresses.

  • Disable the Network Manager - Right click and uncheck "Enable Networking"
  • Stop the automatic DHCP task (We had troubles with the computer trying to assign itself a different IP address):
killall dhclient
  • Set the IP Address to a static address (replacing ethX with the appropriate LAN connection):
ifconfig ethX 192.168.0.1

Import the repo key to your keyring

wget http://drbl.sourceforge.net/GPG-KEY-DRBL -O - | sudo apt-key add -

Edit sources.list

Create a new file /etc/apt/sources.list.d/clonezilla.list and add the following entry:

(This also works if you add this line to /etc/apt/sources.list)

If you are using Karmic, then *ALSO* use the unstable repository. If you do not use this, then you will run into partclone errors later on.

We do this because some of the packages needed in the unstable branch are only available through the stable branch. We will be working to resolve this with upstream in the future.

Now you can install clonezilla and drbl:

sudo apt-get update && sudo apt-get install clonezilla drbl

Notes on Prerequisites

Previously it was necessary to install a DHCP Server and a TFTP Server, DRBL does this automatically.

Install DRBL, step 1

There are two commands you use to install and activate CloneZilla. The first is

sudo /opt/drbl/sbin/drblsrv -i

Note: There is a space before the "-i". The first time you run it, this will also connect to the Internet and download a bunch of packages. Decline installing packages for “Diskless Linux”, as we don't run any thin clients. Here are the individual steps:

  1. Yes, install the network installation boot images so the client computers can install Linux via a network connection.
  2. No, do not use the serial output unless you know what you're doing
  3. Use same arch. as server
  4. Update/upgrade server so server has up-to-date packages
  5. Use kernel from APT repository

Install DRBL, step 2

The second step creates the configuration for all the clients:

sudo /opt/drbl/sbin/drblpush -i

Make sure you have two network interfaces up when you run this command – it will detect one as “Internet” and one as “private”. If it doesn't detect two interfaces, the clients won't get a DHCP lease (for a centralized system like the new TICC server setup this is fine). Don't bother to configure your clients – letting the range in dhcp.conf control leases is fine. It warns you about this later, but we don't care. The default options are again mostly acceptable. We want “no diskless Linux” and “Clonezilla box mode”. Some options give information about “increased requirements on server for more clients”. These options are never what we want – we don't care about persistent client configuration. Here are the individual steps:

  1. Default domain name
  2. Default NIS/YP name
  3. Default hostname prefix
  4. Select internet-connected interface
    1. If you collect MAC addresses: PXE boot each tablet on the DRBL-side of the LAN
    2. If you collected MAC addresses, then have DHCP consistently give out the same IP addresses to each MAC address
  5. Use default file name for listing MAC addresses
  6. Starting last IP octet is 2 (eg: 192.168.0._2_) because my server is 192.168.0._1_
  7. May need to tell DRBL how many clients you will have so it can allocate IPs accordingly (we use 1 client, as we later setup to accept all clients)
  8. Accept IP address range if okay
  9. View network layout and accept if correct
  10. Decline diskless Linux service to clients (we don't need them booting into their own standalone desktops)
  11. Select "Clonezilla box mode" (don't use full mode)
  12. Directory for storing hard drive images on server (/images on our server)
  13. No password for PXE boot
  14. Yes, set boot prompt for clients
  15. Set timeout value in tenths of a second (eg: 70 == 7 seconds)
  16. Use graphic background
  17. Turn off DRBL acting as a NAT server (clients have no need for internet access)
  18. Remove old settings of existing DRBL clients if they exist
  19. If DRBL talks about NFS over TCP, then hit enter
  20. Yes, overwrite firewall rules

Setup after configuring DRBL

Setup booting for DHCP clients from other servers

To allow DHCP clients from other servers to use this Clonezilla server you'll need to modify "/usr/lib/mkpxeinitrd-net/initrd-skel/etc/linuxrc.conf":

Change
check_server_name="yes"
to
"check_server_name="no"

Also add the lines (where IP_OF_SERVER is the server IP and NAME_OF_SERVER is the name of the server):

siaddr="IP_OF_SERVER"
sname="NAME_OF_SERVER"

You must also edit "/tftpboot/node_root/sbin/init" by changing "-f1-3" to "-f1-2". This task must be re-done every time you re-run the step "Install DRBL, step 2".

Setup NFS for All Clients

DRBL will configure NFS for every individual tablet in /etc/exports. However, if you don't care about giving clients the same IP address every time they connect, this configuration file simply gets unwieldy. To make the configuration more manageable, you only need to have a single section for all IP addresses, and then change the IP address for that section to "*" (without the quotes). So, your /etc/exports file should like similar to the following:

/tftpboot/node_root *(ro,sync,async,no_root_squash,subtree_check)
/usr *(ro,sync,async,no_root_squash,subtree_check)
/opt *(ro,sync,async,no_root_squash,subtree_check)
/home *(rw,sync,async,no_root_squash,no_subtree_check)
/var/spool/mail *(rw,sync,async,root_squash,no_subtree_check)
/images *(rw,sync,async,no_root_squash,no_subtree_check)

Now reboot the NFS server:

sudo /etc/init.d/nfs-kernel-server restart

NFS Configuration Fix

CloneZilla will run into extreme difficulty if you boot too many systems at once unless you change the configuration settings for NFS. These settings are stored in the file /etc/default/nfs-kernel-server, the important ones to change are the number of simultaneous NFS processes to use:

# Number of servers to start up
RPCNFSDCOUNT=64

and the number of simultaneous RPC mounts:

RPCMOUNTDOPTS="--num-threads=50"

When done, reboot the NFS server:

sudo /etc/init.d/nfs-kernel-server restart

Cleanup the var folder

Get Image From Source Tablet

All the imaging parameters are accessed by running the command:

sudo /opt/drbl/sbin/dcs

You can either use the Beginner mode (to use defaults) or the Expert mode if you know what you are doing.

  • Beginner mode
  1. Select all clients
  2. Clonezilla start
  3. Beginner mode
  4. Save-disk mode
  5. Choose to set name now (or later, it's your choice)
  6. Append short description of image onto end of default image name (date and time)
  7. Select which drive on client to save as image on server
  8. Have client do nothing ("-p true" option) when clone finishes (in case of error)
  9. Split image file at 1000000 MB (DO NOT USE 0!!!) increments so it doesn't split image file up
  10. Wait for DRBL to finish working
  11. PXE boot host client (or use pre-loaded USB image, coming soon!)
  12. Select Clonezilla: save disk sda as image (image name)
  • Expert Mode
  1. Select all clients
  2. Clonezilla start
  3. Expert mode
  4. Save-disk mode
  5. Choose to set name now (or later, it's your choice)
  6. Append short description of image onto end of default image name (date and time)
  7. Select which drive on client to save as image on server
    1. Set cloning priority to -q2 (partclone > partimage > dd) if not running Windows and max efficiency
    2. Set cloning priority to -q1 (dd only) if copying exotic filesystems (eg: unreadable by Linux or open source tools - check to see what GParted can read if unsure)
  8. -- Set cloning priority to -q (ntfsclone > partimage > dd if copying Windows (NTFS) partitions
  9. Force client to wait for confirmation before cloning (-c option) using space to activate option and enter to accept currently activated options
  10. Make sure to clone hidden data between MBR and 1st partition to save any recovery tool stored there (-j2 option)
  11. Have client do nothing ("-p true" option) when clone finishes (in case of error)
  12. Use parallel gzip compression (-z1p option), only use others if you know what you are doing!
  13. Split image file at 1000000 MB (DO NOT USE 0!!!) increments so it doesn't split image file up
  14. Wait for DRBL to finish working
  15. PXE boot host client (or use pre-loaded USB image, coming soon!)
  16. Select Clonezilla: save disk sda as image (image name)
  17. Confirm cloning operation
  • Page table errors seemed typical and didn't affect the quality of any images we tested, so it's probably safe to ignore these (although it would be useful to track down why the errors are popping up to see if there are any issues).
  • The performance for imaging one tablet were the same between beginner and expert mode (with many, but not all, defaults chosen in expert mode). Here are the results:
    • Beginner: Clonezilla finished copying approx. 9.060 GB of data in 11.8 mins with a sustained (average) rate of 762 MB/min
    • Expert: Clonezilla finished copying approx. 9.060 GB of data in 11.8 mins with a sustained (average) rate of 762 MB/min

Broadcast image

After you receive the image, you have to put it back out to the others. Rerun the imaging mode selection program:

sudo /opt/drbl/sbin/dcs

When you are broadcasting an image, you have two options. You can wait for a certain amount of time or a certain number of clients. I suggest the “number of clients” option, as it should prevent the problem we've experienced with our dd/udpcast script of missing one client and having to reboot all the clients. You can either use the Beginner mode (to use defaults) or the Expert mode if you know what you are doing.

  • Beginner mode
  1. Select all clients
  2. Clonezilla start
  3. Beginner mode
  4. Restore-disk mode
  5. Have client/s do nothing ("-p true" option) when clone finishes (in case of error)
  6. Select image to restore
  7. Select which drive on client to overwrite (THE ENTIRE DRIVE WILL BE COMPLETELY OVERWRITTEN!!!)
  8. Multicast if LAN supports it (check with network admin) - fastest option
  9. Select clients-to-wait so imaging doesn't start until all clients are ready to image
  10. Select number of clients to restore
  11. Confirm environment is ready for imaging
  12. Wait for DRBL to finish working
  13. PXE boot slave client/s (or use pre-loaded USB image, coming soon!)
  14. Select Clonezilla: multicast restore (image name) to sda
  • Expert mode
  1. Select all clients
  2. Clonezilla start
  3. Expert mode
  4. Restore-disk mode
  5. Accept default options unless you know what you're doing!
    1. (Recommended) Use the existing partition table if you want to keep the layout of the hard drive, or if you are simply replacing a single partition (instead of the entire drive)
    2. Create a partition table proportional to the (I think) existing partitions (-k option)
    3. Use dd to create partition (-j0 option) if saved entire drive (including boot sector)
  6. We want our tablets to be standalone tablets when they are done, so do NOT select any -y options
  7. Have client/s do nothing ("-p true" option) when clone finishes (in case of error)
  8. Select image to restore
  9. Select which drive on client to overwrite (THE ENTIRE DRIVE WILL BE COMPLETELY OVERWRITTEN!!!)
  10. Multicast if LAN supports it (check with network admin) - fastest option
  11. Select clients-to-wait so imaging doesn't start until all clients are ready to image
  12. Select number of clients to restore
  13. Confirm environment is ready for imaging
  14. Wait for DRBL to finish working
  15. PXE boot slave client/s (or use pre-loaded USB image, coming soon!)
  16. Select Clonezilla: multicast restore (image name) to sda
  • Page table errors seemed typical and didn't affect the quality of any images we tested, so it's probably safe to ignore these (although it would be useful to track down why the errors are popping up to see if there are any issues).
  • The performance for imaging one tablet were the same between beginner and expert mode (with many, but not all, defaults chosen in expert mode). Here are the results:
    • Beginner: Clonezilla finished copying approx. 9.060 GB of data in 6.718 mins with a sustained (average) rate of 1344 MB/min
    • Expert: Clonezilla finished copying approx. 9.060 GB of data in 6.732 mins with a sustained (average) rate of 1344 MB/min

Comments

Each interactive command ends with a statement like “Next time you want to do this, run the following command”, giving you a method to bypass the interactive part by using a huge command line instead. If you want to create scripts to handle all of this, then capture these commands (there are many flags!).

CloneZilla Netboot without DHCP

In the past TICC used CloneZilla from a local computer, requiring us to setup some computer to run CloneZilla (above process) every time we imaged. The reason we had to do this is that we do not have control over the DHCP server on the network, so we cannot use PXE to boot our clients if we connect them to the network. To work around this we have been developing a DHCP-server-less configuration of CloneZilla that allows us to perform our imaging. This build has 2 components: a special netbooting USB flash disk and modifications to our CloneZilla installation.

Netboot USB Flash Disk

  • started with hardy live cd
  • modified cd image for usb (find link)
  • added netboot to usb (find link)
  • tweaked the syslinux menu to have special clonezilla options
  • added "ifconfig lo up" so DRBL doesn't puke

CloneZilla Modifications

changes to /tftpboot/node_root/sbin/init:

  • changed "nfsserver" to not "ip match"
  • added early mount for /opt
  • added ssh routine to copy the template for our IP

changes to /tftpboot/node_root/:

  • placed ssh in /usr/bin
  • placed a bunch of libraries need by ssh in /lib (find list)

added a user and group "clonezilla"

changes to /tftpboot/nodes/:

  • copied the original IP to "template"
  • applied "chmod -R g+rw template"
  • applied g+x to all directories (find command)
  • applied "chown -R "root:clonezilla template"

The Grand Unified Tablet Build

TICC is now using a single build to image all of our tablets. This build requires a script to handle the differences between the tablets, as of Intrepid Ibex we only require separate Xorg.conf files and a separate "pen button" configuration for each of the supported models. The script currently supports the tc1100, the tc4200, the tc4400, and the 2710p tablets. The GUTB scripts are now available in the TICC Personal Package Archive on Launchpad. You can install this PPA by going to the System -> Administration -> Software Sources menu and adding the source "ppa:csm-ticc/csm-ticc-ppa". After installing the PPA you can install the GUTB using the command:

sudo apt-get install gutb

Once installed, the script will ensure on boot that the appropriate settings are applied (allowing the script to be installed once and imaged to all the other tablets).

Detection of Tablet Model

A simple hash of the CPU information is used to create a unique identifier for each tablet. The script '/scripts/cpuhash.sh' can be used to generate this id, this script just runs the command:

cat /proc/cpuinfo | grep -v bogomips | grep -v "cpu MHz" | md5sum | awk '{ print $1 }'

This command takes the CPU identification and strips out the part that varies from time to time (bogomips and "cpu MHz") and creates an md5sum of the remaining data. It is important to note that because of the technique used to detect the model, more than one CPU can correspond to a particular tablet model. To add a hash to the list so that it correspond to a particular model you must tack on the result of '/scripts/cpuhash.sh' to the file '/scripts/hashes.sh'. This file is formatted 'addHash <hash> <name>'; for example, the tc1100 entry appears as:

        # CPU Hash                       # Tablet Name
addHash d4c66c8352264f0fd3a70935ad43dacc tc1100

Differences in the Wacom Driver

The tc1100 and tc4200 have two major differences in how they utilize the Wacom pen: the tc1100 has no eraser and the side-buttons have different IDs on the two tablets. To resolve the eraser issue, there is a separate xorg.conf for each tablet. To handle the button codes being different there is a separate folder of scripts for each pen button for the two tablets, when the tablet starts up a symbolic link is made to the appropriate script folder. It used to be necessary to patch the wacom driver, however, on the new Ubuntu 9.10 these changes are included so it is only necessary to setup the scripts with a small profile file configuring the buttons. A ".profile" is simply added to the user's home folder containing the instructions to convert the button clicks into key presses:

xsetwacom set stylus Button30 "CORE KEY SHIFT F1"
xsetwacom set stylus Button31 "CORE KEY SHIFT F2"
xsetwacom set stylus Button32 "CORE KEY SHIFT F3"

Differences in the Video Driver

The tc1100 uses nVidia's proprietary video card driver while the tc4200 uses the open-source Intel i810 driver. Due to this issue there is a separate xorg.conf for each tablet. While the tablets will work without these changes, without xorg.conf you will need to reconfigure the graphics driver at every boot.

Important things to remember in future builds

Don't forget to install:

  • vpnc
  • kile
  • Mathematica
  • LabVIEW

Make a set of key-bindings for the "fn" keys.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox