What are the Ghost switches available for -Clone?
search cancel

What are the Ghost switches available for -Clone?

book

Article ID: 151687

calendar_today

Updated On:

Products

Ghost Solution Suite Deployment Solution

Issue/Introduction

This document describes Ghost's -CLONE switch and the command-line parameters that are used as arguments for that switch.

Resolution

Ghost uses the -CLONE switch to specify the cloning operation that you want Ghost to perform.

Note that many additional switches can also be used while cloning. For a description of other Ghost switches, see the Ghost Implementation Guide that accompanied your copy of Ghost, or read the document Switches: Alphabetical list of switches.


-CLONE

The full syntax for this switch is:

-clone, MODE={copy|load|dump|pcopy|pload|pdump},
 SRC={drive|file|drive:partition|@MCsessionname|@MTx},
 DST={drive|file|drive:partition|@MCsessionname|@MTx},
 SZE{F|L|n={nnnnM|nnP|F|V} }

Note: In Symantec Ghost 8.0 and higher the following changes were made: Restore = Load, Create = Dump, Prestore = Pload, and Pcreate = Pdump.

Each -CLONE command can be used for only one imaging process at a time. For instance, you can use a single -CLONE command to restore one partition from an image file that has five partitions, but you cannot use a single -CLONE command to restore two partitions from an image file that has five partitions. To perform multiple imaging operations, use successive -CLONE commands on the same command line with the -BATCH command, or create a batch file that has multiple Ghost.exe or Ghostpe.exe command lines. For an example of the -BATCH command, see Example 14 in this document.


Note: For information on the clone switches for Norton Ghost 2003, refer to page 166 of the Norton Ghost 2003 User's Guide located on the CD or on your hard drive. The Norton Ghost 2003 User's Guide is automatically installed on your hard drive during the installation. The default location and file name for the Norton Ghost 2003 User's Guide is \Program Files\Symantec\Norton Ghost 2003\Ghost_Guide.pdf. Adobe Acrobat Reader must be installed to view the User's Guide. A copy of Adobe Acrobat Reader is included on the Norton Ghost 2003 CD or it can be downloaded from www.adobe.com.


MODE=COPY
Used to copy the contents of one hard drive to another.

 

 

,SRC=drive number Number of the source drive. For example, 1 for the first drive.
,DST=drive number Number of the destination drive.
For an internal drive: The drive number of the destination drive in the computer. For example, use 2 for the second internal drive.
For an LPT connection: The drive number of the drive in the slave computer. For example, use 1 for the first drive on the slave computer.
For a NetBIOS connection: The drive number of the drive in the slave computer. For example, use 1 for the first drive on the slave computer.
,SZE Set the size of the destination partitions. See explanation of SZE switch below.

 

 

MODE=LOAD or MODE=RESTORE
Used to copy the contents of an image file to a disk. This will copy all the partitions in the image file.


Note: The load switch is replaced by the restore switch in Symantec Ghost 8.x and higher. 


 

 

,SRC= or tape device For an internal drive: The path and filename of the image on the local drive. For example: C:\IMAGE.GHO.
For a tape drive: Use @MTx where x is the number of the SCSI device starting at 0 and incrementing for each device present.
For an LPT connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -LPM switch.
For a NetBIOS connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -NBM switch.
For Multicasting: The multicast session name using @Mcsessionname where sessionname is the name of the multicast session. For example, @MCsession1.
,DST=drive number The number of the destination drive. This refers to the internal drive on the computer. For example, use 2 for drive two.
,SZE Set the size of the destination partitions. See explanation of SZE switch below.

 

MODE=DUMP or MODE=CREATE
Used to create an image file of a disk. This copies all of the partitions to an image file.


Note: The dump switch is replaced by the create switch in Symantec Ghost 8.x and higher. 


 

 

,SRC=drive number Number of the source drive. For example, use 1 for drive one.
,DST= or tape device For an internal drive: The path and filename of the image on the local drive. For example: C:\IMAGE.GHO.
For a tape drive: Use @MTx where x is the number of the SCSI device starting at 0 and incrementing for each device present.
For an LPT connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -LPM switch.
For a NetBIOS connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -NBM switch.
For Multicasting: The multicast session name using @Mcsessionname where sessionname is the name of the multicast session. For example, @MCsession1.
For a CD-R or CD-RW drive: Use @CDx where x is the number of the CD/R or CD/RW device on the IDE or SCSI chain.

 

MODE=PCOPY
Used to duplicate a partition to another partition.

 

 

