pdisk.8 revision 1.24
$OpenBSD: pdisk.8,v 1.24 2016/01/27 14:19:59 krw Exp $

Copyright 1996,1997,1998 by Apple Computer, Inc.
All Rights Reserved

Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all copies and
that both the copyright notice and this permission notice appear in
supporting documentation.

APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

.Dd $Mdocdate: January 22 2016 $ .Dt PDISK 8 .Os .Sh NAME .Nm pdisk .Nd HFS(DPME) partition maintenance program .Sh SYNOPSIS .Nm pdisk .Op Fl lr .Ar disk .Sh DESCRIPTION .Nm is a menu driven program which partitions disks using the standard Apple disk partitioning scheme described in .Dq Inside Macintosh: Devices . It does not support the Intel/DOS partitioning scheme supported by .Xr fdisk 8 .

p The options are as follows: l -tag -width Ds t Fl l List the partition map for the specified .Ar disk . t Fl r Prevents .Nm from writing to the disk. t Ar disk Specify the .Ar 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 .Sq r denoting .Dq raw device , and the partition letter, can all be omitted. For example, the first IDE disk can be specified as either

a /dev/rwd0c ,

a /dev/wd0c , or .Ar wd0 . .El .Sh COMMAND MODE The list of commands and their explanations are given below. l -tag -width "update" t Em ?\& verbose command help t Em C create a partition of the specified type t Em c create an .Ox partition t Em d delete a partition t Em f full display of the specified entry t Em h command help t Em i (re)initialize the partition map t Em n (re)name a partition t Em P show the partition map's data structures t Em p print the partition map t Em q quit editing t Em r reorder an entry in the partition map t Em s change the size of the partition map t Em t change the specified partition's type t Em w write the partition map .El

p 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 .Em i and .Em 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.

p 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 partition map as frequently as necessary.

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

p The .Em 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 .Ox .

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

p The .Em 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.

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

p The .Em 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 .Ox .

p The .Em 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.

p The .Em 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 .Nm disklabel .Fl c .Ar disk must be issued to cause the kernel to reinterpret the new label. .Sh SEE ALSO .Xr disklabel 8 , .Xr fdisk 8 , .Xr newfs 8 .Sh HISTORY The .Nm utility was originally developed for MkLinux. .Sh AUTHORS .An Eryk Vershen .Sh BUGS Some people believe there should really be just one disk partitioning utility.

p .Nm should be able to create HFS partitions that work.

p 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.

p Even more help should be available during user input.