Imaging Engine (img: Command Line and Menu)

After booting a computer from an imaging device, use the img command at the Linux bash prompt to do any of the following:

The imaging engine is installed to the bin folder on the imaging boot device. If the imaging boot device is diskettes or a CD, the bin folder is actually archived in the root.tgz file, which is expanded during the imaging bootup process.

Because the imaging engine is a Linux application, the command syntax is case-sensitive. The overall syntax is:

img [mode]

where mode is any of the modes described in the sections below.

NOTE:  Each mode can be abbreviated to the first letter of its name. For example, img dump can be abbreviated img d.


Displaying the Menu for img Commands

To access a menu from which to perform all of these tasks, enter img with no parameters.


Help Mode

Use Help mode to get information about the img command if you don't have this documentation available.

To use the Help mode:

  1. Enter img to display a menu > select Help > a mode name.

    or

    Enter the following:

    img [help [mode]]

    where mode is the mode whose command syntax you want help with.

Example Explanation

img help

Displays a short description of each mode.

img help m

Displays information on how to use the make mode.

img help p

Displays information on how to use the partition mode.


Auto Mode

Use Auto mode to image the computer automatically, based on any applicable NDS policies and settings. The imaging engine runs in this mode if you let the imaging bootup process proceed without interruption, or if you type the command below at the Linux prompt.

To use the Auto mode:

  1. Enter img to display a menu > select Auto.

    or

    Enter the following:

    img auto

In this mode, the imaging engine queries the imaging server specified in the PROXYADDR environment variable for any work to do. The imaging server checks the relevant NDS policies and settings to determine what imaging tasks should be performed (if any), such as taking or laying down an image. It then instructs the imaging engine to perform those tasks. If any tasks involve storing or retrieving images on other imaging servers, the imaging server refers the imaging engine to those servers to complete those tasks. After the imaging engine has completed its work, it communicates the results to the original imaging server, and the results are logged on that server.

For information on configuring the NDS policies and settings that control what happens in this mode, see Setting Up Imaging Services in Workstation Imaging in Deployment.


Make Mode

Use the Make mode to take an image of the computer and store it in a specified location. Normally, all partitions on hard disks and other storage devices (such as Jaz* drives) are included in the image, but there are some exceptions noted below.

The image size will correspond roughly to the size of the data in the Windows partitions plus the entire size of any non-Windows partitions (such as NetWare partitions). Linux partitions and Compaq* configuration partitions are always excluded. The data from Windows partitions is stored in an intelligent, file-by-file format so you can customize it later using the Image Explorer (IMGEXP.EXE) utility. Non-Windows partitions are stored in a raw, bit-by-bit format that cannot be customized.

The syntax of this mode depends on whether you will store the image locally or on an imaging (proxy) server, as explained in the subsections below:


Make Locally

Use the Make Locally mode to take an image of the computer and store it in a partition on a local (writable) device, such as a hard disk or Jaz drive. For more information, see Setting Up Disconnected Imaging Operations in Setting Up Imaging Services in Workstation Imaging in Deployment.

To use the Make Locally mode:

  1. Enter img to display a menu > select Make an Image > Local Image. Select the partition to store the image in, or Local Linux File System to store the image in the local ZfD imaging (Linux) partition. Type the image path and filename. If you are using compression, select a compression option. (Optimize for Speed takes the least amount of time but creates the largest image file. Optimize for Space creates the smallest image file but may take a significant amount of time. Balanced is a compromise between compression time and image file size.) Specify any advanced parameters, such as xpartition. If you want, specify additional information in the Description (a description of the image), Machine Name (the computer on which the image is being stored), Author (the name of the person entering this information), and Comments (any additional comments) fields.

    or

    Enter the following:

    img makel[pNumber] [comp=comp level] filepath [xpartition]

Parameter Specifies

makel[pNumber]

The partition number (as displayed by img dump) of the local partition to store the image in. It must be a primary FAT16 or FAT32 partition. This partition is excluded from the image that's created.

If you omit the partition number from this parameter, the image is stored in the local ZfD imaging (Linux) partition.

[comp=comp level]

comp level is the amount of compression used when creating the image. Specify any number from 0-9. 0 means no compression. 1 is the same as Optimize for Speed and is used by default if you do not specify this parameter. 6 is the same as Balanced. 9 is the same as Optimize for Space. See the paragraph in Step 1 for more information.

filepath

The image filename, including a .zmg extension and the complete path from the root of the partition. The directories in the path must exist. If the file already exists, it will be overwritten.

