GDISK – Fixed Disk Partitioning Utility

This document describes GDISK 1.1.1. We are interested in and appreciate receiving your feedback. Please direct any comments or suggestions to the GDISK Ask-a-Tech Forum located on the Symantec Technical Support web site. Point your web browser to: http://www.symantec.com/techsupp/ghost/ask_ghost.html

What's New?
We have received a lot of feedback from users after GDISK was first released and have modified the product in response to the suggestions made.

New in Version 1.1.1
•	Create partition size accepts a percentage of disk space.  A percentage amount of the total disk size can be entered into the /SZ: switch while creating partitions. When creating several partitions covering the entire disk, create the last partition without a size parameter to indicate the remainder of the disk. Creating several partitions with percentages totaling 100% may not work due to partition size rounding and alignment considerations. Note: To use this feature within a command line of a batch file, use %% instead of %. An alternative solution will be included in the next release of GDISK.
New in Version 1.1.0
•	Out of memory assertion failures. A number of users reported assertion failures caused by GDISK running out of DOS conventional memory. GDISK has been ported to 32-bit protected mode and now has direct access to all installed memory. The conversion to protected mode has also reduced the executable size from 209KB to 165KB.
•	Batch mode. It can be tedious running GDISK multiple times from a floppy because of the time it takes to load the executable from the diskette. GDISK now supports a /BATCH switch that allows it to execute commands from a pre-prepared batch file or prompt for multiple commands interactively. See later section for instructions on using batch mode.
New in Version 1.0f
•	Listing installed disks. In the default display mode (/STATUS), GDISK displays a list of all installed fixed disks if no fixed disk number is specified.
•	Wiping all partitions. A new /WIPE switch may be used in conjunction with the /MBR switch which will cause all existing partitions to be deleted when the Master Boot Record is reinitialized.
•	Bad sectors better identified. Error messages reporting failures to read, write, or verify sectors on disk now also identify the fixed disk on which the error was encountered.
•	Compaq diagnostic partitions recognized. These partitions are recognized and displayed in the list of partitions in the same order as they are displayed by FDISK.
•	MBR auto-initialization. For newly installed fixed disks that do not yet have a Master Boot Record, the MBR is initialized automatically when the first partition is created to match the behavior of FDISK.
•	Hiding Logical DOS drives. And lastly, the most popular request: Logical DOS drives may now be hidden and unhidden.

