fdisk -- maintain disk partitions


/etc/fdisk [ -f name ]
/etc/fdisk -a number [ -f name ]
/etc/fdisk -c number start size [ -t ostype ] [ -f name ]
/etc/fdisk -d number [ -f name ]
/etc/fdisk -p [ -f name ]


fdisk displays information about disk partitions. It also creates and deletes disk partitions and changes the active partition. fdisk functionality is a superset of the MS-DOS command of the same name. fdisk is usually used interactively from a menu.

The hard disk has a maximum of four partitions. Only one partition is active at any given time. It is possible to assign a different operating system to each partition. Once a partition is made active, the operating system resident in that partition boots automatically once the current operating system is halted.

The fdisk utility reports disk sizes in tracks. The number of tracks available on a hard disk is equal to the number of heads times the number of cylinders. The fdisk utility does not allocate the first track or the last cylinder on the hard disk when the Use Entire Disk for UNIX option is used. The first track on the hard disk is reserved for masterboot and the last cylinder is generally used when running hard disk diagnostics. You should not allocate the last cylinder if you plan to run diagnostics on your hard disk.

For example, if a disk has 4 heads and 615 cylinders, it has 2460 tracks, which fdisk reports as tracks 0-2459. If you choose the Use Entire Disk for UNIX option, fdisk will create a UNIX partition on tracks 1-2455. Track 0 is reserved for masterboot, and the last cylinder (tracks 2455-2459) is not assigned with the Use Entire Disk for UNIX option.

Partitions are defined by a ``partition table'' at the end of the master boot block. The partition table provides the location and size of the partitions on the disk. The partition table also defines the active partition. Each partition can be assigned to the UNIX system, DOS, or some other operating system. Once a DOS partition is set up, DOS files and directories resident in the DOS partition may be accessed from the UNIX system partition by means of the doscmd(C) commands. DOS may be booted without the DOS partition being active by entering dos at the boot prompt. See boot(HW).
The -p, -a, -d, and -c options are used to invoke fdisk non-interactively. The argument number to each of these options refers to a valid partition number (1-4).

fdisk takes the following options:

-a number
Activates partition number.

-c number start size
Creates a partition number that is size tracks long beginning at track start. The -c option uses the entire disk for UNIX if a dash (-) is specified for the size:

fdisk -c 1 1 -

This syntax is used only during installation. If there are any existing partitions on the disk, this command will fail.

-d number
Deletes partition number.

-f name
Open device name and read the partition table associated with that device's partition. The default is /dev/rhd00.

Prints out the disk partition table, one partition to a line. For each partition, fdisk displays the following information:
partition start stop size type status

-t ostype
Specify the partition type of the partition being created, where ostype is one of the following:

UNIX system filesystem

XENIX filesystem

equivalent to DOS_16

DOS 12 bit FAT (file access table)

DOS 16 bit FAT

DOS 32 bit FAT

DOS extended partition

OS/2 HPFS filesystem

concurrent CP/M filesystem

If the -t option is not specified, the default partition type is a UNIX system partition.

Interactive menu options

When invoked without the -p, -a, -d, or -c options, fdisk is interactive. It displays a prompt and a menu of options. No changes are made to the partition table on the disk until you enter ``q'' from the main menu.

  1. Display Partition Table
    This option displays a table of information about each partition on the hard disk. The ``PARTITION'' column gives the partition number. The ``STATUS'' column tells whether the partition is active (``A'') or inactive (``I''). The ``TYPE'' column shows whether the partition is a UNIX system partition, or one of the other partition types accepted by the -t option. Unknown partition types display an integer representing the operating system. The option also displays the starting track, ending track and total number of tracks in each partition.

  2. Use Entire Disk for UNIX
    fdisk creates one partition that includes all the tracks on the disk, except the first track and the last cylinder. This partition is assigned to the UNIX system.

  3. Use Rest of Disk for UNIX
    fdisk creates one partition that occupies the largest available contiguous area of the disk. This partition is assigned to the UNIX system and is designated the active partition.

  4. Create UNIX Partition
    This option allows the creation of a partition by altering the partition table. fdisk reports the number of tracks available for each partition and the number of tracks in use. fdisk prompts for the partition to create, the starting track and size in tracks. The change is written to the hard disk when you enter ``q'' from the main menu.

  5. Activate Partition
    This option activates the specified partition. Only one partition may be active at a time. The change is not effective until you exit. The operating system residing in the newly activated partition boots once the current operating system is halted.

  6. Delete Partition
    This option requests which partition you wish to delete. The change is not effective until you exit.

  7. Create Partition
    Create a partition for one of the operating systems listed under the discussion of the -t option.
Exit the fdisk program by typing a ``q'' at the main fdisk menu. Your changes are now written to the hard disk.


The minimum recommended size for a UNIX system partition is 30MB.

The menu option Use Rest of Disk for UNIX does not attempt to align the partition on a cylinder boundary. This will result in a warning message if it is not aligned.

The menu option Use Entire Disk for UNIX places the start of the partition on track 1.

See also

divvy(ADM), doscmd(C), dparam(ADM), hd(HW)

Standards conformance

fdisk is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003