This page describes undocumented switches (or parameters) you can use with FDISK. Notably these switches
can be used when running FDISK in non-interactive mode, e.g. in a batch file.
The switches work with the FDISK utility that is include with Windows 95 OSR2 (MS-DOS 7.1) and up.
Variables used in this document:
- <size> Partition size in Mb - FDISK rounds this number up
- <disk> Hard disk number, e.g. first HD is number 1
/STATUS |
|
Show current partition layout |
/MBR |
|
Recreate Master Boot Record on disk 1 |
/PRI |
|
Create primary partition |
/PRIO |
|
Create primary partition with FAT16/FAT32 override |
/EXT |
|
Create extended partition |
/LOG |
|
Create logical drive |
/LOGO |
|
Create logical drive with FAT16/FAT32 override |
/FPRMT |
|
Prompt for FAT32/FAT16 in interactive mode |
/Q |
|
Quit FDISK without rebooting. Used with input redirection
(Piping keystrokes). |
/X |
|
Do not use LBA partitions |
/ACTOK |
|
Do not check drive integrity |
/CMBR |
|
Recreate Master Boot Record on specified disk |
|
|
|
|
Notes on /PRI, /PRIO and /LOG, /LOGO |
/EXT - Create extended partition
Create an extended partition (to hold logical drives) on disk number
<disk>with the size of <size>.
FDISK /EXT:<size> <disk> |
|
If <size> is larger than remaining free
space, all free space is used. That is, you don’t have to know the exact remaining
size in order to use this switch. |
/LOG - Create logical drive
With /LOG you create a logical drive with the size of <size>.
/LOG must be used together with /EXT.
FDISK /EXT:<size> <disk> /LOG:<size> |
|
/LOG must be used together with /EXT
and <size> must be the same for both switches.
Furthermore, <size> must be smaller or equal to free space. |
/FPRMT - Prompt for FAT32/FAT16 in interactive mode
With /FPRMT you won’t get the FDISK start screen where you are asked for support for large disks.
Instead, you will be prompted for FAT16/FAT32 each time you create a partition.
FDISK /FPRMT
Note that the prompt for FAT16/FAT32 will be available for ALL partitions,
so this option can be used to force FDISK to create FAT 32 partitions smaller than 540Mb.
(By default, FDISK uses FAT32 for partitions greater than 540Mb only). |
Notes on /PRI, /PRIO and /LOG, /LOGO
PRI and LOG create FAT32 when partitions are larger than 512Mb and FAT16 when partitions
are smaller than 512Mb. PRIO and LOGO create FAT16 even if partitions are larger than 512Mb
(in effect, it’s like FDISK from DOS 5/6). |
You can pipe keystrokes into FDISK using a file which contains the keystrokes including
<CR>. Most editors can’t insert the <CR> character without <LF> so you
need a hex-editor to do the job. This might also be true for the <ESC> character,
although <ESC> can be entered in DOS EDIT using P <ESC>
Take a look at an example below.
Example:
FDISK /Q < FDISK.BIN
Contents of FDISK.BIN:
N
1
1
n
2000
<ESC>2
1
<ESC><ESC><ESC>
The above example will run FDISK, no user intervention, create a primary partition of 2000 MB,
no large disk support, set the partition "active" and quit without rebooting.
|