Problems using GDISK with Compaq Computers
Users have reported problems using GDISK with several different models of Compaq computers. The cause of this problem is a fault in the BIOS that makes it appear as if a number of phantom fixed disks are installed. Attempting to read the partition structures from these non-existent fixed disks caused GDISK to display numerous error messages and, in some cases, hang the computer.
We have notified Compaq of this problem and are currently assisting them to resolve it. GDISK is now able to detect this condition and will work correctly even with faulty BIOSes. However, the fault will still exist in the BIOS and this may cause other software packages to fail. Compaq advise us that users who experienced problems with the previous version of GDISK (v1.0e) should contact them to obtain a BIOS upgrade.
We appreciate the time users have taken to respond to us and their assistance has helped to improve this product. If you have any comments or are having problems, please contact us using the GDISK Ask-a-Tech Forum located on the Symantec Technical Support web site. Point your web browser to: http://www.symantec.com/techsupp/ghost/ask_ghost.html
Overview
GDISK is intended as a complete replacement for the DOS/Windows 9x FDISK utility. Everything you can do with FDISK you can do with GDISK. The partitions created with GDISK are indistinguishable from those created using FDISK.
GDISK is command-line driven – unlike FDISK which uses interactive menus and prompts – so it is much quicker for configuring a disk’s partition table and does a few extra things that FDISK does not. 
Summary of Capabilities
GDISK has seven main modes of operation, the first four of which correspond to the menu options in FDISK’s main menu.
1.	Creating partitions - Primary DOS partitions, Extended DOS partitions, Logical DOS drives. 
2.	Deleting partitions of any type, including Non-DOS partitions. 
3.	Listing current partition information and installed fixed disks.
4.	Activating a partition (nominating it as the bootable partition). 
5.	Making existing partitions invisible and visible again.
6.	Reinitializing the Master Boot Record.
7.	Batch-mode command execution.
Advantages over FDISK
GDISK provides some added capabilities that FDISK does not – such as on-the-fly formatting – and provides a safer alternative in situations where known problems with FDISK can cause data loss and hardware damage.
1.	Command-line driven and much quicker than FDISK. Allows standard configurations to be defined in a batch file and applied to multiple computers. 
2.	Gives better disk space utilization. It is much more aggressive in finding free space on the disk for new partitions, and in most cases will find space ignored by FDISK (this space can vary between 0.5MB and 16MB). Alternatively the /-CE switch may be specified when creating partitions to force FDISK-compatibility.
3.	Reduces slack space (disk wastage). GDISK is more aggressive than the FORMAT utility provided with Windows 9x in attempting to keep cluster sizes small. For some partition sizes, GDISK is able to format partitions with cluster sizes half the size that FORMAT would select resulting in an effective 10-35% increase in drive capacity.
4.	Allows partitions to be hidden. This can be used to have more than one Primary DOS partition with different versions of DOS/Windows 9x in each partition. Normally it is not possible to have more than one DOS or Windows 9x installation on the same computer. The ability to hide partitions allows the computer to be used to boot into any selected bootable partition ignoring other installations of the same operating system in other partitions. 
5.	The FDISK supplied with Windows 95 has a bug that can cause overlapping partitions to be created that will almost certainly lead to corruption of existing partitions. The same bug can also result in partitions that extend past the end of the disk, which can cause permanent damage to the drive when the partition is formatted. This is the one situation in which GDISK does not imitate the exact behavior of FDISK – even with the compatibility switch turned on. 
6.	The FDISK supplied with Windows 9x has a bug that means that it is not possible to delete newly created partitions if the drive letter that was provisionally assigned to the new drive matches a drive letter currently assigned to a CD-ROM device. GDISK allows the partitions to be deleted even if the new drive letter is currently assigned.
7.	Useful as a diagnostic tool – extensive integrity verification checks are performed on the partition tables before any operations are performed on the drive.
8.	GDISK can display the partition information in a raw cylinder/head/sector format that may be of use to technicians investigating problems with a computer's partition table.
Instructions
GDISK has seven main modes of operation: creating partitions, deleting partitions, displaying partition information, activating partitions, hiding/unhiding partitions, MBR re-initialization, and batch command execution. The mode that GDISK operates in is selected by one of the switches: /CRE, /DEL, /STATUS (the default), /ACT, /HIDE, /MBR, or /BATCH.
An overview of these modes and their switches may be displayed by using the help switch:
C:\> gdisk /?
Configures fixed disk partitions.

GDISK disk /CRE {/PRI|/EXT|/LOG} [/SZ:{mbytes|pcent%}] [/FOR [/Q]
  [/V[:label]]]  [/-32] [/-CE] [/X] [/Y]
GDISK disk /DEL {/PRI[:nth]|/EXT[:nth]|/LOG:nth|/P:partn-no|/ALL} [/X]
  [/Y]
GDISK [disk] [/STATUS] [/RAW|/LBA] [/X] [/Y]
GDISK disk /ACT /P:partn-no [/X] [/Y]
GDISK disk /[-]HIDE /P:partn-no [/X] [/Y]
GDISK disk /MBR [/WIPE] [/X] [/Y]
GDISK [disk] /BATCH[:filename] [switch[switch...]]
GDISK /? [/CRE|/DEL|/STATUS|/ACT|/[-]HIDE|/MBR|/BATCH]

(C) Copyright Symantec, 1998. Version 1.1.1.

An additional switch not shown here in the help text is the /VERSION switch which displays the version information for the GDISK executable.
Detailed Instructions
More detailed help may be accessed by qualifying the help command with the switch for one of the main modes. The main modes are /CRE, /DEL, /STATUS, /ACT, /HIDE, /-HIDE, /MBR, and /BATCH.
C:\> gdisk /hide /?
Hides a regular partition or unhides a hidden partition.

GDISK disk /[-]HIDE /P:partn-no [/X] [/Y]

  disk         The physical fixed disk (1-8).
  /HIDE        Hide a partition.
  /-HIDE       Unhide a hidden partition.
  /P:partn-no  The number of the partition to hide/unhide. Use /STATUS to
               select the partition number.
  /X           Ignore extended disk-access support.
  /Y           Suppress prompting to confirm you wish the action to be
               performed. /SURE has the same meaning.
