Creating a partition
gdisk disk /cre {/pri| /ext| /log} [/sz: {MB|pcent{p|%}}][ /for [/q] [/v[:label]] ] [/-32] [/ntfat16]
- disk: The physical fixed disk, 1 to 8.
- /cre: Create a DOS partition or logical DOS drive.
- /pri: Create a primary DOS partition.
- /ext: Create an extended DOS partition.
- /log: Create a logical DOS drive in the extended DOS partition.
- /sz:MB: Specifies the size of the partition in megabytes (MB). This is rounded up to the nearest cylinder.
- /sz:pcent{p|%}: Specifies the size of the partition as a percentage of the total disk size, 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 is determined by the following:
- -If the partition is less than 16MB: FAT12
- -If the partition is between 16MB and 512MB: FAT16
- -If the partition is greater than 512MB: FAT32
- /q: Performs a quick format if used in combination with the /for switch. If you do not use this switch, then GDisk will do a surface scan of the partition and mark any bad sectors.
- /v[:label]: Use in combination with the /for switch to give the new formatted partition the specified label.
- /-32: Partition is not formatted as FAT32. Limits primary and logical partitions to 204MB. Partitions over 16MB will be formatted as FAT16. This switch is useful if the operating system running does not support FAT32, for example, Windows NT4.
- /ntfat16: Partition is not formatted as FAT32, but 64KB, cluster FAT16 is allowed. This limits primary and logical partitions to 4097MB. Partitions over 16MB are formatted as FAT16. Windows 9x and DOS systems are unable to access partitions that are over 204MB and were created with this switch.
Reinitializing the Master Boot Record
Use the /mbr switch 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. You can also use the /mbr switch with the / wipe option to delete a dynamic disk.
gdisk disk /mbr [/wipe]
- /mbr: Reinitializes the boot code in the Master Boot Record.
- /wipe: Delete the partition on the disk.
Displaying information about disks
The status switch displays information about the fixed disks and partitions on a disk, including the model of the disk. To display the information about the partitions on a disk, you must specify the disk number. The syntax for this command is as follows:
gdisk [disk] [/status] [/raw] [/lba] [/ser]
- /raw: Displays the contents of the partition table in CHS form if used with the disk switch
- /lba: Displays the contents of the partition table in logical block form if used with the disk switch
- /ser: Displays the serial number of the disk
Deleting and wiping your disk
GDisk provides a choice to delete data and partitions on your disk or wipe your entire disk. You cannot delete a dynamic disk partition. The switch /del/all deletes all partitions that are on the disk. Partitions are removed. Any other space that has not been used for creating a partition will not be deleted. Deleting an extended partition also deletes any logical partition within it. The /diskwipe switch wipes the whole disk, partitions, partition table, MBR and all used and unused spaces.
The syntax for the delete switch command is as follows:
gdisk disk /del {/pri[:nth]|/ext[:nth]|/log:nth|/p:partn-no|/all} [/qwipe|/dodwipe|/customwipe:n]
The syntax for the diskwipe switch is as follows:
gdisk disk /diskwipe [dod| /custom:n]
- /del: Delete a DOS partition or logical DOS drive.
- /pri[:nth]: Delete the nth primary DOS partition, the default is 1.
- /ext[:nth]: Delete the nth extended DOS partition, the default is 1. Also deletes 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 partition’s data area before deleting the partition. Makes one pass of the disk.
- /dod: Overwrites the partition’s data area before deleting the partition. Makes 7 passes of the disk. This is the security standard for the U.S. Department of Defence.
- /custom:n: Overwrites the partition’s data area n times before deleting the partition. n can be set from 1 to 100. /custom:7 is equivalent to /dodwipe.
For example:
- gdisk 1 /del /all /qwipe completes one pass to delete all partitions and data on disk 1.
- gdisk 1 /del /p:2 /qwipe wipes partition 2 on disk 1 with one pass.
- gdisk 1 /diskwipe /custom:xx wipes the entire disk with xx passes. /dod wipes 7 times.
Activate or deactivate a partition
The syntax for this command is as follows:
gdisk disk /[-]act /p:partn-no
- /act: Activate a partition.
- /-act: Deactivate a partition.
- /p:partn-no: Partition to activate or deactivate. Only primary partitions can be activated. Use the number reported by GDisk in standard display mode (not using /lba or /raw) for partn-no.
HOME