xpartition

The partition number (as displayed by img dump) of a local partition to exclude from the image. You can repeat this parameter as needed to exclude multiple partitions.

If you omit this parameter, all partitions are included in the image except the one where the image will be stored.

Example Explanation

img makel8 /imgs/dellnt.zmg

Takes an image of all partitions except the one in slot 8 and saves the image to imgs/dellnt.zmg in the partition in slot 8. (Assumes slot 8 contains a primary FAT16 or FAT32 partition.)

img makel /imgs/dellnt.zmg

Takes an image of all partitions and saves it to imgs/dellnt.zmg in the ZfD imaging (Linux) partition. (Assumes the ZfD partition has been installed.)

img makel /imgs/dellnt.zmg x2 x3

Takes an image of all partitions except those in slots 2 and 3 and saves the image to imgs/dellnt.zmg in the ZfD imaging (Linux) partition. (Assumes the ZfD partition has been installed.)


Make on Proxy

Use the Make on Proxy mode to take an image of the computer and store it on an imaging (proxy) server. For more information, see Manually Taking an Image of a Workstation in Testing Basic Imaging Operations in Workstation Imaging in Getting Started.

To use the Make on Proxy mode:

  1. Enter img to display a menu > select Make an Image > Proxy Image. Type the IP address or DNS name of your imaging server. Type the UNC path and filename where the new image is to be stored on the imaging (proxy) server. If you are using compression, select a compression option. (Optimize for Speed takes the least amount of time but creates the largest image file. Optimize for Space creates the smallest image file but may take a significant amount of time. Balanced is a compromise between compression time and image file size.) Specify any advanced parameters, such as xpartition. If you want, specify additional information in the Description (a description of the image), Machine Name (the computer on which the image is being stored), Author (the name of the person entering this information), and Comments (any additional comments) fields.

    or

    Enter the following:

    img makep address [comp=comp level] filepath [xpartition]

Parameter Specifies

address

The IP address or DNS name of the imaging server to store the image on.

[comp=comp level]

comp level is the amount of compression used when creating the image. Specify any number from 0-9. 0 means no compression. 1 is the same as Optimize for Speed and is used by default if you do not specify this parameter. 6 is the same as Balanced. 9 is the same as Optimize for Space. See the paragraph in Step 1 for more information.

filepath

The image filename, including a .zmg extension and the complete path in UNC style. The directories in the path must exist. If the file already exists, the imaging server won't overwrite it unless you enable this behavior in the imaging server's policy in NDS. If no folders are specified in the path, the image is created at the root of the volume or drive where the ZfD imaging server software is installed.

IMPORTANT:  Because Linux doesn't recognize backslashes, you must use forward slashes in the UNC path or enclose the entire path in quotes.

xpartition

The partition number (as displayed by img dump) of a local partition to exclude from the image. You can repeat this parameter as needed to exclude multiple partitions.

If you omit this parameter, all partitions are included in the image.

Example Explanation

img makep 137.65.95.127 //xyz_server/sys/imgs/dellnt.zmg

Takes an image of all partitions and saves it to sys/imgs/dellnt.zmg on xyz_server. (Assumes 137.65.95.127 is the IP address of xyz_server.)

img makep img.xyz.com //xyz_server/sys/imgs/dellnt.zmg x2 x3

Takes an image of all partitions except those in slots 2 and 3 and saves the image to sys/imgs/dellnt.zmg on xyz_server. (Assumes img.xyz.com is the DNS name of xyz_server.)


Restore Mode

Use the Restore mode to retrieve an image from a specified location and lay it down on the computer.

Normally, if the image to be laid down is a base image (one created previously by the imaging engine), all existing partitions except Linux and Compaq configuration partitions are removed from all local writable devices (such as hard disks and Jaz drives) before the new image is laid down. When the image is laid down, the sizes of the original partitions from which the image was taken are preserved if possible. If there's insufficient space, the last partition is shrunk to fit unless this would result in data loss, in which case the imaging engine denies the requested operation. If there's extra space left after all partitions in the image have been restored to their original sizes, that space is left unpartitioned.

If the image to be laid down is an add-on image (one produced from an Application object or created by the Image Explorer (IMGEXP.EXE) utility), or if it's a base image and you specify the apartition:ppartition parameter, none of the existing physical partitions are removed. Instead, the appropriate partitions are merely updated with the files from the image. The update process does not remove any existing files or overwrite any existing files of the same names if they are newer.

The syntax of this mode depends on whether you will retrieve the image from a local device or from an imaging (proxy) server, as explained in the subsections below:


Restore from Local

Use the Restore from Local mode to retrieve an image from a local device and lay it down on the computer. For more information, see Setting Up Disconnected Imaging Operations in Setting Up Imaging Services in Workstation Imaging in Deployment.

To use the Restore from Local mode:

  1. Enter img to display a menu > select Restore an Image > Local Image. Select Local Linux File System if the image is stored in the local ZfD imaging (Linux) partition, or select the partition where the image is stored. Type the image path and filename. Specify any advanced parameters, such as sfileset or apartition:ppartition.

    or

    Enter the following:

    img restorel[pNumber] filepath [sfileset] [apartition:ppartition]

    Parameter Specifies

    restorel[pNumber]

    The partition number (as displayed by img dump) of the local partition to retrieve the image from. It must be a primary FAT16 or FAT32 partition. This partition will not be changed by the imaging operation.

    If you omit the partition number from this parameter, the image is retrieved from the local ZfD imaging (Linux) partition.

    filepath

    The filename of the image to retrieve, including the .zmg extension and the complete path from the root of the partition.

    sfileset

    The number of the image fileset (variant) to lay down. Valid values are 1 through 10. For information on creating variants of an image, see Preparing Images .

    If you omit this parameter, fileset 1 is used.

    apartition:ppartition

    A mapping between a partition in the image archive (apartition) and a target physical partition on the local machine (ppartition). Use this parameter to selectively restore a specific part of the image to a specific local partition.

    IMPORTANT:  If you use this parameter, none of the existing local partitions are removed, and only the target local partition is updated. The update process does not remove any existing files or overwrite any existing files of the same names if they are newer. If you want to remove all existing files from the target partition before updating it, first use img pd and img pc to delete and recreate the partition.

    For apartition, use the partition number displayed for the source partition in the Image Explorer (IMGEXP.EXE) utility. For ppartition, use the partition number displayed by img dump for the target partition. The target partition must be a Windows partition. You can repeat this parameter as needed to request multiple selective restorations in a single operation. In doing so, you can apply multiple parts of the image to a single local partition, but you can't apply the same part of an image to multiple local partitions in a single operation.

Example Explanation

img restorel8 /imgs/dellnt.zmg

