Basic Format of ghost batch file

Source: Internet
Author: User

Ghost-clone, mode = {copy │ load │ dump}, src = {drive │ file │ drive: partition}, DST = {dri-ve │ file │ drive: partition}/fro/FX/Rb/f32/Z (N)/sure {Other parameters}

The meanings and usage of the main parameters are as follows:

-Clone.

Mode =: This option is used to set the usage mode of ghost.exe. There are six modes available: Copy, pcopy, load, pload, dump, and pdump. Among them, copy, load, dump refers to the operation of the hard disk to the hard disk. After p is added (pcopy, pload, pdump), operations are performed on the hard disk partition in the same mode. For example, "mode = copy" means to clone data from one hard disk to another hard disk with the same capacity or larger capacity, and add P (mode = pcopy) in the future, it means to clone data from one partition to another. "Mode = load" means to extract the image file and restore it to the hard disk (or partition). "mode = dump" means to make the hard disk (or partition) into an image file.

Src =: this parameter is used to set the data source location ...... For example, "src =" indicates that the data is from the first partition of the primary disk. "src =" indicates that the data is from the second partition of the primary disk. "src = D: \ ghost \ sysbak. GH1 indicates that the data to be extracted comes from sysgbak in the ghost directory of the second partition of the primary disk. gho file.

DST =: this parameter sets the destination location of the data. The usage is the same as that of SRC. For example, "DST =" indicates that the extracted data is restored to the first partition of the primary disk. "DST =" indicates that the extracted data is restored to the second partition of the primary disk. "DST = D: \ ghost \ sysbak. GH1 indicates that the backup data is saved to sysgbak in the ghost directory in the second partition of the primary disk. gho file.

/Fro: this parameter indicates skipping all errors during cloning. We recommend that you avoid using this parameter.

/FX: after the program is executed, it automatically exits and returns to the operating system. This parameter can be used when you create an image file or restore a non-system partition. However, when you use this parameter to restore a system partition, it may cause a crash (for details about restoring the system partition, refer to/Rb ).

/RB: Force restart the system after the program is executed.

/F32: Convert the fat16 format to the FAT32 format.

/Z (n): sets the compression ratio of the image file, which is only used when creating the image file. N = 1 (/Z1) indicates that the image file is not compressed when it is created, n = 2 (/Z2) indicates fast compression, n = 3 ~ 9 adopts a high proportion of compression. In actual use, I recommend using/Z2 (Fast compression). Its speed and/Z1 (no compression) are basically the same, but the image files are much smaller. However, if your hard disk capacity is not very large, it is recommended to use/Z9.

/Sure: automatically answers "yes" to all prompt questions ". In the ghost.exe graphical interface operation, the program will pop up some dialog boxes asking if you are sure to perform this operation. there are usually two options: "Yes" and "cancel"./Sure indicates Automatically Selecting "yes ", to ensure that manual interference is not required during the cloning process.

In my case, I created a directory named Ghost on drive D, and backed up the image file in Zone C with the name sysbak. gho. The content of the two batch files is as follows:

Sysback. BAT (Backup ):

Ghost-clone, mode = pdump, src = 1:1, DST = D: \ ghost \ sysbak. GH1/FX/Z9/Sure

Revert. BAT (recovery ):

Ghost-clone, mode = pload, src = D: \ ghost \ sysbak. GH1, DST = 1:1/sure/Rb

· Detailed example of the ghost parameter (you can skip this example but you must record it here)

Ghost.exe-clone, mode = copy, src = 1, DST = 2-Sure
Hard Disk copy

Ghost.exe-clone, mode = pcopy, src =, DST = 2:1-Sure
Copy the second partition of Hard Disk 1 to the first partition of Hard Disk 2.

Ghost.exe-clone, mode = pdump, src =, DST = G: \ BAC. gho
Make the second partition of Hard Disk 1 into an image file and put it in the G partition.

Ghost.exe-clone, mode = pload, src = G: \ BAC. gh2, DST =
Restore the second partition to the second partition of the hard disk from the image file with two internal partitions.

