Gdisk usage details.
------------------------------------------------------------------------------

Gdisk has seven main operations. This document details the options available
for each operation. The seven operations are.

Display
Create partition (/CRE)
Delete partition (/DEL)
Activate partition (/ACT)
Hide partition (/HIDE)
Reinitialise the master boot record (/MBR)
Disk surface wipe (/DISKWIPE)

General help is available by running
gdisk /?
Detailed help on a particular operation can be obtained by running
gdisk /? /operation-switch
For example to get detailed help on deleting partitions run
gdisk /? /DEL
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Common switches:

Every operation has in addition to the detailed switches the following
------------------------------------------------------------------------------
/X
      Prevents gdisk from using extended disk-access support. This may result
      in gdisk not being aware of the full capacity of the disk. 
------------------------------------------------------------------------------
/I
      Prevents gdisk from using direct IDE disk-access support. This may
      result in gdisk not being aware of the full capacity of the disk. 
------------------------------------------------------------------------------
/S
      Prevents gdisk from using direct SCSI disk-access support. This may
      result in gdisk not being aware of the full capacity of the disk. 
------------------------------------------------------------------------------
/Y
      Suppress prompting to confirm you wish the action to be performed. Note
      deleting a partition or other possibly destructive operations will NOT
      in general generate a confirm prompt.
------------------------------------------------------------------------------
/SURE
      Same as /Y
------------------------------------------------------------------------------
/R
      Causes gdisk to reboot the machine if the operation has been successful.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Display
Syntax:
gdisk [disk] [/STATUS] [/RAW|/LBA]

Basic behaviour:
Displays information about the fixed disks on the machine. To find out about
the partitions on a disk, specify the disk. 

Note the partition number that is required for delete activate and hide
operations is not displayed if either /RAW or /LBA are used or the disk is not
specified.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8) to get partition information about.
------------------------------------------------------------------------------
/STATUS
      Redundant.
------------------------------------------------------------------------------
/RAW
      If used with the disk switch will display the contents of the partition
      table in CHS form. Otherwise redundant.
------------------------------------------------------------------------------
/LBA
      If used with the disk switch will display the contents of the partition
      table in Logical Block form. Otherwise redundant.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Create partition (/CRE)

Syntax::
gdisk disk /CRE {/PRI|/EXT|/LOG} [/SZ:{mbytes|pcent{P|%%}}]
      [ /FOR [/Q] [/V[:label]] ] [/-32] [/NTFAT16]

Mandatory switches:
disk /CRE and one of (/PRI /EXT /LOG).

Basic behaviour:
A partition of the specified type will be created which will use the largest
block of unused disk space (to set size use /SZ). The partition will not be
formatted (to format use /FOR).

Examples:
gdisk 1 /cre /pri /for /q /sz:1000
Creates and format a 1000Mb FAT32 primary partition on disk 1. The disk
surface area of the partition is assumed to be okay and is not scanned for
errors.

gdisk 1 /cre /ext
Creates an extended partition that will use up the largest unused block of
space on disk 1.

gdisk 1 /cre /log /for /v:MYDATA /-32
Creates a logical partition called MYDATA in the extended partition of disk 1.
The partition will use up to 2048Mb of unused space in the extended partition.
The partition will be formatted as FAT16 if it is bigger than 16Mb or FAT12
otherwise. The disk surface area of the partition will be scanned and any bad
sectors will be marked as unusable.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/CRE
      Create a DOS partition or logical DOS drive.
------------------------------------------------------------------------------
/PRI
      Create a primary DOS partition.
------------------------------------------------------------------------------
/EXT
      Create an extended DOS partition. /FOR not valid with extended
      partitions.
------------------------------------------------------------------------------
/LOG
      Create a logical DOS drive in the extended DOS partition.
------------------------------------------------------------------------------
/SZ:megabytes
      Specifies the size of the partition in megabytes, will be rounded up to
      the nearest cylinder.
------------------------------------------------------------------------------
/SZ:percent{P|%}
      Specifies the size of the partition as a percentage of the total disk
      size (note not the available disk space).
------------------------------------------------------------------------------
/FOR
      Format the new partition once it has been created. Unless the /NTFAT16 
      or /-32 switches are used, the partition type will be determined by the
      following rule.
      partition less than 16Mb will be FAT12
      partition between 16Mb and 512Mb will be FAT16
      partition greater than 512Mb will be FAT32
------------------------------------------------------------------------------
/Q
      In combination with /FOR performs a quick format. If this switch is not
      used gdisk will do a surface scan of the partition and mark any bad
      sectors.
------------------------------------------------------------------------------
/V[:label]
      In combination with /FOR gives the new formatted partition the specified
      label.
------------------------------------------------------------------------------
/-32
      Do not format as FAT32, this limits primary and logical partitions to
      2048Mb. Partitions over 16Mb will be formatted as FAT16. This switch is
      useful if the operating system you are running does not support FAT32,
      for example Windows NT4 and earlier or Windows95 before osr2.
