E.4 Restore Mode

Use the -restore mode command to retrieve an image from a specified location and restore it to a device.

You can restore an image of a device by using either the imaging maintenance mode prompt or by using the ZENworks Imaging Engine menu. For step-by-step instructions, see Manually Taking an Image of a Device. You can also use the Restore mode command to restore an image from a partition on a local hard disk. For step-by-step instructions, see Section 3.1.3, Setting Up Disconnected Imaging Operations.

Normally, if the image to be restored is a base image (one created previously by the ZENworks Imaging Engine), all existing partitions except the ZENworks partition and Dell or Compaq configuration partitions are removed from all local hard disks before the new image is restored. When the image is restored, the sizes of the original partitions from which the image was taken are preserved, if possible. If there is insufficient space, the last partition is shrunk to fit, unless this would result in data loss, in which case the ZENworks Imaging Engine denies the requested operation. If there is 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 restored is an add-on image, 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, overwriting any existing file of the same name and location.

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:

NOTE:When you perform a partition-based restore with Windows 7 or a later version, you need to restore the Windows system partition as well. For an example on how the restore is performed with the Tuxera NTFS driver, see Section 3.14.3, Prerequisites for taking and restoring an image partition-wise.

E.4.1 Restore from Local

Use the -restore -local mode command to retrieve an image from a local device and restore it to the device. For more information, see Section 3.1.3, Setting Up Disconnected Imaging Operations.

To use the Help mode:

IMPORTANT:When you restore an image locally, using the Tuxera driver, use the following command to mount the partition on which the image is stored if the partition is NTFS:

# mount -t tntfs /dev/sdXn mount_dir

In this command, sdX is the device node and n stands for the partition number in the device.

Using the ZENworks Imaging Engine Menu to Restore an Image Locally

  1. To display the ZENworks Imaging Engine menu, enter:

    img
  2. Click Imaging > Restore Image.

    This displays the Restore Image Wizard.

  3. In the wizard, select Local, then click Next.

    The Restore Local Image Wizard is displayed.

  4. Fill in the fields:

    Path to Image Archive: Click Browse to select the image file, or specify its full path and filename, including the .zmg filename extension.

    File Set: The number of the image file set to be restored. Valid values are 1 through 10. File set 1 defaults. For information on file sets, see Section A.0, File Sets and Image Numbers.

    Options: Specify any advanced options. For more information, see Table E-6.

  5. Click Next to restore the image.

    The ZENworks Imaging Engine Menu displays a progress bar while restoring image.

  6. If the imaging process was successful, click OK in the Information dialog box, then click Close to return to a blank ZENworks Imaging Engine Menu display.

    If the imaging process was unsuccessful, determine and resolve the issue, then repeat these steps.

Using the Imaging Maintenance Mode Prompt to Restore an Image Locally

Using the imaging maintenance mode prompt, the following example explains the syntax and available parameters that you can use with the “restore from local” (-restorel) mode command:

img -restore -local local_filepath/filename.zmg [‑part=partition_number] [‑s=file_set] [‑ap=advanced_options]

where the [...] brackets indicate optional commands.

You can abbreviate -restore -local as: -r -local, -restorel, or -rl.

For more information, see:

Command Details

Table E-6 Restore Local Commands and Parameters

Parameter

Specifies

-restorel [‑part=partition_number]

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

local_filepath/filename.zmg

The filename of the image to retrieve, including the .zmg extension (case-sensitive) and the complete path from the root of the local partition.

‑s=fileset

The number of the image file set to be restored. Valid values are 1 through 10. For information on creating file sets of an image, see Section 1.6.2, Creating, Installing, and Restoring Standard Images.

If you omit this parameter, file set 1 is used.

‑ap=partition:partition

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; however, any existing files of the same names are overwritten. If you want to remove all existing files from the target partition before updating it, first use the Partition Operations Mode to delete and recreate the partition. If you choose to restore the base image, you need to delete and recreate the target partition before restoring the image because your system might be left in an inconsistent state if the Selective Partition Image restoration fails.

For apartition, use the partition number displayed for the source partition in the Image Explorer (zmgexp) utility. For ppartition, use the partition number displayed by img dump for the target partition. The target partition must be a partition of a supported file system. 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.

