xref: /openbsd/sbin/pdisk/pdisk.8 (revision d415bd75)
1.\"	$OpenBSD: pdisk.8,v 1.31 2016/02/23 03:34:17 krw Exp $
2.\"
3.\" Copyright 1996,1997,1998 by Apple Computer, Inc.
4.\"              All Rights Reserved
5.\"
6.\" Permission to use, copy, modify, and distribute this software and
7.\" its documentation for any purpose and without fee is hereby granted,
8.\" provided that the above copyright notice appears in all copies and
9.\" that both the copyright notice and this permission notice appear in
10.\" supporting documentation.
11.\"
12.\" APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
13.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14.\" FOR A PARTICULAR PURPOSE.
15.\"
16.\" IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
17.\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
19.\" NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
20.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21.\"
22.Dd $Mdocdate: February 23 2016 $
23.Dt PDISK 8
24.Os
25.Sh NAME
26.Nm pdisk
27.Nd HFS(DPME) partition maintenance program
28.Sh SYNOPSIS
29.Nm pdisk
30.Op Fl lr
31.Ar disk
32.Sh DESCRIPTION
33.Nm
34is a menu driven program which partitions disks using the standard Apple
35disk partitioning scheme described in
36.Dq Inside Macintosh: Devices .
37It does not support the Intel/DOS partitioning scheme supported by
38.Xr fdisk 8 .
39.Pp
40The options are as follows:
41.Bl -tag -width Ds
42.It Fl l
43List the partition map for the specified
44.Ar disk .
45.It Fl r
46Prevents
47.Nm
48from writing to the disk.
49.It Ar disk
50Specify the
51.Ar disk
52to operate on.
53It can be specified either by its full pathname or an abbreviated disk form.
54In its abbreviated form, the path to the device and the
55.Sq r
56denoting
57.Dq raw device
58are omitted, with the partition letter being optional.
59For example, the first IDE disk can be specified as either
60.Pa /dev/rwd0c ,
61.Pa wd0c ,
62or
63.Pa wd0 .
64.El
65.Sh COMMAND MODE
66The list of commands and their explanations are given below.
67.Bl -tag -width "update"
68.It Em ?\&
69verbose command help
70.It Em C
71create a partition of a specified type
72.It Em c
73create an
74.Ox
75partition
76.It Em d
77delete a partition
78.It Em f
79full display of a partition
80.It Em h
81command help
82.It Em i
83(re)initialize the partition map
84.It Em n
85(re)name a partition
86.It Em P
87show the partition map's data structures
88.It Em p
89print the partition map
90.It Em q
91quit editing
92.It Em r
93reorder (swap) disk positions of two entries in the partition map
94.It Em s
95change the size of the partition map
96.It Em t
97change the type of a partition
98.It Em w
99write the partition map to disk
100.El
101.Pp
102Commands which take arguments prompt for each argument not specified
103in the original command.
104You can type any number of the arguments separated by spaces.
105.Pp
106Partitions are always specified by their number,
107which is the index of the partition entry in the partition map.
108.Pp
109The index numbers of partitions will change if partitions are created,
110deleted or reordered.
111.Pp
112Creating more than fifteen partitions is not advised, for
113compatibility reasons.
114.Pp
115The
116.Em c
117(create an
118.Ox
119partition) and
120.Em C
121(create a partition of a specified type)
122commands are the only ones with complicated arguments.
123.Pp
124The first argument is the base address (in blocks) of the partition.
125Besides a raw number, you can also specify a partition number followed
126by the letter 'p' to indicate that the first block of the new partition should
127be the same as the first block of that existing free space partition.
128.Pp
129The second argument is the length of the partition in blocks.
130This can be a raw number or can be a partition number followed by the
131letter 'p' to use the size of that partition or can be a number followed
132by 'k', 'm', 'g', or 't' to indicate the size in kilobytes, megabytes,
133gigabytes or terabytes respectively.
134(These are powers of 1024, of course, not powers of 1000.)
135.Pp
136The third argument is the name of the partition.
137This can be a single word without quotes, or a string surrounded by
138single or double quotes.
139.Pp
140For the
141.Em C
142command only, the fourth argument is the partition type.
143This can be a single word without quotes, or a string surrounded by
144single or double quotes.
145The
146.Em c
147command automatically uses the type
148.Ox .
149.Pp
150The
151.Em n
152(name) command allows the name of a partition to be changed.
153Note that the various "Apple_Driver" partitions depend
154on the name field for proper functioning.
155.Sh SEE ALSO
156.Xr disklabel 8 ,
157.Xr fdisk 8 ,
158.Xr newfs 8
159.Sh HISTORY
160The
161.Nm
162was originally developed for MkLinux.
163.Pp
164It was ported to
165.Ox
1662.9 by Dale Rahn.
167.Sh AUTHORS
168.An Eryk Vershen
169