Reinitializing the Master Boot Record
The /MBR switch may be used to rewrite the boot code in the Master Boot Record. The usual reason for needing to reinitialize the MBR is to eliminate a boot sector virus residing there. 
Reinitializing the Master Boot Record does not alter the disk's partition information but can be destructive if other software has replaced the original standard Master Boot Record. This will be the case if a disk extender (such as OnTrack's DiskManager) or operating system loader (such as OS/2's Boot Manager) has been installed.
Warning:	Do not use the /MBR switch if a disk extender is installed as it will render the partition data inaccessible until the extender has been reinstalled. 
Another situation in which the /MBR switch may be useful relates to a bug in some BIOSes: if a new disk is installed or a different operating system loaded, the next time an IDE auto-detect is performed in the BIOS some devices may fail to be detected. It may be that the device which failed to be detected by the BIOS is the new drive itself, the primary drive containing the new operating system, or other IDE devices such as a CD-ROM. Using GDISK /MBR on each of the hard disk drives will often repair this problem.
Batch Mode
Use the batch mode switch, /BATCH, to perform multiple GDISK operations with a single command. Batch commands can either be supplied interactively at a prompt or in a pre‑prepared text file.
If the name of a text file is supplied along with the batch mode switch, GDISK opens the file and executes the commands within it until all commands have been executed or one of the commands encounters an error:
C:\> gdisk /batch:cmds.gg

If the batch mode switch is supplied without a file name, GDISK will prompt for the commands to execute:
C:\> gdisk /batch
Complete the following command (ENTER to quit):

> GDISK 2 /cre /ext

Partition  Status   Type     Volume Label   Mbytes   System   Usage
     2  *CREATED*  EXT DOS                   507.9             17%

> GDISK 2 /cre /log

Partition  Status   Type     Volume Label   Mbytes   System   Usage
     2             EXT DOS                   507.9             17%
 D:  3  *CREATED*  LOG DOS    Unformatted    507.9  FAT16      17%

> GDISK

Command line arguments that apply to all of the batch commands can be specified on the original command line along with the batch mode switch. The lines found in the batch file (or typed at the prompt) are appended to the already partially formed command line.
Here is an example batch command file called two-new.gg. Blank lines and ones starting with the hash symbol are considered to be comments and are ignored. (Note that, in this example, the commands do not specify the fixed disk to operate on.)
# delete all partitions
/del /all
# create formatted FAT16 primary DOS partition
/cre /pri /-32 /for /q
/cre /ext
# create formatted FAT16 logical DOS partition
/cre /log /-32 /for /q

The following command deletes all partitions and creates two new ones on the second fixed disk with confirmation prompting turned off:
gdisk 2 /y /batch:two-new.gg 

The four commands that will be executed are a combination of the original command plus the commands from the batch file:
gdisk 2 /y /del /all
gdisk 2 /y /cre /pri /-32 /for /q
gdisk 2 /y /cre /ext 
gdisk 2 /y /cre /log /-32 /for /q

Batch files may be nested recursively, so if a second file called std-init.gg contained the following lines:
1 /batch:two-new.gg 
2 /batch:two-new.gg 

then this command performs the actions of two-new.gg on both fixed disks:
gdisk /batch:std-init.gg

Advanced combinations
Batch modes can nest recursively on the command line as well as within batch files. File-based and interactive batch modes may be mixed in the same command line. For example, the following command prompts for the number of the fixed disk(s) to execute the commands in two-new.gg against:
gdisk /batch /batch:two-new.gg

If a file named disks.gg contained the following lines:
1
2

then you could delete all partitions and create two new ones on both fixed disks with the following command:
gdisk /batch:disks.gg /batch:two-new.gg

Assertion Failures
This version of GDISK contains extensive internal self-checks in the form of logical assertions. These checks enable us to double-check the internal behavior of the program.
Literally hundreds of these checks are made each time that GDISK is executed. If any of these checks fail, an assertion failure message is displayed that will look similar to the following:
Assertion failed: example_assertion == false, file GDISK.CPP, line 159
Abnormal program termination

If you see an assertion message while running GDISK, please record the information from the message and the details of the operation you were performing and notify us using the GDISK Ask-a-Tech Forum located on the Symantec Technical Support web site. Point your web browser to: http://www.symantec.com/techsupp/ghost/ask_ghost.html

Note:	A number of users reported assertion failures with GDISK 1.0f. This was caused by GDISK running out of DOS conventional memory. As far as we know, this has been the only cause of assertion failures. GDISK has been ported to a 32-bit protected mode environment where it has direct access to all installed memory, so we do not expect that users will see any further assertion messages.
Technical Support
Symantec Corporation maintains a comprehensive Technical Support web site for Norton Ghost and its associated utilites. Please point your browser to
	http://www.symantec.com/techsupp/ghost/allservices_ghost.html
for the enhanced support options described below.

GHOST Frequently Asked Questions (FAQ)
This online version of the FAQ will include the top issues for your version of Norton Ghost and associated utilities.
GHOST Knowledge Base
Search or browse through a collection of clearly written articles that can answer your technical questions and help troubleshoot problems.
The GHOST "Ask Symantec" Discussion Forum
This Ghost discussion group is hosted by experienced GHOST support personnel and our goal will be to provide solutions within 24 hours of your technical posts.
File Downloads
Here you can find free Ghost downloads including:
	-Latest release versions of Norton Ghost software
	-Beta versions of Norton Ghost software
	-Additional Utilities for Norton Ghost
	-Latest version of the Norton Ghost User’s Guide

You can also contact our Technical Support department by phone. See the updated Norton Ghost User Guide for the number and an explanation of your phone support options.
Terms of Distribution

The ownership and copyright of all materials pertaining to GDISK (The Product) remains with Symantec. The distribution of this product is not a sale of any rights to The Product. All materials are copyrighted by Symantec. All Rights Reserved. They may not be copied, published, re-transmitted, uploaded or summarized without prior, explicit, written permission.
Agreement Period
You are free to make use of the version of The Product that accompanied this document for an indefinite period. Symantec reserves the right to change the agreement unilaterally for future versions at any time.
Copying and Distribution
You may not make copies of The Product, other than a backup copy for your own use. You may not distribute The Product in any form, including print, physical media, upload to a bulletin board system, or upload to an Internet or intranet server, without the expressed written consent of Symantec.
Rental or Leasing
You may not rent or lease or The Product under any circumstances unless specifically authorized in writing by Symantec.
Reservation of Rights
Any and all other rights pertaining to The Product or its use, other than those specifically granted by this Agreement, are hereby reserved by Symantec.
Termination
Without limitation to other rights that Symantec may have, Symantec reserves the right to immediately terminate this license upon notice, in the event that you fail to comply with its terms. Upon termination, you lose any and all rights granted to you by this Agreement, and you must destroy all copies of The Product in whatever form they may exist.
Notification of Safety Issues
There are certain operations supported by The Product that will result in the deletion of partitions and the data they contain. The user takes all responsibility for any actions that he or she chooses to undertake. Under no circumstances will Symantec be held liable for any loss or damages resulting from the actions of any user of The Product.
No Warranty
Symantec specifically disclaims all warranties with regard to The Product. This release is provided "as is", without any warranties of any sort, either expressed or implied. This includes, but is not limited to, implied warranties for The Product’s quality, merchantability, performance, or fitness for a particular purpose. Symantec does not warrant any results that you may obtain from using The Product. All risks arising out of use of the contents of The Product remain solely with the user.
Symantec makes no guarantee of accuracy regarding the material associated with The Product. Symantec incurs no obligation to provide support, maintenance or updates to The Product.
No Liability for Consequential Damages
In no event shall Symantec or its suppliers or agents be held liable for any damages whatsoever arising from the use of The Product, or the inability to use it, even if Symantec has been advised of the possibility of such damages. This disclaimer includes, without limitation, any claims of direct or indirect damages for personal injury, loss of business profits, loss of business information, business interruption, special damages or any other pecuniary loss by yourself or any third party. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
Limitation of Remedies
In any case, the entire liability of Symantec and your exclusive remedy under any provision of this Agreement shall be limited to the actual amount paid for The Product.