Examples

Table E-7 Restore Local Examples

Example

Explanation

img -restorel /myimages/myimage.zmg ‑part=8

Removes all existing local partitions except the one in slot 8, retrieves the image from myimages/myimage.zmg in slot 8, and restores the partitions and contents of that image on the available local writable devices (assuming there is sufficient local space and that slot 8 contains a partition).

img -restorel /myimages/myimage.zmg

Removes all existing local partitions, retrieves the image from myimages/myimage.zmg in the ZENworks partition, and restores the partitions and contents of that image on the available local writable devices (assuming there is sufficient space).

img -restorel /myimages/myimage.zmg ‑s=2

Removes all existing local partitions, retrieves the image from myimages/myimage.zmg in the ZENworks partition, and restores the partitions and contents of file set 2 of that image on the available local writable devices (assuming there is sufficient space).

img -rl image.zmg -ap=a3:p1 a4:p2

Retrieves the image from image.zmg in the ZENworks partition and updates local partition 1 with data from partition 3 and updates local partition 2 with data from partition 4 in the image.

Using the WinPE Mode Prompt to Restore an Image Locally

Using the WinPE mode prompt, the following example explains the syntax and available parameters that you can use with the “restore from local” (-restorel) mode command:

img -restore -local local_filepath/filename.zmg

You can abbreviate -restore -local as: -r -local, -restorel, or -rl.

For more information, see:

Command Details

Table E-8 Restore Local Commands and Parameters

Parameter

Specifies

local_filepat/filename.zmg

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

Examples

Table E-9 Restore Local Examples

Example

Explanation

img -restorel Q:/myimage.zmg

Removes all existing local partitions, retrieves the image from Q:(Drive mounted to share the folder path where the image is stored)/myimage.zmg, and restores the partitions and contents of that image on the available local writable devices (assuming there is sufficient local space).

NOTE:You can restore .zmg images that were taken using WinPE.

Using the WinPE Maintenance Mode Prompt to Restore an Image Locally

For more information, see the ZENworks WinPE Imaging section.

E.4.2 Restore from Proxy

Use the -restore -proxy mode command to retrieve an image from an imaging (proxy) server and restore it to the device. For more information, see Manually Restoring an Image on a Device.

To use the Help mode:

Using the ZENworks Imaging Engine Menu to Restore an Image from a Proxy

  1. To display the ZENworks Imaging Engine menu, enter:

    img
  2. Click Imaging > Restore Image.

    This displays the Restore Image Wizard.

  3. In the wizard, select Server, then click Next.

    The Restore Server Image Wizard is displayed.

  4. Fill in the fields:

    Server IP Address: Specify the IP address or DNS name of an Imaging Server where the image you need is stored. If you specified an Imaging Server in the settings.txt file when booting from the imaging CD, that Imaging Server’s IP address is the default; otherwise, the IP address for the Imaging Server specified in the settings.txt file for the PROXYADDR variable is displayed.

    Path to Image Archive: Specify the filename of the Image file to be restored, in the path to the image archive.

    File Set: The number of the image file set to be restored. Valid values are 1 through 10. File set 1 is the default. For information on file sets, see Section A.0, File Sets and Image Numbers.

    Options: Specify any advanced options. For more information, see Table E-10.

  5. Click Next to restore the image.

    The ZENworks Imaging Engine Menu displays a progress bar while restoring image.

  6. If the imaging process was successful, click OK in the Information dialog box, then click Close to return to a blank ZENworks Imaging Engine Menu display.

    If the imaging process was unsuccessful, determine and resolve the issue, then repeat these steps.

Using the Imaging Maintenance Mode Prompt to Restore an Image from a Proxy

At the imaging maintenance mode prompt, use the “restore from proxy” (-restorep) mode command to restore an image from a proxy.

  • To restore an image by specifying the image file path:

    img -restore -proxy added_filepath/filename.zmg -ip=IP_address [‑s=set] [‑ap=advanced_options]

    where the [...] brackets indicate optional commands.

  • To restore a Preboot bundle:

    Use any of the following to restore a Preboot bundle.

    1. img -restore -proxy bundle_name -ip=IP_address

      You can abbreviate -restore -proxy as: -r -proxy, -restorep, or -rp.

      This command, restores a bundle with bundle_name. If the bundle_name is not available, then the command looks for an image with bundle_name.zmg.

    2. img -restore -bundle bundle_name -ip=IP_address

      You can abbreviate -restore -bundle as: -r -bundle, -restoreb, or -rb.

      This command, restores a bundle with bundle_name. If the bundle is not available, then an error message is displayed.

