Imaging Guide

From Physiki
(Difference between revisions)
Jump to: navigation, search
(Install DRBL, step 2)
m (Reverted edits by 3dOyunlar (talk) to last revision by Ehoover)
 
(47 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
== CloneZilla Implementation ==
 
== CloneZilla Implementation ==
 
There is some patchy original documentation at the [http://www.clonezilla.org/clonezilla-server-edition/ Clonezilla Guide] and [http://drbl.sourceforge.net/ DRBL homepage].
 
There is some patchy original documentation at the [http://www.clonezilla.org/clonezilla-server-edition/ Clonezilla Guide] and [http://drbl.sourceforge.net/ 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
  
 
===Import the repo key to your keyring===
 
===Import the repo key to your keyring===
Line 9: Line 31:
  
 
===Edit sources.list===
 
===Edit sources.list===
Add the deb line (below) using System > Software Sources, or create a new file /etc/apt/sources.list.d/clonezilla.list and add the following entry:
+
Create a new file /etc/apt/sources.list.d/clonezilla.list and add the following entries:
*<code> deb http://drbl.sourceforge.net/drbl-core drbl stable </code>
+
<pre>deb http://drbl.sourceforge.net/drbl-core drbl stable
 +
deb http://drbl.sourceforge.net/drbl-core drbl unstable</pre>
 
(This also works if you add this line to /etc/apt/sources.list)
 
(This also works if you add this line to /etc/apt/sources.list)
  
Line 16: Line 39:
 
<pre>sudo apt-get update && sudo apt-get install clonezilla drbl</pre>
 
<pre>sudo apt-get update && sudo apt-get install clonezilla drbl</pre>
  
===Install DRBL, step 1 ===
+
===Install DRBL with CloneZilla Live ===
There are two commands you use to install and activate CloneZilla.  The first is
+
Download a CloneZilla Live ISO from
<pre>sudo /opt/drbl/sbin/drblsrv -i</pre>
+
http://clonezilla.org/downloads.php
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.  Other than that, the questions are pretty straightforward.  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, but we don't care.
+
  
These are the answers I used:
+
'''No Longer Needed''' Install the live ISO using (replace VERSION with the applicable version):
#Install the network installation boot images
+
<pre>sudo /opt/drbl/sbin/drbl-ocs-live-prep -i clonezilla-live-VERSION.iso</pre>
#I did not use the serial console output on the client computer.  Use this only if you know what you are doing.
+
#I used the same architecture as my server, but I knew that the clients and my server were all x86's.
+
#I upgraded the OS to make sure my server wass up to date (you don't have to do this).
+
#I used the same kernel as was installed on my server.
+
  
===Install DRBL, step 2 ===
+
Run the automated install procedure using:
The second step creates the configuration for all the clients:
+
<pre>sudo /opt/drbl/sbin/drbl4imp -p 40 -r 1 -z 3 -u 1</pre>
<pre>sudo /opt/drbl/sbin/drblpush -i</pre>
+
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.
+
  
These are the options I used:
+
Fix the installed ISO files so they can be found by the CloneZilla configuration application:
#I don't have a DNS name (I'm doing this at home), but if you do, feel free to input it; I used the default "drbl.name".
+
<pre>sudo ln -s Clonezilla-live-initrd1.img Clonezilla-live-initrd.img
#I don't have an NIS/YP domain name either, so I used the default "penguinzilla".
+
sudo ln -s Clonezilla-live-vmlinuz1 Clonezilla-live-vmlinuz</pre>
#I used the default hostname prefix (my server hostname) as I didn't want to specify a unique hostname for all of the IPs for all of my tablets in /opt/drbl/conf/client-ip-hostname.
+
#My server is also my desktop (and is connected wirelessly), so the connection I use for the internet is wlan0 (DRBL wanted to use eth0).  If you are running Gnome, you can tell which connection to use here by right clicking on the NetworkManager icon, selecting "Connection Information" and looking at the Interface line (mine is "802.11 WiFi (wlan0)", you want whatever is in the parentheses).
+
#I do not care to give my tablets the same IP addresses each time, so I did not collect them.  Doing this is probably a labor-intensive task, but it is probably worth it for larger organizations.
+
#Again, I had to tell DRBL that I didn't want to give the same IP address to each MAC address it connected to.
+
# My server's IP is 192.168.0.1, so I want to start the clients IP addresses at 192.168.0.2, so I entered in a 2.
+
# I may have a maximum of three (3) tablets to image for this walkthrough, so I entered in 3.  For a larger organization, this may change as new tablets are brought in and older tablets are broken/stolen/lost (but hopefully not).
+
#I accepted the IP settings, as it wanted to give out the IP addresses 192.168.0.2 through 192.168.0.4.
+
#DRBL then printed out the layout for my environment, which looked like:
+
              NIC    NIC IP                          Clients
+
+----------------------------------------+
+
|            DRBL SERVER                |
+
|      +-- [wlan0] 192.168.11.2          +- to WAN
+
|                                        |
+
|      +-- [eth0] 192.168.0.1            +- to clients group 0 [ 3 clients, their IP
+
|                                        |              from 192.168.0.2 - 192.168.0.4]
+
+----------------------------------------+
+
#I hit enter to confirm the network layout.
+
#I chose 0 to give each client its own NFS-based /etc and /var.
+
#I chose 1 (Clonezilla box mode) so the image loaded by the clients will not be saved after shutdown.
+
#I use /images to store the hard drive images for clients.
+
#Using a swap partition or file is useful so the client has more memory to use.  With my computers, I don't think this makes a difference, but it couldn't hurt, as it only writes to swap partitions or writable filesystems.
+
#I used the 128MB as the size for the swap space.
+
#I like GUIs, so I used the Graphic mode (X window system) option.
+
#I used the auto login so I don't have to manually login to every client to image.
+
#I did not use a random password for auto login accounts.
+
#I entered in the password I wanted to use "password".
+
#Retype the password you want to use.
+
#I just let root's password be copied from the server to the clients (not the best security, but I'm on my own LAN), so I answered no.
+
#I don't want a bootup password for PXE, although this would be useful for larger organizations.
+
#I do want to set the boot prompt for the clients.
+
#I used the default 70 for the next option.  I think the option is in tenths of a second, so 70 deciseconds is 0.70 seconds.  The prompt is a little confusing (and I could have interpreted it wrong, we will see).
+
#I don't want to use the graphic background for the PXE menu, as that adds to the complexity of the booting.
+
#I don't need audio, cdrom, floppy, video, and plugdev used for the clients, as it will just be for installing an image.
+
#My clients don't need two IPs.
+
#My clients also do not need to run in terminal mode.
+
#My clients don't need internet access.
+
#I don't need to keep the old settings of existing DRBL clients.
+
#My server supported NFS over TCP, so I just had to hit enter.
+
#And hit enter to start the process.  DRBL/Clonezilla will run for awhile, and then prompt you to PXE-boot your clients.
+
#PXE-boot clients into Gnome environment.  They can now do whatever they like.
+
  
===Setup NFS for All Clients===
+
===Setup after installing DRBL and CloneZilla===
DRBL will configure NFS "incorrectly" for booting from USB clients controlled by a different DHCP server.  Provided that your NFS server doesn't do anything but serve CloneZilla, you simply replace your /etc/exports with the following:
+
 
 +
====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 <pre>check_server_name="yes"</pre> to <pre>"check_server_name="no"</pre>
 +
 
 +
Also add the lines (where IP_OF_SERVER is the server IP and NAME_OF_SERVER is the name of the server):
 +
<pre>siaddr="IP_OF_SERVER"
 +
sname="NAME_OF_SERVER"</pre>
 +
 
 +
You must also edit "/tftpboot/node_root/sbin/init" by changing "-f1-3" to "-f1-2".  This is done because "-f1-3" indicates to the server that 3 out of the four IP address slots will remain constant.  On the Mines network, this is not the case as we have a Class B network.  This task must be re-done if you re-run the DRBL installation.
 +
 
 +
====Configuring NFS (Network File System)====
 +
DRBL will configure NFS for every individual tablet IP 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 and does not allow logins from IPs not on the list (a problem if you have another DHCP server managing your network)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 look similar to the following:
 
<pre>/tftpboot/node_root *(ro,sync,async,no_root_squash,subtree_check)
 
<pre>/tftpboot/node_root *(ro,sync,async,no_root_squash,subtree_check)
 
/usr *(ro,sync,async,no_root_squash,subtree_check)
 
/usr *(ro,sync,async,no_root_squash,subtree_check)
Line 86: Line 75:
 
/images *(rw,sync,async,no_root_squash,no_subtree_check)</pre>
 
/images *(rw,sync,async,no_root_squash,no_subtree_check)</pre>
  
===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:
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 servers:
+
 
<code><pre># Number of servers to start up
 
<code><pre># Number of servers to start up
RPCNFSDCOUNT=1000</pre></code>
+
RPCNFSDCOUNT=100</pre></code>
 
and the number of simultaneous RPC mounts:
 
and the number of simultaneous RPC mounts:
<code><pre>RPCMOUNTDOPTS="--num-threads=50"</pre></code>
+
<code><pre>RPCMOUNTDOPTS="--manage-gids --num-threads=50"</pre></code>
  
===A word===
+
When done, reboot the NFS server:
It is important to test out all configurations on a small subset (at least one machine of every model you have) before applying the changes to the rest of the machines you will be imaging.  Testing is always a good idea, and if you screw up it means you only have to fix a small number of tablets instead of a large number.  With that said, read on.
+
<pre>sudo /etc/init.d/nfs-kernel-server restart</pre>
  
===Get image from source tablet ===
+
====Setup Apache for gPXE====
All the imaging parameters are accessed by running the command:
+
If you have not installed apache already, install it using:
<pre>sudo /opt/drbl/sbin/dcs</pre>
+
<pre>sudo apt-get install apache2</pre>
# Select all clients (unless you have a list of the individual tablet IPs or MAC addresses and only want to image a few) and choose the clonezilla-start mode.
+
After installing apache you want to add the following to the "/etc/apache2/sites-available/default" file (within the VirtualHost tags):
#I then chose to use the expert interface, and the "save-disk" mode to save the entire disk of a tablet.
+
<pre>        ## Below are entries for gPXE to boot tablets remotely:
#Setting the image name now is useful, but you can also choose to set it later (when you boot the tablet from using PXE or a pre-loaded USB drive).  Whatever you choose, pick a good name, I suggest adding a small description onto the end of its default name (which is the current date).
+
        Alias "/gpxe" "/tftpboot/nbi_img"
#Next, choose the disk/partition *device name* you want to save, eg: "sda" (without the quotes) for /dev/sda (the first disk on the tablet).
+
        <Directory "/tftpboot/nbi_img">
#You can tell Clonezilla to use a priority for cloning programs.  TICC does not have a Windows partition on our tablets (we don't run Windows on the tablets), so I chose the option "-q2  Priority: partclone > partimage > dd" which (I think) means that partclone has the highest priority, then partimage, and finally dd.  dd is the safest option if you have exotic types of partitions, but it is inefficient as it copies the entire disk, even if there is no data.  It makes an exact bit-for-bit copy of drives (which can be very useful).<br />If you have a Windows NTFS partition (eg: if you run Windows XP or greater), you may want to consider using the "-q  Priority: ntfsclone > partimage > dd" option, which means that it will use ntfsclone for ntfs partitions, then partimage for the rest, and dd for anything it doesn't recognize (I think).  If you don't know, this is probably the safest option, but it might not be the fastest (I honestly don't know).
+
                Order allow,deny
#The next step was choosing options for cloning.  The only option that was enabled by default for me was -j2 (Clone the hidden data between MBR and 1st partition), but I also turned on -c (Client waits for confirmation before cloning) so I would have to start the cloning process on the client.  The defaults look reasonable, I suggest leaving them.
+
                Allow from all
#I then chose to poweroff the clients when the cloning process was over, just to give myself (and the switch and my server) a little breathing room between copying the source image to my server and copying the image to the rest of the client machines.
+
        </Directory></pre>
#I chose the default compression scheme.  Choose otherwise if you know what you're doing (and read the warnings).
+
Once you've added this section restart apache with:
#I chose the "1000000" option so the image wouldn't be split up into multiple files.
+
<pre>sudo /etc/init.d/apache2 restart</pre>
  
Clonezilla pestered me to setup the IP addresses of the machines so it could give out the same address each time (it looks at their MAC addresses), but since I'm on my own LAN with only my server and my clients, I don't care.  If you have other machines on the network though, it might be a good idea to get the MAC addresses of the tablets you want to image and add them to dhcpd.conf as it suggests.
+
====Create gPXE USB Boot Disks====
 +
If you are not using the CloneZilla server to manage DHCP on your network then you cannot directly PXE boot the tablets on the network.  However, you can create a USB boot disk that will PXE boot directly to your CloneZilla server.  Below is a script that will generate such a disk; note, however, that this script will wipe the partition table of the disk you use it on (so don't use it on a drive you care about):
  
The Clonezilla command finished running, so I then booted the source tablet with my pre-loaded USB (link at end of page) and chose the "backup" option at the TICC screen.
+
{{archive|filename=Build-gpxe-ticc.sh.tar.gz|title=gPXE Boot Disk Creation Script|version=1.1.0}}
  
 +
When it asks you about what server you should install from, ticc.mines.edu does not work, for some reason.  However, ticc-1.mines.edu and the IP address of both the old and new server work fine.
  
 
+
===Get Image From Source Tablet ===
First you need to set the mode, the ones we are about are “clonezilla-start” and “clonezilla-stop”.  The Clonezilla mode we want to use is “clonezilla-save-disk” so that we can back up the image from our source tablet.  Note that the defaults include no graphical boot screen – this is nice to have, so change this option.  Also, choose whether you want to set the image name now or later.  “Now” is fine, though it's easier to set the image later when you get to the tablet computer.  Boot your master computer either using a PXE boot procedure or use a pre-loaded USB disk, then follow the upload instructions.
+
All the imaging parameters are accessed by running the command:
 
+
===Broadcast image===
+
After you receive the image, you have to put it back out to the others.  Rerun the imaging mode selection program:
+
 
<pre>sudo /opt/drbl/sbin/dcs</pre>
 
<pre>sudo /opt/drbl/sbin/dcs</pre>
Now select the option “clonezilla-start” then “clonezilla-restore-disk”.  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
 +
# Select all clients
 +
# Clonezilla start
 +
# Beginner mode
 +
# Save-disk mode
 +
# Choose to set name now (or later, it's your choice)
 +
# Append short description of image onto end of default image name (date and time)
 +
# Select which drive on client to save as image on server
 +
# Have client do nothing ("-p true" option) when clone finishes (in case of error)
 +
# Split image file at 1000000 MB (DO NOT USE 0!!!) increments so it doesn't split image file up
 +
# Wait for DRBL to finish working
 +
# PXE boot host client (or use pre-loaded USB image, coming soon!)
 +
# Select Clonezilla: save disk sda as image (image name)
  
===Da-da!===
+
* Expert Mode
That's it!  Our test run showed a sustained transfer speed of about 1GB of data/minute, which may or may not happen on a regular basis.
+
# Select all clients
 +
# Clonezilla start
 +
# Expert mode
 +
# Save-disk mode
 +
# Choose to set name now (or later, it's your choice)
 +
# Append short description of image onto end of default image name (date and time)
 +
# Select which drive on client to save as image on server
 +
## Set cloning priority to -q2 (partclone > partimage > dd) if not running Windows and max efficiency
 +
## 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)
 +
# -- Set cloning priority to -q (ntfsclone > partimage > dd if copying Windows (NTFS) partitions
 +
# Force client to wait for confirmation before cloning (-c option) using space to activate option and enter to accept currently activated options
 +
# Make sure to clone hidden data between MBR and 1st partition to save any recovery tool stored there (-j2 option)
 +
# Have client do nothing ("-p true" option) when clone finishes (in case of error)
 +
# Use parallel gzip compression (-z1p option), only use others if you know what you are doing!
 +
# Split image file at 1000000 MB (DO NOT USE 0!!!) increments so it doesn't split image file up
 +
# Wait for DRBL to finish working
 +
# PXE boot host client (or use pre-loaded USB image, coming soon!)
 +
# Select Clonezilla: save disk sda as image (image name)
 +
# Confirm cloning operation
  
===Misc. Comments ===
+
* 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).
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.  I was never paying enough attention to capture these, but we should get them and put them up on the wiki to save some time.
+
* 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
  
Good luck!
+
<syntaxhighlight lang="text">/opt/drbl/sbin/drbl-ocs -b -q2 -c -j2 -sc -p true -z1p -i 1000000 -l en_US.UTF-8 startdisk save <File Name> sda
 +
</syntaxhighlight>
  
 +
===Broadcast image===
 +
After you receive the image, you have to put it back out to the other tablets.  Rerun the imaging mode selection program:
 +
<pre>sudo /opt/drbl/sbin/dcs</pre>
 +
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
 +
# Select all clients
 +
# Clonezilla start
 +
# Beginner mode
 +
# Restore-disk mode
 +
# Have client/s do nothing ("-p true" option) when clone finishes (in case of error)
 +
# Select image to restore
 +
# Select which drive on client to overwrite (THE ENTIRE DRIVE WILL BE COMPLETELY OVERWRITTEN!!!)
 +
# Multicast if LAN supports it (check with network admin) - fastest option
 +
# Select clients-to-wait so imaging doesn't start until all clients are ready to image
 +
# Select number of clients to restore
 +
# Confirm environment is ready for imaging
 +
# Wait for DRBL to finish working
 +
# PXE boot slave client/s (or use pre-loaded USB image, coming soon!)
 +
# Select Clonezilla: multicast restore (image name) to sda
  
 +
* Expert mode
 +
# Select all clients
 +
# Clonezilla start
 +
# Expert mode
 +
# Restore-disk mode
 +
# Accept default options unless you know what you're doing!
 +
## (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)
 +
## Create a partition table proportional to the (I think) existing partitions (-k option)
 +
## Use dd to create partition (-j0 option) if saved entire drive (including boot sector)
 +
# We want our tablets to be standalone tablets when they are done, so do NOT select any -y options
 +
# Have client/s do nothing ("-p true" option) when clone finishes (in case of error)
 +
# Select image to restore
 +
# Select which drive on client to overwrite (THE ENTIRE DRIVE WILL BE COMPLETELY OVERWRITTEN!!!)
 +
# Multicast if LAN supports it (check with network admin) - fastest option
 +
# Select clients-to-wait so imaging doesn't start until all clients are ready to image
 +
# Select number of clients to restore
 +
# Confirm environment is ready for imaging
 +
# Wait for DRBL to finish working
 +
# PXE boot slave client/s (or use pre-loaded USB image, coming soon!)
 +
# Select Clonezilla: multicast restore (image name) to sda
  
== CloneZilla Netboot without DHCP ==
+
* 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).
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.
+
* 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
=== Netboot USB Flash Disk ===
+
** Expert: Clonezilla finished copying approx. 9.060 GB of data in 6.732 mins with a sustained (average) rate of 1344 MB/min
* 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/:
+
===Comments ===
* copied the original IP to "template"
+
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!).
* 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 ==
 
== 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 [https://launchpad.net/~csm-ticc/+archive/csm-ticc-ppa TICC Personal Package Archive] on Launchpad.  You can install this PPA by going to the System -> Administration -> Software Sources menu and adding the source "<code>ppa:csm-ticc/csm-ticc-ppa</code>".  After installing the PPA you can install the GUTB using the command:
+
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 Ubuntu 10.10 we only require separate Xorg.conf files, a patched wacom driver, and a separate "pen button" configuration for each of the supported models.  The script currently supports the tc1100, tc4200, tc4400, 2710p, and 2740p tablets.  The GUTB scripts are now available in the [https://launchpad.net/~csm-ticc/+archive/csm-ticc-ppa TICC Personal Package Archive] on Launchpad.  You can install this PPA by going to the System -> Administration -> Software Sources menu and adding the source "<code>ppa:csm-ticc/csm-ticc-ppa</code>".  After installing the PPA you can install the GUTB using the command:
 
<pre>sudo apt-get install gutb</pre>
 
<pre>sudo apt-get install gutb</pre>
 
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).
 
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 ===
 
=== 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:
+
A simple hash of the SMBIOS information is used to create a unique identifier for each tablet.  The script '/usr/share/gutb/generic/dmihash.sh' can be used to generate this id.  Provided that the manufacturer of your computer has appropriately filled in the SMBIOS then you can use this script to generate a code for your PC.  To add a hash to the list so that it correspond to a particular model you must tack on the result of the dmi hash script to the file '/usr/share/gutb/gernic/hashes.sh'.  This file is formatted 'addHash <hash> <name>'; for example, the tc1100 entry appears as:
<code><pre>cat /proc/cpuinfo | grep -v bogomips | grep -v "cpu MHz" | md5sum | awk '{ print $1 }'</pre></code>
+
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 dataIt 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:
+
  
 
<code><pre>
 
<code><pre>
        # CPU Hash                      # Tablet Name
+
####### # DMI Hash                      # Tablet Name
addHash d4c66c8352264f0fd3a70935ad43dacc tc1100
+
addHash 0087849ff65c7b4f2c13b754ed4a1b38 tc1100
 
</pre></code>
 
</pre></code>
  
 
=== Differences in the Wacom Driver ===
 
=== 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 [http://wiki.linuxquestions.org/wiki/TC1100_stylus_buttons_patch 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:
+
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.  A ".profile" is simply added to the user's home folder containing the instructions to convert the Wacom pen button clicks into key presses:
 
<pre>xsetwacom set stylus Button30 "CORE KEY SHIFT F1"
 
<pre>xsetwacom set stylus Button30 "CORE KEY SHIFT F1"
 
xsetwacom set stylus Button31 "CORE KEY SHIFT F2"
 
xsetwacom set stylus Button31 "CORE KEY SHIFT F2"
Line 186: Line 225:
 
== Important things to remember in future builds ==
 
== Important things to remember in future builds ==
 
Don't forget to install:
 
Don't forget to install:
* vpnc
 
 
* kile
 
* kile
 
* Mathematica
 
* Mathematica

Latest revision as of 06:31, 23 March 2012

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

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 entries:

deb http://drbl.sourceforge.net/drbl-core drbl stable
deb http://drbl.sourceforge.net/drbl-core drbl unstable

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

Now you can install clonezilla and drbl:

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

Install DRBL with CloneZilla Live

Download a CloneZilla Live ISO from http://clonezilla.org/downloads.php

No Longer Needed Install the live ISO using (replace VERSION with the applicable version):

sudo /opt/drbl/sbin/drbl-ocs-live-prep -i clonezilla-live-VERSION.iso

Run the automated install procedure using:

sudo /opt/drbl/sbin/drbl4imp -p 40 -r 1 -z 3 -u 1

Fix the installed ISO files so they can be found by the CloneZilla configuration application:

sudo ln -s Clonezilla-live-initrd1.img Clonezilla-live-initrd.img
sudo ln -s Clonezilla-live-vmlinuz1 Clonezilla-live-vmlinuz

Setup after installing DRBL and CloneZilla

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 is done because "-f1-3" indicates to the server that 3 out of the four IP address slots will remain constant. On the Mines network, this is not the case as we have a Class B network. This task must be re-done if you re-run the DRBL installation.

Configuring NFS (Network File System)

DRBL will configure NFS for every individual tablet IP 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 and does not allow logins from IPs not on the list (a problem if you have another DHCP server managing your network). 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 look 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)

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=100

and the number of simultaneous RPC mounts:

RPCMOUNTDOPTS="--manage-gids --num-threads=50"

When done, reboot the NFS server:

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

Setup Apache for gPXE

If you have not installed apache already, install it using:

sudo apt-get install apache2

After installing apache you want to add the following to the "/etc/apache2/sites-available/default" file (within the VirtualHost tags):

        ## Below are entries for gPXE to boot tablets remotely:
        Alias "/gpxe" "/tftpboot/nbi_img"
        <Directory "/tftpboot/nbi_img">
                Order allow,deny
                Allow from all
        </Directory>

Once you've added this section restart apache with:

sudo /etc/init.d/apache2 restart

Create gPXE USB Boot Disks

If you are not using the CloneZilla server to manage DHCP on your network then you cannot directly PXE boot the tablets on the network. However, you can create a USB boot disk that will PXE boot directly to your CloneZilla server. Below is a script that will generate such a disk; note, however, that this script will wipe the partition table of the disk you use it on (so don't use it on a drive you care about):

Archive.png Download gPXE Boot Disk Creation Script (1.1.0)

When it asks you about what server you should install from, ticc.mines.edu does not work, for some reason. However, ticc-1.mines.edu and the IP address of both the old and new server work fine.

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
/opt/drbl/sbin/drbl-ocs -b -q2 -c -j2 -sc -p true -z1p -i 1000000 -l en_US.UTF-8 startdisk save <File Name> sda

Broadcast image

After you receive the image, you have to put it back out to the other tablets. 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!).

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 Ubuntu 10.10 we only require separate Xorg.conf files, a patched wacom driver, and a separate "pen button" configuration for each of the supported models. The script currently supports the tc1100, tc4200, tc4400, 2710p, and 2740p 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 SMBIOS information is used to create a unique identifier for each tablet. The script '/usr/share/gutb/generic/dmihash.sh' can be used to generate this id. Provided that the manufacturer of your computer has appropriately filled in the SMBIOS then you can use this script to generate a code for your PC. To add a hash to the list so that it correspond to a particular model you must tack on the result of the dmi hash script to the file '/usr/share/gutb/gernic/hashes.sh'. This file is formatted 'addHash <hash> <name>'; for example, the tc1100 entry appears as:

####### # DMI Hash                       # Tablet Name
addHash 0087849ff65c7b4f2c13b754ed4a1b38 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. A ".profile" is simply added to the user's home folder containing the instructions to convert the Wacom pen 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:

  • kile
  • Mathematica
  • LabVIEW

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

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox