V. Managing disk images with ghost for unix

Contents

1. Introduction
    1.1 How to read this chapter
    1.2 Additional information
    1.3 Assigning fixed IP addresses

2. Making preparations
    2.1 Creating a g4u diskette on the server
    2.2 Creating a g4u diskette on another computer
    2.3 Ghost for unix on CD
    2.4 The list of MAC addresses

3. Before restoring an image on a new workstation
    3.1 Preparing the hardware
    3.2 Booting the computer with g4u
    3.3 Retrieving the MAC-address
    3.4 Assigning a fixed IP-address
    3.5 Hints and tips

4. Restoring an image on a workstation
    4.1 Booting the computer with g4u
    4.2 Using the slurpdisk command
    4.3 Setting the workstation name
    4.4 Setting the default printer
    4.5 Hints and tips

5. Creating an image of a workstation
    5.1 Booting the computer with g4u
    5.2 Using the uploaddisk command
    5.3 Hints and tips

1. Introduction

When the Operating System (hereafter 'OS') of a workstation malfunctions, or when a staff member or pupil, by incorrect manipulations, ruins the OS, it is not a disaster. It certainly is not necessary to setup the OS from scratch and reinstall all programs. With the aid of a special bootable diskette you can restore the complete OS and its installed software. This is done with the program 'ghost for unix' or 'g4u' for short.