Ghost.exe-clone, mode = pload, src = G: \ BAC. gho, DST = 1:1-Fx-Sure-Rb
Use the G drive's BAC. gho file to restore the C drive. After the task is completed, no information is displayed. Start the task directly.

Ghost.exe-clone, mode = load, src = G: \ BAC. gho, DST = 2, sze1 = 60 p, sze2 = 40 P
Restore the image file to the second hard disk and change the partition size ratio to 60: 40.

Restore disk

First, create a boot disk with the file config.sys,autoexec.bat,command.com,io.sys,ghost.exe (you can use Windows as the boot disk program ).
Autoexec. bat can contain the following commands:
Ghost.exe-clone, mode = pload, src = D: \ BAC. gho, DST = 1:1-Fx-Sure-Rb
Use the Automatic Restoration of files on disk D to automatically jump out of the ghost and restart after the end.
Automatically backs up data in Zone C at startup, and generates the backup file BAC. GHO in zone D.
Ghost.exe-clone, mode = pdump, src = 1:1, DST = D: \ BAC. gho-Fx-Sure-Rb

Restore a cd

File included: bytes
The config. sys content is:
Device = oakcdrom. sys/D: idecd001
The autoexec. Bat content is:
Mscdex. EXE/D: idece001/L: Z
Ghost-clone, mode = load, src = z: \ BAC. gho, DST = 1:1-Sure-Rb

You can modify the instance according to the following descriptions.

-When using clone, a parameter must be added. It is also the most practical among all switches {batchswitch}. The following are the parameters defined by clone.
-Clone,
Mode = {copy │ load │ dump │ pcopy │ pload │ pdump },
Src = {drive │ file │ drive: partition },
DST = {drive │ file │ drive: partition}
Mode specifies the clone command to be used.
Copy a hard disk to a hard disk (disktodiskcopy)
Load file restore to hard disk (filetodiskload)
Dump: make the hard disk an image file (disktofiledump)
Partitiontopartitioncopy)
Restore A pload file to a partition (filetopartitionload)
Pdump partition backup to image file (partitiontofiledump)

SRC specifies the location mode of the source partition used for ghost running and Its Significance

Example of parameters used by the mode command SRC for the ode command
Copy/dump
Source hard disk number.
1 represents the first hard disk

Load Image File Name
G: \ back98 \ setup98.gho or device name (drive)

Pcopy/pdump
Source Partition Number.
Represents the second partition of Hard Disk 1

Add the partition code or drive name to the name of the pload partition image.
G: \ back98 \ setup98.gh2, representing the second partition in the Image File

The target location mode used when DST runs ghost and its significance:
Example of the parameter used by the mode command in DST
Copy/dump destination hard disk number.
2 represents the second hard drive

Load hard disk image file name.
Example G: \ back98 \ setup98.gho

Pcopy/pload destination Partition Number.
2: 2 represents the second partition of Hard Disk 2.

Pdump partition image file name plus area code.
G: \ back98 \ setup98.gh2

Szen specifies the size of the target partition used
N = xxxxm specify the N destination partition size as xxxxmbsze2 = 800m, which indicates that partition 2 is 800 mb.
N = the size of the target partition of the location n specified by MMP is the MM percentage of the entire hard disk.
Other parameters
-Fxo force copy to continue when the source object contains bad Blocks
-Fx: when the ghost completes the work of the new system, it does not display "pressctrl-alt-deltoreboot" and returns directly to dos.

-Ia completely copies the slice to the slice. When copying a partition from an image file or from another hard disk, ghost checks the source partition first, then decide whether to copy the file and directory structure or copy the image (sector to sector ). This is the default format. However, sometimes some hidden files related to system security may be stored in a specific location on the hard disk. Only sector-to-sector replication can be performed correctly.
-Pwdand-Pwd = x: encrypt the image file

-After the Rb is restored or copied, restart the system.

-Sure can be used with clone. Ghost does not display "proceedwithdiskclone-destinationdrivewillbeoverwritten? "Prompt information

We fully understand the above parameters. From today on, we don't have to deal with the ghost interface.

PS: My most common one-click Restore command:
F:/ghost/ghost.exe-clone, mode = pload, src = F:/ghost/xp. gho: 1, DST = 1:1-Fx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.