For more information, see:

Command Details

Table E-10 Restore Proxy Mode Commands and Parameters

Parameter

Specifies

added_filepath/filename.zmg

The filename and added path of the image to retrieve, including the .zmg extension (case sensitive).

‑s=fileset

The number of the image file set to be restored. Valid values are 1 through 10. For information on creating file sets of an image, see Section 1.6.2, Creating, Installing, and Restoring Standard Images.

If you omit this parameter, file set 1 is used.

bundle_name

The name of the bundle to be applied.

‑ap=partition:partition

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 Operations Mode to delete and re-create the partition. If you choose to restore the base image, you need to delete and recreate the target partition before restoring the image because your system might be left in an inconsistent state if the Selective Partition Image restoration fails.

For apartition, use the partition number displayed for the source partition in the Image Explorer (zmgexp) utility. For ppartition, use the partition number displayed by img dump for the target partition. The target partition must be a partition of a supported file system. 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.

Examples

Table E-11 Restore Proxy Mode Examples

Example

Explanation

img ‑restorep subdir1/myimage.zmg

Removes all existing local partitions, retrieves the image from subdir1/myimage.zmg on the Imaging Server, and restores the partitions and contents of that image on the available local writable devices (assuming there is sufficient local space).

img ‑restorep subdir1/myimage.zmg ‑s=2

Removes all existing local partitions, retrieves the image from subdir1/myimage.zmg on the Imaging Server, and restores the partitions and contents of file set 2 of that image on the available local writable devices (assuming there is sufficient local space).

img ‑restorep subdir1/myimage.zmg ‑ap=a2:p1

Retrieves the image from subdir1/myimage.zmg on the Imaging Server, updates local partition 1 with the data from partition 2 of that image, and leaves the other local partitions unchanged (assuming there is sufficient space in local partition 1).

img -rp image.zmg -ap=a3:p1 a4:p2

Retrieves image.zmg from server and updates local partition 1 with data from partition 3 and updates local partition 2 with data from partition 4 in the image.

NOTE:In ZENworks, you only need to provide the image filename (the .zmg file) because the images are stored in a fixed location. For example, if you saved the image file in the default location, enter:

img -rp myimagefile.zmg

Because you can organize your images under the \images directory by adding subdirectories, the additional path where you created the image file should be provided. For example:

img -rp /windows/vista/myimagefile.zmg

Using the WinPE Maintenance Mode Prompt to Restore an Image from a Proxy

Following are the img bundle commands that are supported on the WinPE distro.

  • img –rb bundle-name -ip=<server_ip>

  • img –rp bundle-name –ip=<server_ip>

NOTE:

  • In the case of the img –rp command, if the bundle is not available in the server, the image will be found using the bundle name.

    This behavior is supported on Linux.

    Example: img -rp test -ip=<server_ip>

    In this example, the command searches for the test bundle in the imaging server, if the bundle is not available, then the command searches for the image ZMG in the server and restores the image.

  • In the case of a scripted image bundle, you can specify commands, to pull the image name or restore the image bundle.

Using the WINPE Maintenance Mode Prompt to Restore an Image from a Proxy

At the WINPE maintenance mode prompt, use the “restore from proxy” (-restore) mode command to restore an image from a proxy.

img -restore -proxy filename.zmg

You can abbreviate -restore -proxy as: -r -proxy, -restorep, or –rp

You can change the proxy address by using below command:

set PROXYADDR={ServerAddress}

Command Details:

Parameter

Description

img –rp filename.zmg

The image file name with .zmg extension should be used to restore the image to target machine.

NOTE:You can restore .zmg images that were taken using WinPE.

Example:

Example

Explanation

img -rp test.zmg

Restores the test.zmg image file to the target machine.