,SRC=source partition The Drive number:Partition number of source drive. For example: 1:2 refers to the second partition on the first drive.
,DST=destination partition The Drive number:Partition number of the destination drive.
For an internal drive: The drive number and partition number of the internal drive you are writing to. For example, use 2:1 to specify the first partition on the second drive.
For an LPT connection: The drive number and partition number of the drive on the slave computer. Number the drives as if they were connected locally. For example, use 1:3 to specify the third partition on the first drive on the slave computer. Must also use the -LPM switch.
For a NetBIOS connection: The drive number and partition number of the drive on the slave computer. Number the drives as if they were connected locally. For example, use 1:3 to specify the third partition on the first drive on the slave computer. Must also use -NBM switch.
For Multicasting: The multicast session name using @Mcsessionname where sessionname is the name of the multicast session. For example, @MCsession1.

 

 

MODE=PLOAD or MODE=PRESTORE
Used to copy a partition from an image file to a local drive.


Note: The pload switch is replaced by the prestore switch in Symantec Ghost 8.x and higher. The pload switch is still fully functional and is interchangeable with prestore.


 

,SRC= : or tape device For an internal drive: The path and file name of the image on the local drive followed by the partition number in the image. For example: C:\IMAGE.GHO:2
For a tape drive: @MTx where x is the number of the SCSI device starting at 0 and incrementing for each device present.
For an LPT connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -LPM switch.
For a NetBIOS connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -NBM switch.
For Multicasting: The multicast session name using @Mcsessionname where sessionname is the name of the multicast session. For example, @MCsession1.

NOTE: When the location of the image file is not a tape device, the SRC parameter requires the partition number even when the source image file has only one partition. That is, when the source image file contains more than one partition, use the partition number to specify which partition you want to write to the destination partition. When the source image contains only one partition, use the numeral 1.

All disk images contain at least one partition. For instance, when a computer has two physical hard drives, one labeled C and the other labeled D and E, the first drive is one partition and the second drive has two partitions. Similarly, a disk image of the first hard drive, C, contains one partition.

For example, when a disk image file contains only one partition and you want to write the disk image from a CD-ROM to the first partition of a two partition disk, use the following command line:

ghost.exe -clone,mode=pload,src=D:GHOSTIMAGE.GHO:1,dst=1:2
,DST=: The Drive number:Partition number of destination drive. For example: 1:2 refers to the second partition on the first drive.

MODE=PDUMP or MODE=PCREATE
Used to create an image file of a partition.


Note: The pdump switch is replaced by the pcreate switch in Symantec Ghost 8.x and higher. The pdump switch is still fully functional and is interchangeable with pcreate.


 

 

,SRC=source partition The Drive number:Partition number of source drive. For example: 1:2 refers to the second partition on the first drive.
,DST= or tape device For an internal drive: The path and filename of the image on the local drive. For example: C:\IMAGE.GHO.
For a tape drive: Use @MTx where x is the number of the SCSI device starting at 0 and incrementing for each device present.
For an LPT connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -LPM switch.
For a NetBIOS connection: The image file on the slave computer. For example: C:\IMAGE.GHO. Must also use -NBM switch.
For Multicasting: The multicast session name using @Mcsessionname where sessionname is the name of the multicast session. For example, @MCsession1.
For a CD/R or CD/RW drive: Use @CDx where x is the number of the CD/R or CD/RW device on the IDE or SCSI chain.

 

SZE switch
Used to set the size of the destination partitions for a disk load or disk copy operation. This switch is only effective with the LOAD and COPY modes. The SZE switch can be used more than once in the same command.

 

 

SZEE The size of all partitions remains fixed. That is, the size of the destination partition will not be different from the source drive.
SZEF Resizes the first partition to maximum size allowed based on file system type.
SZEL Resizes the last partition to maximum size allowed based on file system type. If additional space remains, other partition sizes will be increased.
SZEn=xxxxM Indicates that the nth destination partition is to have a size of xxxx MB. For example, SZE2=800M indicates that the second partition should be 800 MB.
SZEn=mmP Indicates that the nth destination partition is to have a size of mm percent of the target disk. For example, SZE2=40P indicates that the second partition is to be 40% of the total disk space on the target drive.
SZEn=F Indicates that the nth destination partition is to remain fixed in size. For example, SZE3=F indicates that the third partition size is unchanged on the target drive.
SZEn=V Indicates that the nth partition will be resized according to the following rules:
Rule 1: If the destination disk is larger than the original source disk, then the partitions will be expanded to have the maximum amount of space subject to the free space available and the partition type. For instance, FAT16 partitions will have a maximum size of 2048 MB
Rule 2: If the destination disk is smaller than the original source disk, (but still large enough to accommodate the data from the source disk), the free space left over after the data space has been satisfied will be distributed between the destination partitions in proportion to the data usage in the source partitions.

 

 