This chapter describes the necessary preparations for working with g4u. Also the procedure to create and restore a disk 'image' on a workstation is discussed. An image of a hard drive is an identical copy of the hard drive, including empty sectors, akin to cloning the data. Also known as creating a 'mirror image' or 'mirroring' the drive or creating a 'ghost image'. (adapted from: http://precisecyberforensics.com/glossary.html).

NOTICE: In order to work with g4u you need to have a valid username and corresponding password on the server. Your local systems administrator or your ICT coordinator can provide these. Please refer to section 13.1 Creating a g4u user account in chapter V. Configuring all ServerAtSchool components of the ServerAtSchool Installation Guide for more information.

1.1 How to read this chapter

This chapter is divided into several sections. Each section discusses a specific procedure. You do not have to read the complete chapter if you are in a hurry, but it is recommended nonetheless. The local systems administrator should read the whole chapter. The ICT coordinator may want to read sections 4 and 5. An interested staff member may want to take a look at section 4.

In section 2. Making preparations the necessary steps to create a bootable g4u boot floppy are discussed. This section also talks about collecting MAC-addresses of all workstations. These are all procedures that need to be done only once. This section is recommend reading for the local systems administrator.

Section 3. Before restoring an image on a new workstation handles the case of restoring an image on a new workstation. This is different from restoring an image in general because the BIOS of the workstation needs to be configured and the MAC-address has to be retrieved. This is a procedure that is necessary only once per workstation. This section is recommended reading for the local systems administrator and perhaps for the ICT coordinator too.

Section 4. Restoring an image on a workstation documents the task of bringing a workstation back to a 'known-good' state by restoring an image that was created earlier. This section is recommended reading for both the ICT coordinator and the local systems administrator. It could be of interest for selected members of the staff interested in keeping the workstations in their classroom clean.

Finally, section 5. Creating an image of a workstation deals with uploading an image of a workstation to the server. After an image has been created this way it can be downloaded to all other workstations, bringing them up to date. This section is recommended reading for both the ICT coordinator and the local systems administrator.

NOTICE: This chapter continues using the example school introduced in section 2. The Exemplum Primary School of chapter II. ServerAtSchool User Manual Overview. At this school Freddie Frinton (userid 'ffrint') is the local systems administrator and Amelia Cackle (userid 'acackl') is the ICT coordinator. The user account used for storing g4u images on the server is called 'install', with password 'cooT9joo'. Note that your school may have a different account and/or password; these are just examples.

NOTICE: Image creation and restoring was done on a 4.3 GB harddisk.

1.2 Additional information

In this version of ServerAtSchool the single diskette version of g4u is described (version 1.17). A newer version, supporting newer network devices is available at http://www.feyrer.de/g4u. This is the site of the author of g4u, Hubert Feyrer. The newer versions of g4u require two diskettes. This can be very inconvenient especially when support for the latest network devices is not required. ServerAtSchool usually runs in schools where as a rule not the latest hardware is used. Therefore we decided to use version 1.17, on a single diskette.

On the g4u site you can also find additional documentation for ghost for unix. There is also a CD-ROM image available for download on the g4u site. A CD-ROM image for version 1.17 can be found on your server in \\SERVER\install\goodies\g4u. If your client computers have CD-ROM players but no diskette drives, you can use this image and run g4u without diskettes. See also section 2.3 Ghost for unix on CD below.

1.3 Assigning fixed IP addresses

Every workstation has a NIC, a Network Interface Controller, either on the motherboard, or as a separate card in one of the slots on the motherboard. Every NIC has unique number, the MAC address. MAC stands for Media Access Code. This unique address is a number of 48 bits. It is usually written using six pairs of hexadecimal digits, for example: 00:80:D0:9B:DC:F7.

Every workstation has to have an IP-address in order to communicate with the server. IP stands for Internet Protocol. These addresses are usually written as four decimal numbers separated with dots, for example 192.0.34.166. This notation is called 'dotted-decimal'.

In a standard ServerAtSchool setup the server has been assigned the fixed IP-address 172.17.2.1 whereas the workstations receive a dynamic IP-address from the DHCP-server. DHCP stands for Dynamic Host Configuration Protocol. This dynamic IP-address is allocated from the pool of dynamic addresses as defined in the configuration file /etc/dhcpd.conf of the DHCP-server. By default this range starts with 172.17.2.141 and ends with 172.17.2.240.

In the standard ServerAtSchool DHCP configuration file another range is reserved for the so-called static pool. This range starts with 172.17.2.21 and ends with 172.17.2.120.

By combining the unique and machine-specific MAC-address with an IP-address from this static pool of IP-addresses it is possible to make absolutely certain that a computer with a particular MAC-address always gets the same IP-address. This mapping between MAC-address and IP-address is established by editing the aforementioned configuration file /etc/dhcpd.conf and restarting the DHCP server.

For further details on this issue see section 5. DHCPD in V. Configuring all ServerAtSchool components of the ServerAtSchool Installation Guide.

It is important that all workstations always get the same IP-address because otherwise you can never be sure that the machine labeled '34' on the outside (with a felt tip pen) is in fact workstation 'C34' with IP-address 172.17.2.34. It is also important (and efficient) to let all workstations use the DHCP protocol to receive an IP-address because it is a lot of work to assign IP-addresses in the workstation configuration manually. If you want to satisfy both conditions, you should create a list of all MAC-addresses of all workstations and assign an IP-address from the static pool to each one of them. This way every workstation always gets the IP-address you assigned rather than some random address from the dynamic pool.

NOTICE: It is also a good security measure to let the 'known' workstations have an IP-address from the static pool. The local systems administrator can easily track individual workstation behaviour and can prevent, for example, unauthorized laptops accessing the schools LAN (Local Area Network). That would be a matter of disabling the dynamic pool alltogether.

NOTICE: It is a good idea to also write down the MAC-addresses of any network printers you may have. By convention a ServerAtSchool network uses IP-addresses in the range 172.17.2.10 to 172.17.2.19 for printers. For printers it is even more important that they receive the same IP-address every time. You even may want to add a special 'printer pool' in the configuration file /etc/dhcpd.conf and use it for documenting the printer devices.

The bottom line of the story is that we need the MAC-addresses of all workstations throughout the school. See section 2.4 The list of MAC addresses for the necessary steps to collect all MAC-addresses.

(top)

2. Making preparations

The easiest way to get the bootable g4u diskette is from the local systems administrator or the person who installed the ServerAtSchool server. See section 13.4 Creating a g4u boot floppy in chapter V. Configuring all ServerAtSchool components of the ServerAtSchool Installation Guide for more information.

The necessary steps to create a boot floppy are repeated below, for your convenience. The easiest way is to create it on the server. The hard way is to use the DOS prompt on a workstation.

The remainder of this section discusses other necessary preparations such as making a list of MAC-addresses.

2.1 Creating a g4u diskette on the server

If you want to create a g4u diskette on the server you should take the following steps.
  1. Get a formatted, 1.44 MB (High Density) diskette. Set the erase protection to 'off'. Insert the diskette in the diskette drive of the server. Note that all information on this diskette will be overwritten.
  2. Login as root and issue the following command.
    dd if=/home/share/install/goodies/g4u/g4u-1.17.fs of=/dev/fd0
  3. After a short wile the diskette is ready.
  4. Remove the diskette from the drive and label it something like 'g4u-1.17'.

This is the preferred method to create the g4u diskette because it is quick and easy compared to the alternative procedure discussed in the next section.

2.2 Creating a g4u diskette on another computer

Another way to create a g4u diskette is to use the DOS/Windows environment on a different computer. In order to make the diskette you need the following two files.

Both files are available on the server (in the directory tree under /home/share/install/goodies). They can also be accessed via the 'Network Neighbourhood' on a correctly configured workstation. Both files should be copied to a directory on the workstation. However, you need a workstation that is already configured to communicate with the server. This could be a classical chicken-egg situation since you may still be busy setting up a workstation. In that case there might not (yet) be another working workstation available. Fortunately there is another way. You can simply use the ServerAtSchool distribution CD-ROM on an existing DOS/Windows computer. Here is the step-by-step procedure:

  1. Insert the ServerAtSchool CD-ROM into the CD-ROM drive on the DOS/Windows workstation.
  2. On the Windows Desktop, doubleclick on 'My Computer'.
  3. Navigate to: d:\ServerAtSchool\goodies (where d: is the CD-ROM drive).
  4. Copy the file RAWRITE.EXE to a temporary directory on the workstation. Remember in which directory you saved the file.
  5. Navigate to: d:\ServerAtSchool\goodies\g4u.
  6. Copy the file g4u-1.17.fs to the same temporary directory on the workstation.
  7. (optional) You may want to rename the file (e.g. from g4u-1.17.fs to G4U.IMG) in order to prevent difficulties with the short DOS-name lateron.
  8. Navigate to: Start | Run. The Run window opens.
  9. Click [Browse]. The Browse window opens.
  10. Navigate to the temporary directory where you saved both files.
  11. Select the file RAWRITE.EXE and click on the [Open] button.
  12. You are back at the Run window. The path and file name are in the Open: field. Click [OK].
  13. The DOS window opens. You see the name of the program and the line:
    Enter source file name:
  14. At this prompt, type the short DOS filename of the diskette image, i.e. something like G4U-11~1.FS. If you had renamed the file to G4U.IMG as suggested above you would of course enter that name.
  15. When you have correctly entered the filename, you see the following line:
    Enter destination drive:
    Enter the letter associated with the diskette drive. Usually this is the letter 'A'.
  16. Now you see the following line:
    Please insert a formatted diskette into drive A: and press -ENTER-
  17. Insert a blank, formatted 1.44 MB diskette in the diskette drive of the workstation.
  18. Now you see three lines of text showing you the status of the process. The last line indicates the progress.
  19. When the diskette is ready you see: Done., indicating the diskette writing process is finished.
  20. Remove the diskette from the drive and label it something like 'g4u-1.17'.
The g4u diskette is ready for use.

NOTICE: This procedure is similar to the procedure of creating an Autoclave diskette in section section 3.1.2 Creating an Autoclave diskette on another computer in chapter IV. Workstation setup.

NOTICE: It can be hard to use files with so-called long filenames (e.g. g4u-1.17.fs or Boot Diskette.img) with software that expects a plain old-fashioned DOS filename consisting of 8 (upper case) characters, a dot and a 3-character (uppercase) extension. Windows tries hard to maintain compatibility by changing the long names into acceptable short names, usually by truncating the name and using a tilde '~' followed by a number. However, in order to prevent problems it is best to stick to the 8.3 type filenames.

2.3 Ghost for unix on CD

By default ServerAtSchool installs an .ISO image of ghost for unix 1.17 on the server (in \\SERVER\install\goodies\g4u or /home/share/install/goodies/g4u). This file is called g4u-1.17.iso.

This file contains everything necessary to create a bootable CD-ROM that can be used to boot a computer without a floppy drive with g4u after all.

If you happen to have modern workstations, booting from CD-ROM should not be a problem, if you configured the BIOS correctly. Note that a CD-ROM would provide you with a lot more space than a diskette ever could (650 MB versus 1.44 MB). Therefore newer versions of g4u, including support for many network devices, can be stored on a single CD-ROM, even when otherwise that version would need more than one diskette.

The process of burning a CD-ROM based on the .ISO-file provided is beyond the scope of this manual. Please refer to the documentation that comes with the software you use for burning CD-ROMs. You may also want to look at the g4u project page at http://www.feyrer.de/g4u for more information.

2.4 The list of MAC addresses

The easiest way to collect the MAC-addresses of all workstations is to use the worksheet in section 6. Collecting MAC-addresses and other information of Appendix C. Worksheets. You can perhaps print this worksheet and fill it in using a pencil. Afterwards you can give it to the local systems administrator who in turn will add the information to the DHCP configuration file /etc/dhcpd.conf on the server.

In the worksheet in the appendix there is also space to write down the physical location of the workstation, e.g. kids from room 402, headmaster office, faculty office, Amelia's computer, etc. This information can also be entered in /etc/dhcpd.conf as a comment (using a '#') as illustrated in the snippet below.

host c21 { hardware ethernet 00:B0:80:9B:DC:F7; # Freddie's computer
        fixed-address 172.17.2.21; }

# (host definitions c22 ... c33 go here)

host c34 { hardware ethernet 00:B0:80:9C:B7:F6; # Faculty office
        fixed-address 172.17.2.34; }

# (more host definitions go here)

host c53 { hardware ethernet 00:B0:80:9C:DD:75; # Room 402
        fixed-address 172.17.2.34; }

If you want to assign numbers to all your workstations in a systematic way, you could take the following steps.

Note that the number should be written on the workstation on a well visible place. The number will be used when setting the computername (e.g. 'C34') after restoring an image as described under 4.3 Setting the workstation name.

By assigning numbers this way you can easily identify individual computers by

This makes it easier to make the connection between a line in the logfiles (where you see that someone on machine 172.17.2.53 is trying to get through the firewall while installing some P2P-client) and the machine 'C53' in grade 8.

It is strongly advised to conform to the ServerAtSchool convention and start numbering your workstations beginning with number 21. For more information on the computername is see section 5.1 Default configuration in ServerAtSchool in chapter V. Configuring all ServerAtSchool components in the ServerAtSchool Installation Guide.

(top)

3. Before restoring an image on a new workstation

The whole idea of having an image of single workstation that can be 'cloned' to other workstations is based on the assumption that all these workstations are identical. For every workstation you should make certain that this assumption holds true.

Usually that means that you have to enter the workstation setup screen and make sure the BIOS-settings are the same. Since you are now configuring individual workstation hardware, now would also be a good time to collect the individual MAC-address too.

3.1 Preparing the hardware

Because there exists a wide variety of workstation hardware, it is impossible to discuss all different possibilities. Refer to section section 2.1 Hardware in IV. Workstation setup for more information. A few general remarks can be made, though.

In order to make the workstations identical you should take at least the following steps.

NOTICE: Depending on the workstation you may be able to retrieve the MAC-address from the BIOS setup screen. If you can, you can write this number on the list of MAC-addresses and skip the procedure of retrieving the MAC-address discussed below.

3.2 Booting the computer with g4u

If you want to boot the computer with g4u, you should take the following steps.

At this point the computer should boot from the diskette or the CD-ROM. The monitor will show a long list of messages. Eventually you see the following screen.

-------------------------------------------------------------------------------
 Welcome to g4u Harddisk Image Cloning V1.17!

Commands:
  * Upload disk-image to FTP:   [GZIP=1] uploaddisk serverIP [image] [disk]
  * Upload partition to FTP:    [GZIP=1] uploadpart serverIP [image] [disk+part]
  * Install harddisk from FTP:           slurpdisk  serverIP [image] [disk]
  * Install partition from FTP:          slurppart  serverIP [image] [disk+part]
  * Copy disks locally:                  copydisk disk0 disk1
  * List all disks:                      disks
  * List partitions:                     parts disk
  * See all devices:                     dmesg
  * This screen:                         help

 [disk] defaults to wd0 for first IDE disk, [disk+part] defaults to wd0d for
 the whole first IDE disk. Use wd1 for second IDE disk, sd0 for first SCSI
 disk, etc. Default image for slurpdisk is 'rwd0d.gz'.  

 Enjoy!                                       Send comments to hubert@feyrer.de
                                              Donate at paypal@feyrer.de !
                                              http://www.feyrer.de/g4u/
-------------------------------------------------------------------------------
g4u> _

You are now at the g4u command prompt.

If you do not end up at the g4u command prompt, you should double check the hardware and the BIOS settings. Please refer to section 3.1 Preparing the hardware above for more information. It can also be that your g4u boot floppy has worn out. In that case you could create another one, using the procedure in section 2. Making preparations above.

3.3 Retrieving the MAC-address

After booting the computer with the boot floppy or the bootable CD-ROM you eventually arrive at the g4u prompt. You can display the MAC-address of the computer by issuing the command 'ifconfig' as illustrated below. Your input is emphasised. Remember to press [Enter] after typing the command.

g4u> ifconfig ex0
ex0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
	enabled=0
	address: 00:b0:80:9b:ac:f6
	media: Ethernet autoselect (100baseTX full-duplex)
	status: active
	inet 172.17.2.240 netmask 0xffffff00 broadcast 172.17.2.255

The command ifconfig is the command to configure network interfaces and ex0 is the first interface. Issuing the command without any options but the name of the interface displays the actual settings of that interface.

The fourth line of the output shows the MAC-address. Here the address is 00:b0:80:9b:ac:f6. Note that the address is case insensitive and often written in capitals to improve readability. A handwritten lowercase letter 'A' may resemble the digit '0'. On the other hand: an uppercase letter 'D' may also resemble the digit '0'. A common trick is to always write the digit '0' as a 'slashed zero' (something like 'Ø').

Also note that the computer automatically has received IP-address 172.17.2.240. This is the first address from the dynamic pool of addresses as assigned by the DHCP server. (Actually the last, but dhcpd works from top to bottom).

You now should take the following steps.

At this point you can simply switch off this computer and proceed with the next one.

3.4 Assigning a fixed IP-address

After you have visited all workstations in the school and dutyfully collected all the MAC-addresses, you are ready to process the information from the list. You should take the following steps.

At this point all MAC-addresses should be linked to a fixed IP-address from the static pool. You can check this by (re)booting a computer (say computer 22) and issuing the command ifconfig ex0 at the g4u prompt. The output should now show IP-address 172.17.2.22 instead of 172.17.2.240.

3.5 Hints and tips

It is also possible to retrieve the MAC-address using Windows. If the workstation already has been used with Windows before, you could use the following procedure.
  1. Boot the workstation with the Windows-version that was already installed.
  2. Navigate to: Start | Run. The Run window opens.
  3. In the 'Open' field type: WINIPCFG /ALL
  4. Press the button [OK].
  5. The IP-Configuration window opens. Several items are shown.
  6. (optional) Make sure you select the correct adapter if your computer has more than one adapter, e.g. due to a modem.
  7. Look for the item 'Adapter Address' and note the hexadecimal value.
  8. Write down this hexadecimal value (the MAC address) on the list and check for typos.
  9. Close the IP-Configuration window.
  10. Shut down the computer.
Note however that this procedure will not tell you if the boot sequence is properly configured and if the g4u floppy (or CD-ROM) actually works on this computer.

A tip for the advanced user: you can collect MAC-addresses on the server by uploading the output of ifconfig from the client computer to a file. Name the file after the workstation, e.g. 'c22'. Afterwards you can use your skills at the server commandline to create a list of computer names and MAC-addresses, without having to fear typing errors. It goes something like this.

g4u> ifconfig ex0 >c22
g4u> ftp install@172.17.2.1
Connected to 172.17.2.1.
220 OpenNA Linux FTP server ready.
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put c22
local: c22 remote: c22
227 Entering Passice Mode (172,17,2,1,227,73)
150 Ok to send data.
100% |*************************************|   286      1.02 MB/s    00:00 ETA
226 File receive OK.
286 bytes sent in 00:00 (97.48 KB/s)
ftp> bye
g4u> _

Afterwards the commands cd /var/lib/g4u and grep -H address c* will give you a list of lines like

c22:    address: 00:b0:80:9b:ac:f6

which can be converted into the two-lines-per-workstation format relatively easy, using search-and-replace. The great advantage is that you have the MAC-addresses in electronic form with no chance of read errors (distinguishing the handwritten 'a' and 'D' and '0'). And what is more, you have proven, beyond reasonable doubt, that the network connection of the workstation actually works. The bad news is that you have to retype the command ifconfig and the password of the install account over and over again. Also, you still have to manually enter the location of the workstation as a comment. The choice is yours.

NOTICE: On a properly configured ServerAtSchool network, you can use a symbolic name to refer to the server instead of a difficult to type dotted-decimal address. Simply use the name server instead of 172.17.2.1, e.g. ftp install@server.

(top)

4. Restoring an image on a workstation

If this is a new workstation, please start with the instructions in section 3. Before restoring an image on a new workstation if you have not done so already.

An image can be restored on a workstation by taking the following steps.

These steps are all disscussed below. Section 4.5. Hints and tips provides you with a few suggestions to improve efficiency of the whole process.

4.1 Booting the computer with g4u

If you want to boot the computer with g4u, you should take the following steps.

At this point the computer should boot from the diskette or the CD-ROM. The monitor will show a long list of messages scrolling by. Eventually you see the following screen.

-------------------------------------------------------------------------------
 Welcome to g4u Harddisk Image Cloning V1.17!

Commands:
  * Upload disk-image to FTP:   [GZIP=1] uploaddisk serverIP [image] [disk]
  * Upload partition to FTP:    [GZIP=1] uploadpart serverIP [image] [disk+part]
  * Install harddisk from FTP:           slurpdisk  serverIP [image] [disk]
  * Install partition from FTP:          slurppart  serverIP [image] [disk+part]
  * Copy disks locally:                  copydisk disk0 disk1
  * List all disks:                      disks
  * List partitions:                     parts disk
  * See all devices:                     dmesg
  * This screen:                         help

 [disk] defaults to wd0 for first IDE disk, [disk+part] defaults to wd0d for
 the whole first IDE disk. Use wd1 for second IDE disk, sd0 for first SCSI
 disk, etc. Default image for slurpdisk is 'rwd0d.gz'.  

 Enjoy!                                       Send comments to hubert@feyrer.de
                                              Donate at paypal@feyrer.de !
                                              http://www.feyrer.de/g4u/
-------------------------------------------------------------------------------
g4u> _

You are now at the g4u command prompt.

NOTICE: If you do not see this screen eventually, you should consult you local systems administrator. There might be something wrong with the workstation hardware or the configuration settings. It is not necessarily your job to fix this.

4.2 Using the slurpdisk command

If you want to restore an image you have to know two things.

If you do not know these things you should ask your local systems administrator or your ICT coordinator to enlighten you. If you wish, you can lookup the names of existing images on the server using the procedure discussed in section 4.5.1 Names of images below. Note that you still need the password for the 'install' account, even if you only want to lookup the names of the images.

After booting the computer with the boot floppy or the bootable CD-ROM you eventually arrive at the g4u prompt. You should now take the following steps.

  1. (optional) At this point you can safely remove the g4u diskette from the diskette drive. All necessary software is now loaded from the diskette and the diskette no longer needs to be in the drive.
  2. At the g4u> prompt, type the slurpdisk command, followed by two parameters: followed by [Enter]. The complete commandline looks like this.
    slurpdisk 172.17.2.1 dell_800_9.tgz
  3. At the Password: prompt, enter the password for the 'install' account. The password you type will not be visible on the screen. Press the [Enter] key after you have typed the password.
  4. At the bottom of the screen you see an indication that data is being transferred, from the server to the workstation, e.g. 123 MB     2.21 MB/s. The ascending MB number shows the number of megabytes already downloaded to the workstation. The MB/s number shows the download speed in megabytes per second.
  5. When the download process is finished, you see the g4u prompt again. Note that this download process can quite take some time. This depends on the the size of the image and speed of your network.
  6. The image is now downloaded to the workstation.

Here is an illustration of the whole process. Your input is emphasised.

g4u> slurpdisk 172.17.2.1 dell_800_9.tgz
Connected to 172.17.2.1.
220 OpenNA Linux FTP server ready.
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
local: | progress -z dd obs=1m of=/dev/rwd0d remote: dell_800_9.tgz
227 Entering Passive mode (172.17.2.1,227,4)
150 Opening BINARY mode data connection for dell_800_9.tgz (2489711629 bytes).
   4112 MB    5,69 MB/s gzip: invalid compressed data--length error
8247967+372732 records in
4126+1 records out
4327464960 bytes transferred in 724,934 secs (5969460  bytes/sec)
  4126 MB     5,69 MB/s
226 File send OK.
2489711629 bytes received in 12:04 (3,27 MB/s)
221 Goodbye.
g4u> _

NOTICE: Observe the gzip: invalid compressed data--length error error message. This means that the last block of the image was not a multiple of the block size. There is no need for alarm, though. The image should work fine.

At this point you must remove the diskette (or the CD-ROM) if you have not done so before.

NOTICE: You can remove the diskette as soon as the download process is underway. This means that you can start two or more downloads simultaneously, using the same diskette. You simply move to the next workstation as soon as you have one working on downloading an image. Depending on the network and the speed of the server you can restore a number of workstations in almost the same time as it takes to restore a single workstation. This effect is very noticable with workstations with a 10/100 Mbps network interface connected to the server via a switch with a 1000 Mbps connection to the server (see section 2.4 Network interfaces in chapter II. Preparing the hardware for installation of the ServerAtSchool Installation Guide.

NOTICE: On a properly configured ServerAtSchool network, you can use a symbolic name to refer to the server instead of a difficult to type dotted-decimal address. Simply use the name server instead of 172.17.2.1, e.g. slurpdisk server dell_800_9.tgz.

4.3 Setting the workstation name

At this point the new image on the workstation is an exact 'mirror' or 'clone' of the original workstation. It means that if the original image was created on workstation 'C21' and you just restored the image on workstation number '22', the workstation will still have the Windows Networking name 'C21'. Also the default printer will be the same as the default printer on the original workstation. In this section we will take care of the computer name. The next section deals with the default printer.

NOTICE: It is important to set the correct computer name. Windows Networking might get confused and stop working if two or more workstations with the exact same name (say 'C21') are present on the network.

You should take the following steps to set the name of the workstation.

  1. If necessary, remove the g4u diskette (or CD-ROM).
  2. Reboot or start the workstation. You can use the reset-button or simply switch the computer off and on again. Note that [Ctrl-Alt-Del] does not work in g4u.
  3. After some time you see the 'Enter Network Password' dialogue.
  4. Do not log in! Press the [Esc] key or press the [Cancel] button. Eventually the workstation will be ready for you.
  5. Navigate to: Start | Settings | Control Panel | Network | Identification. See the remark below if you find you are not allowed to navigate to this dialogue.
  6. The field 'Computer name' will containt the name of the original workstation, say 'C21'.
  7. Change the computer name into the name that corresponds to the number of the workstation you are working on, say 'C22'.
  8. Press the [OK] button to confirm the dialogue.
  9. You are now being asked if you want to restart the workstation for the changes to take affect. You have two options here.
  10. If you opted to press the [Yes] button, the workstation will reboot and subsequently be ready for use. If you opted to press the [No] button, you should continue with the procedure in section 4.4 Seting the default printer below.

If access to the dialogue where you can change the computer name is denied (as a security measure) after you pressed [Cancel] or [Esc], you have no other option than to logon to the network the proper way, using your own account and your own password. At that point the machine with number '22' will announce its presence on the network but it will use the name 'C21', the same as your original image machine. The best way to deal with this is to switch off the original 'C21' before you reboot machine '22'. You can then set the correct name (C22) and reboot once again. This way there will never be two machines with the same name at the same time on the network.

NOTICE: If you restore images to a batch of machines at the same time you may experience a little weird behaviour when Windows Networking gets confused about that funny machine 'C21' that keeps logging in, each time using another IP-address. Eventually this confusion will fade away, after a time out of somewhere between 30 minutes and 1 hour. This effect is due to the caching of computer names on the server. Do not worry about it. Tomorrow everything will be better.

4.4 Setting the default printer

Maybe the default printer does not have to be changed at all. This happens if the school has one (central) printer. If there are more printers, chances are that at least on some workstations the default printer has to be changed.

For instance, at the Exemplum Primary School almost every workstation will be printing on 'Printer Central' by default. Only the workstation in the Faculty Office and the workstations of the headmaster and the headmisstress have a different default printer: 'Printer Faculty'. For these workstations the default printer has to be adjusted. This procedure is described below.

NOTICE: This assumes that you did not reboot the workstation in the previous section by pressing the [Yes] button at the end of the procedure there. If you did reboot the workstation you need to go through the 'Windows Network Logon' dialogue again.

Proceed as follows to set the default printer:

  1. Navigate to: Start | Settings | Printers.
  2. Select the desired default printer for this workstation, e.g. 'Printer Faculty'.
  3. With your right mouse button, click on the icon of the desired printer. A dropdown menu opens.
  4. Choose: 'Set as Default' by selecting this option from the menu.
  5. The dropdown menu closes, but the option will have a mark. Make sure that your choice is properly remembered by right clicking the printer again and looking for the now checked option. Close the menu by clicking the mouse somewhere outside the menu. The menu will disappear.
  6. A little black checkmark will be added to the printer icon, too. This further indicates that this printer is in fact now the default printer.

At this point you should reboot the workstation. After it is rebooted again, it is ready for use.

4.5 Hints and tips

This section contains a few tips that can make restoring images more efficient.

4.5.1 Names of images

You want to restore an image but you forgot the image name. Which images do you have on the server? Which one do you want to download? You can find out by logging in on the server with FTP (File Transfer Protocol) from the g4u prompt and simply listing the available image names.

If you want to find out the names of the available images you should take the following steps.

  1. If necessary, boot the workstation with g4u as decribed in section 4.1 Booting the computer with g4u above.
  2. At the g4u> prompt type the following text.
    ftp install@172.17.2.1
    Execute the command by pressing [Enter].
  3. At the Password: prompt type the password for the 'install' account and press [Enter]. If you do not know the password, ask you local systems administrator or ICT coordinator to enlighten you. Note that the password will not be shown on the screen.
  4. The computer will be connected to the FTP server.
  5. At the ftp> prompt type the command
    ls
    and once again hit the [Enter] key.
  6. A listing of all available images will be displayed on the screen. Remember the name of the image you want to restore.
  7. Close the connection to the FTP server by typing the command
    bye
    followed by [Enter]. You are back at the g4u> prompt again.
  8. You can now proceed with restoring the image as per the instructions in section 4.2 Using the slurpdisk command.

Here is an illustration of the whole process. Your input is emphasised.

g4u> ftp install@172.17.2.1
Connected to 172.17.2.1.
220 OpenNA Linux FTP server ready.
Name: (172.17.2.1:root): install
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (172,17,2,1,228,246)
150 Here comes the directory listing:
-rw-r--r--    1 ftp      ftp      1664612590 Aug  9 11:13 dell_800_1.tgz
-rw-r--r--    1 ftp      ftp      2068415993 Aug 14 16:49 dell_800_6.tgz
-rw-r--r--    1 ftp      ftp      2489711629 Aug 17 14:15 dell_800_9.tgz
226 Directory read OK.
ftp> bye
221 Goodbye.
g4u> _

NOTICE: If you do not specify the correct username as part of the initial command (the word install in ftp install@172.17.2.1) you will be prompted for the username.

NOTICE: If there are not too many images, the names of the images will not yet have scrolled off the screen after you said bye to FTP. In that case you do not have to write down the exact name of the image of interest; you can simply read if on screen.

NOTICE: The names of these images are case sensitive. Please make sure that you type the exact name, including the extension .tgz when applicable.

NOTICE: On a properly configured ServerAtSchool network, you can use a symbolic name to refer to the server instead of a difficult to type dotted-decimal address. Simply use the name server instead of 172.17.2.1, e.g. ftp install@server.

4.5.2 More g4u diskettes

When you have to restore a lot of images, for example because you have installed a new program on the image, it saves time to have more than one g4u diskette. Please refer to section 2. Making preparations for more information about creating a g4u boot diskette.

You can gain some efficiency by booting a batch of workstations one by one, using the same g4u boot diskette. This is possible because the diskette can be removed from the workstation as soon as the g4u prompt appears.

When you start this mass restore job on Friday aafternoon, you have a lot of confguring to do on Monday morning. Good luck (and have a nice weekend)!

(top)

5. Creating an image of a workstation

Before you can restore a disk-image you first have to create one. An image of a workstation can be created by taking the following steps.

The latter two steps are disscussed below. Section 5.3. Hints and tips provides you with a few suggestions to improve efficiency of the whole process.

5.1 Booting the computer with g4u

If you want to boot the computer with g4u, you should take the following steps.

At this point the computer should boot from the diskette or the CD-ROM. The monitor will show a long list of messages scrolling by. Eventually you see the following screen.

-------------------------------------------------------------------------------
 Welcome to g4u Harddisk Image Cloning V1.17!

Commands:
  * Upload disk-image to FTP:   [GZIP=1] uploaddisk serverIP [image] [disk]
  * Upload partition to FTP:    [GZIP=1] uploadpart serverIP [image] [disk+part]
  * Install harddisk from FTP:           slurpdisk  serverIP [image] [disk]
  * Install partition from FTP:          slurppart  serverIP [image] [disk+part]
  * Copy disks locally:                  copydisk disk0 disk1
  * List all disks:                      disks
  * List partitions:                     parts disk
  * See all devices:                     dmesg
  * This screen:                         help

 [disk] defaults to wd0 for first IDE disk, [disk+part] defaults to wd0d for
 the whole first IDE disk. Use wd1 for second IDE disk, sd0 for first SCSI
 disk, etc. Default image for slurpdisk is 'rwd0d.gz'.  

 Enjoy!                                       Send comments to hubert@feyrer.de
                                              Donate at paypal@feyrer.de !
                                              http://www.feyrer.de/g4u/
-------------------------------------------------------------------------------
g4u> _

You are now at the g4u command prompt.

NOTICE: If you do not see this screen eventually, you should consult you local systems administrator. There might be something wrong with the workstation hardware or the configuration settings. It is not necessarily your job to fix this.

5.2 Using the uploaddisk command

If you want to create an image you have to know two things.

If you do not know these things you should ask your local systems administrator or your ICT coordinator to enlighten you. If you wish, you can lookup the names of existing images on the server using the procedure discussed in section 4.5.1 Names of images . Note that you still need the password for the 'install' account, even if you only want to lookup the names of existing images.

It is a good idea to choose a name as descriptive as possible. The Exemplum Primary School owns a batch of Dell OptiPlex 110 computers with an 800 MHz CPU. Therefore the names of the images all look like dell_800_N.tgz. Think of this name as 'brand', 'model' and 'image sequence number', separated with underscores. As soon as the school invests in new(er) computers, the images of those computers can easily be distinguished from the existing ones if those were to be called ibm_netvista_N.tgz or asus_px800_N.tgz. The choice is yours.

NOTICE: You should not use spaces as part of the image name because it will not work. Stick to underscores instead. Letters, digits, dots, dashes, underscores are OK in image names.

NOTICE: The extension .tgz indicates that these files are tarred (jargon for 'tape archived') and gzipped (jargon for 'GNU compressed') files. The tar.gz or .tgz process is comparable with zipping. You do not have to add this extension to the filenames, it is simply a matter of taste and perhaps a little of adhering to conventions too.

NOTICE: It is a good idea to write down the names of the images somewhere in a logfile or even in a paper notebook. This may make it even easier to 'know' which image is which. It is hard to remember the details of a particular image after a few months. Therefore deciding which of the images to download can be a challenge, even when you have named the images in a very systematic way.

After booting the computer with the boot floppy or the bootable CD-ROM you eventually arrive at the g4u prompt. You should now take the following steps.

  1. (optional) At this point you can safely remove the g4u diskette from the diskette drive. All necessary software is now loaded from the diskette and the diskette no longer needs to be in the drive.
  2. At the g4u> prompt, type the uploaddisk command, followed by two parameters: followed by [Enter]. The complete commandline looks like this.
    uploaddisk 172.17.2.1 dell_800_10.tgz
  3. At the Password: prompt, enter the password for the 'install' account. The password you type will be visible on the screen. Press the [Enter] key after you have typed the password.
  4. The screen is cleared (wiping out the password that was still visible) and a few messages are displayed. At the bottom of the screen you see an indication that data is being transferred, from the workstation to the server, e.g. 287 MB     1.83 MB/s. The ascending MB number shows the number of megabytes already uploaded to the server. The MB/s number shows the download speed in megabytes per second.
  5. When the upload process is finished, you see the g4u prompt again. Note that this upload process can quite take some time. It takes longer than the corresponding download process. The speed depends on the the size of the disk and speed of your network.
  6. The image is now uploaded to the server.

Here is an illustration of the whole process. Your input is emphasised.

g4u> uploaddisk 172.17.2.1 dell_800_10.tgz
Enter password for install@172.17.2.1: cooT9joo

Welcome to g4u, starting upload of wd0 now...

     0       0,00 KB/s Connected to 172.17.2.1.
220 OpenNA Linux FTP server ready.
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
remote: dell_800_10.tgz
227 Entering Passive mode (172,17,2,1,215,219)
150 Ok to send data.
   4126 MB   2,09 MB/s 4126+1 records in
4126+1 records out
4327464960 bytes transferred in 1966,091 secs (2201050  bytes/sec)
0+1564869 records in
0+1564869 records out
4327464960 bytes transferred in 1966,126 secs (2201011 bytes/sec)
226 File receive OK.
22490203537 bytes sent in 32:46 (1.20 MB/s)
221 Goodbye.
  4126 MB    2,09 MB/s
g4u> _

At this point you have successfully uploaded an image to the server.

NOTICE: On a properly configured ServerAtSchool network, you can use a symbolic name to refer to the server instead of a difficult to type dotted-decimal address. Simply use the name server instead of 172.17.2.1, e.g. uploaddisk server dell_800_10.tgz.

5.3 Hints and tips

This section contains a few tips that can make creating and sometimes restoring images more efficient.

5.3.1 Preventing contaminated images

After working with the workstations for some time, the need for an updated image can arise. Perhaps you want to install new educational software, a new version of the Firefox web browser is available, or you feel that you should patch the workstations with Windows Update. In all those cases you need to create a new image. The best way to do this is to start with a downlaod of your latest 'golden' image.

The reason for doing this is that the workstation where you want to install new software can be contaminated during its usage over time. The caches may be filled with lots of sites, maybe someone downloaded some undesired software from the Internet, etcetera. So it is vital to start with a clean image before upgrading it.

Suppose your latest 'golden image' was created on computer 'C21'. Then it would be wise to use that particular workstation to install the new or updated software. If you would use workstation 'C34' instead, you would have to change the name of the workstation from 'C21' to 'C34' first, in order to prevent name clashes with the 'real' workstation 'C21'. That is extra work and not necessary.

If you want to retain a clean uncontaminated image, you should take the following steps.

  1. Find out the name of the latest 'golden image', maybe by looking up the name using the procedure outlined in section 4.5.1 Names of images.
  2. Boot the workstation with g4u as per the procedure outlined in section 4.1 Booting the computer with g4u.
  3. Download your current 'golden image' using the procedure discussed in section 4.2 Using the slurpdisk command. Now you can be absolutely sure you do not use the contaminations that might have been on the workstation you are working on. In a way you are making a fresh start, going back to the point when you created this 'golden image'.
  4. Now you can make the necessary changes, install software, etcetera. Please check if everything is working as it should be by using the ckecklist in section 5.1 Checking the installation in chapter V. Installing educational software.
  5. Do not forget to update your CONTENTS.TXT file in which you meticulously document the changes you have made to the workstation installation. Add dates and other details. You tend to forget what you have done over time.
  6. Shut down the workstation. Check that the computer shuts down correctly.
  7. Now you can proceed by uploading the new image; see section 5. Creating an image of a workstation.

5.3.2 Reducing the image size

Today's large harddisks of 20 to 80 gigabytes are way too large for a primary school workstation. The Exemplum Primary School uses disks of 4.3 GB which are not even half filled with data. One reason is that much software runs off the server. Another reason is that you might not need so much space for all your programs. you certainly do not need space on the workstation to store documents because these are all stored on the server. So, try to use small disks. The less data that needs to be uploaded to the server the faster it goes.

Another solution is to use a small partition and fill the remainder of the disks with zeros. This procedure is described in section 3.1 Scrubbing the disk in chapter IV. Workstation setup. You only need to do this once.

Yet another solution would be to use the uploadpart command in g4u rather than the uploaddisk command. The advantage is that the uploadpart command only looks at the contents of the designated partition (which could be say 4 GB). The remainder of the disk (say 80 - 4 = 76 GB) is never touched by this command, it does not have to be uploaded and does not have to be downloaded. That's a real time saver! However, the uploadpart command (and its companion slurppart) do not take the Master Boot Record into account. That means that if somehow this MBR is damaged, by a virus or because you had to replace a dead disk, you can not revive the workstation with just slurppart. Refer to http://www.feyrer.de/g4u for more information.

5.3.3 Keeping images

It makes sense not to throw away old shoes before you are sure your new ones fit. Do not delete old image(s)!

Here are some good reasons to keep at least a few older images.

(top)

Authors: Peter Fokker <peter (at) berestijn.nl> and Dirk Schouten <schoutdi (at) knoware.nl>
$Id: g4u.html,v 1.12 2006/03/30 13:07:56 peter Exp $