PDISK(8)

NAME
pdisk - HFS(DPME) partition maintenance program

SYNOPSIS
pdisk [-hilrv] disk

DESCRIPTION
pdisk is a menu driven program which partitions disks using the standard Apple disk partitioning scheme described in “Inside Macintosh: Devices”. It does not support the Intel/DOS partitioning scheme supported by fdisk(8).

The options are as follows:

-h  Prints a rather lame set of help messages for the pdisk program.

-i  Causes pdisk to go into an interactive mode similar to the Mac OS version of the program.

-l  List the partition tables for the specified disk.

-r  Prevents pdisk from writing to the disk.

-v  Prints version number of the program.

disk
    Specify the disk to operate on. It can be specified either by its full pathname or an abbreviated disk form. In its abbreviated form, the path to the device, the ‘r’ denoting “raw device”, and the partition letter, can all be omitted. For example, the first IDE disk can be specified as either /dev/rwd0c, /dev/wd0c, or wd0.

COMMAND MODE
The list of commands and their explanations are given below.

h   command help

p   print the partition table

P   print ordered by base address

i   initialize partition map

s   change size of partition map

c   create new partition (standard OpenBSD type)

C   create with type also specified

n   (re)name a partition

d   delete a partition

r   reorder partition entry in map

t   change the type of an existing partition

w   write the partition table

q   quit editing (don't save changes)

Commands which take arguments prompt for each argument in turn. You can also type any number of the arguments separated by spaces and those prompts will be skipped. The only exception to typeahead are the confirmation prompts on the i and w commands. The idea being that if we expect you to confirm the decision we shouldn't undermine that by allowing you to be precipitate about it.

Partitions are always specified by their number, which is the index of the partition entry in the partition map. Most of the commands will change the index numbers of all partitions after the affected partition. You are advised to print the table as frequently as necessary.

Creating more than fifteen partitions is not advised, for compatibility reasons.

The c (create new partition) command is the only one with complicated arguments. The first argument is the base address (in blocks) of the partition. Besides a raw number, you can also specify a partition number followed by the letter 'p' to indicate that the first block of the new partition should be the same as the first block of that existing free space partition. The second argument is the length of the partition in blocks. This can be a raw number or can be a partition number followed by the letter 'p' to use the size of that partition or can be a number followed by 'k', 'm', or 'g' to indicate the size in kilobytes, megabytes, or gigabytes respectively. (These are powers of 1024, of course, not powers of 1000.) The last argument is the name of the partition. This can be a single word without quotes, or a string surrounded by single or double quotes. The type of the created partition is the correct type for OpenBSD.

The C command is identical to the c command, with the addition of a partition type argument after the other arguments.

The n (name) command allows the name of a partition to be changed. The name must not contain any spaces. Note that the various "Apple_Driver" partitions depend on the name field for proper functioning. I am not aware of any other partition types with this limitation.

The r (reorder) command allows the index number of partitions to be changed. The index numbers are constrained to be a contiguous sequence.

The t (change type) command allows the type of an existing partition to be changed. Examples of valid partition types are: Apple_Free, Apple_HFS, and OpenBSD.

The i (initialize) command prompts for the size of the disk. This was done to get around a bug in the kernel where it reports the wrong size for the disk.

The w (write) command does write the partition map out, but there is currently a bug in the interaction between the disk and the kernel where disklabel -c disk must be issued to cause the kernel to reinterpret the new label.

SEE ALSO
disklabel(8), fdisk(8), newfs(8)

HISTORY
The pdisk utility was originally developed for MkLinux.

AUTHORS
Eryk Vershen

BUGS
Some people believe there should really be just one disk partitioning utility.

pdisk should be able to create HFS partitions that work.

Filesystem volume names are out of place in a partition utility. This utility supports HFS volume names, but not volume names of any other filesystem types.

Even more help should be available during user input.