------------------------------------------------------------------------------
/NTFAT16
      Do not format as FAT32, but allow 64Kb cluster FAT16, this limits
      primary and logical partitions to 4097Mb. Partitions over 16Mb will be
      formatted as FAT16. Note that Windows 9x and Dos systems will be unable
      to access partitions which are over 2048Mb and were created with this
      switch.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Delete partition (/DEL)
Syntax:
gdisk disk /DEL {/PRI[:nth]|/EXT[:nth]|/LOG:nth|/P:partn-no|/ALL}
      [/QWIPE|/DODWIPE|/CUSTOMWIPE:n]

Mandatory switches:
disk /DEL and one of (/PRI /EXT /LOG /P /ALL).

Basic behaviour:
Will delete the specified partition or if the /all switch is used, all
partitions. The portion of the disk surface containing the partitions data is
not modified (to clear the data use one of /qwipe /dodwipe or /customwipe).

Examples:
gdisk  /del /p:2
Deletes the second partition on disk 1 as reported by gdisk 1.

gdisk 2 /del /all
Deletes every partition on disk 2.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/DEL
      Delete a DOS partition or logical DOS drive.
------------------------------------------------------------------------------
/PRI[:nth]
      Delete the 'nth' primary DOS partition, default is 1.
------------------------------------------------------------------------------
/EXT[:nth]
      Delete the 'nth' extended DOS partition, default is 1. Will also delete
      any logical partitions in the extended partition.
------------------------------------------------------------------------------
/LOG:nth
      Delete the 'nth' logical DOS drive from the extended DOS partition.
------------------------------------------------------------------------------
/P:partn-no
      The partition to delete. Use the number reported by gdisk in standard
      display mode (not using /LBA or /RAW) for partn-no.
------------------------------------------------------------------------------
/ALL
      Delete all partitions.
------------------------------------------------------------------------------
/QWIPE
      Overwrites the partitions data area before deleting the partition.
------------------------------------------------------------------------------
/DODWIPE
      Overwrites the partitions data area before deleting the partition. The
      data used for the overwrite and the number of times it is overwritten
      conforms to the US department of defence standard DoD 5200.28-STD.
------------------------------------------------------------------------------
/CUSTOMWIPE:n
      Overwrites the partitions data area n times before deleting the
      partition. The data used for the overwrite conforms to the US department
      of defence standard DoD 5200.28-STD. Note /CUSTOMWIPE:7 is equivalent to
      /DODWIPE
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Activate partition (/ACT)
Syntax::
gdisk disk /[-]ACT /P:partn-no

Mandatory switches:
disk /P:partn-no and one of {/-ACT /ACT}

Basic behaviour:
Will activate or deactivate the specified partition. If activating and another
partition is active, the other partition will be deactivated.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/ACT
      Activate a partition
------------------------------------------------------------------------------
/-ACT
      Deactivate a partition
------------------------------------------------------------------------------
/P:partn-no
      Partition to activate or deactivate. Only primary partitions may be
      activated. Use the number reported by gdisk in standard display mode
      (not using /LBA or /RAW) for partn-no.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Hide partition (/HIDE)
Syntax::
gdisk disk /[-]HIDE /P:partn-no

Mandatory switches:
disk /P:partn-no and one of {/-HIDE /HIDE}

Basic behaviour:
Will hide or unhide the specified partition. A hidden partition will not be
assigned a drive letter by the operating system.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/HIDE
      Hide a partition
------------------------------------------------------------------------------
/-HIDE
      Unhide a partition
------------------------------------------------------------------------------
/P:partn-no
      Partition to hide or unhide. Use the number reported by gdisk in
      standard display mode (not using /LBA or /RAW) for partn-no.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Reinitialise the master boot record (/MBR)
Syntax::
gdisk disk /MBR [/WIPE]

Mandatory switches:
disk /MBR

Basic behaviour:
Reinitialises the boot code in the Master Boot Record, leaving partitions
intact (to remove partitions use /WIPE).

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/MBR
      Reinitialises the boot code in the Master Boot Record.
------------------------------------------------------------------------------
/WIPE
      Delete the partitions on the disk also.
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Disk surface wipe (/DISKWIPE)
Syntax::
gdisk disk /DISKWIPE [/DODWIPE|/CUSTOMWIPE:n]

Mandatory switches:
disk /DISKWIPE.

Basic behaviour:
Writes to every sector of the disk, thus wiping everything on the disk.

Switch details:
------------------------------------------------------------------------------
disk
      The physical fixed disk (1-8).
------------------------------------------------------------------------------
/DODWIPE
      The data used for the overwrite and the number of times it is 
      overwritten conforms to the US department of defence standard
      DoD 5200.28-STD.
------------------------------------------------------------------------------
/CUSTOMWIPE:n
      The data used for the overwrite conforms to the US department of defence
      standard DoD 5200.28-STD. The data is written n times. /CUSTOMWIPE:7 is
      equivalent to /DODWIPE
------------------------------------------------------------------------------