Removes all existing local partitions except the one in slot 8, retrieves the image from imgs/dellnt.zmg in slot 8, and lays down the partitions and contents of that image on the available local writable devices. (Assumes there's sufficient local space and that slot 8 contains a primary FAT16 or FAT32 partition.)

img restorel /imgs/dellnt.zmg

Removes all existing local partitions, retrieves the image from imgs/dellnt.zmg in the ZfD imaging (Linux) partition, and lays down the partitions and contents of that image on the available local writable devices (assuming there's sufficient space).

img restorel /imgs/dellnt.zmg s2

Removes all existing local partitions, retrieves the image from imgs/dellnt.zmg in the ZfD imaging (Linux) partition, and lays down the partitions and contents of variant 2 of that image on the available local writable devices (assuming there's sufficient space).

img restorel /imgs/dellnt.zmg a2:p1 a3:p1

Retrieves the image from imgs/dellnt.zmg in the ZfD imaging (Linux) partition, updates local partition 1 with the data from partitions 2 and 3 of that image, and leaves the other local partitions unchanged. (Assumes there's sufficient space in local partition 1.)


Restore from Proxy

Use the Restore from Proxy mode to retrieve an image from an imaging (proxy) server and lay it down on the computer. For more information, see Manually Putting an Image on a Workstation in Testing Basic Imaging Operations in Workstation Imaging in Getting Started.

To use the Restore from Proxy mode:

  1. Enter img to display a menu > select Restore an Image > Proxy Image. Type the IP address or DNS name of the imaging (proxy) server. Type the UNC path and filename where the image is to be retrieved from. Specify any advanced parameters, such as sfileset or apartition:ppartition.

    or

    Enter the following:

    img restorep address filepath [sfileset] [apartition:ppartition]

    Parameter Specifies

    address

    The IP address or DNS name of the imaging server to retrieve the image from.

    filepath

    The filename of the image to retrieve, including the .zmg extension and the complete path in UNC style.

    IMPORTANT:  Because Linux doesn't recognize backslashes, you must use forward slashes in the UNC path or enclose the entire path in quotes.

    sfileset

    The number of the image fileset (variant) to lay down. Valid values are 1 through 10. For information on creating variants of an image, see Preparing Images .

    If you omit this parameter, fileset 1 is used.

    apartition:ppartition

    A mapping between a partition in the image archive (apartition) and a target physical partition on the local machine (ppartition). Use this parameter to selectively restore a specific part of the image to a specific local partition.

    IMPORTANT:  If you use this parameter, none of the existing local partitions are removed, and only the target local partition is updated. The update process does not remove any existing files or overwrite any existing files of the same names if they are newer. If you want to remove all existing files from the target partition before updating it, first use the Partition Mode to delete and recreate the partition.

    For apartition, use the partition number displayed for the source partition in the Image Explorer (IMGEXP.EXE) utility. For ppartition, use the partition number displayed by img dump for the target partition. The target partition must be a Windows partition. You can repeat this parameter as needed to request multiple selective restorations in a single operation. In doing so, you can apply multiple parts of the image to a single local partition, but you can't apply the same part of an image to multiple local partitions in a single operation.

Example Explanation

img restorep 137.65.95.127 //xyz_server/sys/imgs/dellnt.zmg

Removes all existing local partitions, retrieves the image from sys/imgs/dellnt.zmg on xyz_server, and lays down the partitions and contents of that image on the available local writable devices. (Assumes there's sufficient local space and that 137.65.95.127 is the IP address of xyz_server.)

img restorep img.xyz.com //xyz_server/sys/imgs/dellnt.zmg s2

Removes all existing local partitions, retrieves the image from sys/imgs/dellnt.zmg on xyz_server, and lays down the partitions and contents of variant 2 of that image on the available local writable devices. (Assumes there's sufficient local space and that img.xyz.com is the DNS name of xyz_server.)

img restorep img.xyz.com //xyz_server/sys/imgs/dellnt.zmg a2:p1

Retrieves the image from sys/imgs/dellnt.zmg on xyz_server, updates local partition 1 with the data from partition 2 of that image, and leaves the other local partitions unchanged. (Assumes there's sufficient space in local partition 1 and that img.xyz.com is the DNS name of xyz_server.)


Dump Mode

Use the Dump mode to view information about the storage devices and partitions on the computer.

To use the Dump mode:

  1. Enter img to display a menu > select Dump > select No Geometry or Show Geometry.

    or

    Enter the following:

    img dump [geo]

Parameter Specifies to

dump

List the existing partitions on all local writable devices, such as hard disks and Jaz drives. For each partition, the type, size, and slot number of the partition are given.

NOTE:  Linux and Compaq configuration partitions are not listed.

geo

Display additional information about the geometry (cylinders, heads, and sectors) and capacity of each storage device, including read-only devices such as CD drives.

Example Explanation

img dump

Lists the current partitions on all local writable devices.

img dump geo

Lists all storage devices, their geometry and capacity, and the current partitions on the writable devices.


Partition Mode

Use the Partition mode to create, delete, or activate (make bootable) a partition on the computer.

To use the Partition mode:

  1. Enter img to display a menu > select Partition > select an operation. See the table below for more information.

    or

    Enter the following:

    img poperation

    where operation is one of the following:

Operation Specifies to

cpNumber type [size] [cluster=clusterSize]

Create a new partition, where:

  • pNumber is the number of the partition slot (as displayed by img dump) to create the partition in
  • type is FAT12, FAT16, FAT32, NTFS, or Extended

    If you are creating an extended partition, you can create a logical drive inside of the extended partition. See the next table for an example.

  • size is a valid size for the partition type in MB

    If you omit this parameter, the largest valid size for the partition type is used, given the available unpartitioned space on the drive.

  • clusterSize is the cluster size for an NTFS partition. This parameter is not valid for any other partition type.

    Don't use this parameter unless you have a specific reason to do so. It must be a power of 2 (2, 4, 8, 16, ...128). If you omit this parameter, the imaging engine uses a reasonable cluster size for the NTFS partition size.

The new partition is also formatted enough to be recognizable by other operating systems, but you must put a base image in the partition before Windows can store any files in it.

dpNumber

Delete the partition from slot number pNumber. Use img dump to get the slot number.

apNumber

Activate (make bootable) the partition in slot number pNumber. Use img dump to get the slot number.

Example Explanation

img pc1 fat16

Creates a FAT16 partition in slot 1 using all the available unpartitioned space on the drive.

img pc5 fat32 5671

Creates a FAT32 partition in slot 5 using 5,671 MB on the drive.

img pd3

Deletes the partition from slot 3.

img pa5

Activates (makes bootable) the partition in slot 5. (Assumes a partition exists in that slot.)

img pc2 extended 2500

img pc2 NTFS 2000 cluster=1

img pc2 fat16 500

Creates an extended partition with a 2000 NTFS logical drive and a 500 MB FAT16 logical drive.


ZENPartition Mode

Use the ZENPartition mode to enable, disable, or remove the installed ZfD imaging partition.

To use the ZENPartition mode:

  1. Enter img to display a menu > select ZENPartition > read the text that displays > select Continue > select an operation > OK.

    or

    Enter the following:

    img zenPartition operation

    where operation is enable, disable, or remove.

  2. Enter lilo.s to make this change effective.

IMPORTANT:  If you remove an installed ZfD imaging partition, you must immediately restore a base image with a valid non-LILO MBR (Master Boot Record). If you do not, the computer will not be able to boot properly.


Information Mode

Use the Information mode to view the following:

To use the Information mode:

  1. Enter img to display a menu > select Information > select All, Hardware, or ZISD. See the table below for details.

    or

    Enter the following:

    img info [zisd]

Parameter Specifies to

info

List the detected hardware devices on the computer, including:

  • CPU chipset
  • Video adapter
  • Network adapter
  • MAC address
  • Sound card
  • Hard drive controller
  • Hard disk capacity
  • RAM

zisd

List the data currently stored in the image-safe area on the computer. The items that comprise this data are listed in Imaging Agent (ZISWIN.EXE) .

In addition to the image-safe data, the last base image that was laid down on the computer is also listed.

Example Explanation

img info

Lists the detected hardware devices on the computer.

img info zisd

Lists the ZfD image-safe data currently stored on the computer and the last base image that was laid down.


Session (Multicast) Mode

Use the Session (Multicast) mode to take an image of one computer and lay it down on multiple other computers simultaneously over the network in a single operation without NDS or ZfD server involvement. For more information, see Multicasting Images .

For multicasting to work, each participating computer must boot from an imaging device and run the imaging engine in this mode, as explained below. The computer from which the image is taken is called the master, and the computers that receive the image are called participants.

NOTE:  For multicasting to work properly, the routers and switches on the network must have multicast features configured. Otherwise, multicast packets might not be routed properly.

To use the Session (Multicast) mode:

  1. Enter img to display a menu > select Multicast Session > select Master or Client. Fill in the Session Name, Number of Clients, and Timeout fields. See the table below for details.

    or

    Enter the following:

    img session name [master|client] [clients=count [t=minutes]]

    Parameter Specifies

    name

    The name of the multicast session. Each computer joining the session uses the same value for this parameter. You can specify any multicast session, including one that originates from the proxy server (as long as you specify the session name used by the proxy server).

    NOTE:  The name must be unique among concurrent multicast sessions. It is hashed by the imaging engine to produce a Class D (temporary) IP address for the multicast session. To facilitate troubleshooting (wire sniffing), all ZfD imaging multicast addresses start with 231. For example, the session name doug produces the multicast address 231.139.79.72.

    master|client

    That this computer is the session master or a session client.

    If you omit this parameter, the imaging engine waits for a user on one of the computers to press m to designate that computer as the master.

    clients=count

    The number of participating computers that must register with the master before imaging will begin. The option only applies for session masters.

    If you omit this parameter, the imaging engine waits for the master user to press g before starting the imaging process. Once imaging has begun, any participating computers attempting to register are denied.

    t=minutes

    The number of minutes the master computer will wait for the next participant to register before starting the imaging process without reaching count registered participants. The option only applies for session masters.

    If you omit this parameter, the imaging process won't start until count is reached or the master user presses g. After that, any participants attempting to register are denied.

Example Explanation

img session doug

Starts a multicast session named doug. Each successive computer that issues this same command before the imaging begins joins the session. Imaging doesn't start until one of the users presses m to designate himself as master and presses g to start the imaging.

img session doug m

Starts a multicast session named doug and designates this computer as the master. Each successive computer that issues img session doug before the imaging begins joins the session as a participant. Imaging doesn't start until the master user presses g.

img session doug c=5

Starts a multicast session named doug. Each successive computer that issues img session doug before the imaging begins joins the session. Imaging doesn't start until one of the users presses m to designate himself as master and five other computers register with the master as participants.

img session doug c=5 t=20

Starts a multicast session named doug. Each successive computer that issues img session doug before the imaging begins joins the session. Imaging doesn't start until one of the users presses m to designate himself as master and either five other computers register with the master as participants or more than 20 minutes elapses between any consecutive participant registrations, whichever occurs first.