E.4 Restore Mode (img restore)

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

You can restore an image of a device using either the bash prompt or 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 to restore an image from a partition on a local hard disk. For step-by-step instructions, see Section 30.1.3, Setting Up Disconnected Imaging Operations.

Normally, if the image to be put down 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 put down. When the image is put down, 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 put down 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.

Restoring add-on images over 4 GB in size is not supported by Linux Management imaging.

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:

E.4.1 Restore from Local (img restorel)

Use the Restore from Local mode to retrieve an image from a local device and put it down on the device. For more information, see Section 30.1.3, Setting Up Disconnected Imaging Operations.

Using the bash prompt, the following example explains the syntax and available parameters that you can use with the restorel“restore from local” parameter:

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

Commands

Table E-5 restorel Commands

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 partition. This partition is not changed by the imaging operation.

If you omit the partition number from this parameter, the image is retrieved from the local ZENworks partition.

filepath

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

sfileset

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

If you omit this parameter, file set 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; 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 Mode (img part) 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 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-6 restorel Examples

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 puts down 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 primary partition).

img restorel /imgs/dellnt.zmg

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

img restorel /imgs/dellnt.zmg s2

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

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

Retrieves the image from imgs/dellnt.zmg in the ZENworks partition, updates local partition 1 with the data from partitions 2 and 3 of that image, and leaves the other local partitions unchanged (assuming there is sufficient space in local partition 1).

E.4.2 Restore from Proxy (img restorep)

Use the Restore from Proxy mode to retrieve an image from an imaging (proxy) server and put it down on the device. For more information, see Manually Putting an Image on a Device.

Using the bash prompt, the following example explains the syntax and available parameters that you can use with the restorep“restore from proxy” parameter:

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

Commands

Table E-7 restorep Commands

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 (case-sensitive) 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 file set to put down. Valid values are 1 through 10. For information on creating file sets of an image, see Section 28.5.2, Creating, Installing, and Restoring Standard Images.

If you omit this parameter, file set 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 (img part) 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 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-8 restorep Examples

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 puts down the partitions and contents of that image on the available local writable devices (assuming there is 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 puts down the partitions and contents of file set 2 of that image on the available local writable devices (assuming there is 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 (assuming there is sufficient space in local partition 1 and that img.xyz.com is the DNS name of xyz_server).