Examples of the CLONE switch

Example 1
Copy drive one to drive two on a computer without the final prompt:

ghost.exe -clone,mode=copy,src=1,dst=2 -sure

Example 2
Connect through NetBIOS to another computer that is running Ghost in slave mode, and dump a disk image of the second local drive to the remote file c:\drive2.gho:

ghost.exe -clone,mode=dump,src=2,dst=C:\drive2.gho -nbm

Note that Ghost at the slave computer can be started with ghost -nbs.

Example 3
Copy the second partition on drive one to the first partition on drive two on the same computer without the final prompt:

ghost.exe -clone,mode=pcopy,src=1:2,dst=2:1 -sure

Example 4
Load the disk image file savedsk.gho on the server drive mapped locally to drive E onto drive 1 of the local computer. Do not prompt if OK to proceed:

ghost.exe -clone,mode=load,src=E:\savedsk.gho,dst=1 -sure

This example is typical what would be in a batch file that automates workstation installations from a network server.

Example 5
Dump the second partition of drive one to an image file on the G: drive:

ghost.exe -clone,mode=pdump,src=1:2,dst=g:\part2.gho

Example 6
Load partition 2 from a two-partition image file on a mapped drive G: onto the second partition of the local disk:

ghost -clone,mode=pload,src=g:\part2.gho:2,dst=1:2

Example 7
Load drive 2 from an image file, and resize the destination partitions into a 60:40 allocation:

ghost.exe -clone,mode=load,src=g:\2prtdisk.gho,dst=2,sze1=60P,sze2=40P

Example 8
Clone a three partition disk and keep the first partition on the destination drive the same size as on the source disk, but divide up the remaining space between the other partitions leaving no unallocated space:

ghost.exe -clone,mode=copy,src=1,dst=2,sze1=F,sze2=V,sze3=V

Example 9
Load drive one from an image file and resize the first partition to 450 MB, the second to 1599 MB and the third to 2047 MB:

ghost.exe -clone,mode=load,src=g:\3prtdisk.gho,dst=1,sze1=450M,sze2=1599M,sze3=2047M

Example 10
Load a disk from an image file and resize the last partition to its capacity. The first partition utilizes the remaining space:

ghost.exe -clone,mode=load,src=g:\2prtdisk.gho,dst=1,szeL

Example 11
Load drive one from an image file being sent from the multicast server with the session name SESSIONNAME without final prompt:

ghost.exe -clone,src=@mcSESSIONNAME,dst=1 -sure

Example 12
Create an image file of drive one to an image file being created by the multicast server with the session name SESSIONNAME without final prompt:

ghost.exe -clone,src=1,dst=@mcSESSIONNAME -sure

Example 13
Create an image file of drive two's partitions to an image file being created by the multicast server with the session name SESSIONNAME:

ghost.exe -clone,src=2,dst=@mcSESSIONNAME

Example 14
Write an image that has three partitions to drive one. Use an image file that is sent by the Multicast Server or GhostCast Server using the session name SESSIONNAME. Also resize the first partition to 450 MB, the second partition to 1599 MB and the third partition to 2047 MB.

Because this task requires one imaging operation for each partition that you will resize, the task requires that you use a batch file. Using a batch file with error checking prevents the need for user intervention if a problem occurs.

In the following batch file, the first line executes the -CLONE command three times. The first instance uses the word -CLONE, and the other two instances (which are ,sze1=450M and ,sze3=2047M), use the comma to instruct Ghost to use default commands.

The following batch file is incomplete and is intended only as an example of typical commands that a batch file for Ghost might use.

ghost.exe -clone,src=@mcSESSIONNAME,dst=1,sze1=450M,sze2=1599M,sze3=2047M -batch
IF ERRORLEVEL 1 GOTO PROBLEM
ECHO Ghost exited with value of 0 which indicates success.
REM **Add any extra commands that are required here if Ghost succeeds**
GOTO FINISH

:PROBLEM
ECHO GHOST returned with an Error value of 1 or greater.
ECHO Ghosting was not completed successfully
REM **Add any extra commands that are required here if Ghost fails**

:FINISH
ECHO Batch File Finished.

Example 15
In this example, under Symantec Ghost 8.0, there is one hard drive with two partitions. One or both partitions could be an NTFS partition. The following command writes the image of the first partition to the second partition under the image.gho file name.

ghost.exe -clone,mode=pdump,src=1:1,dst=1:2\image.gho