xref: /openbsd/sbin/pdisk/pdisk.8 (revision 898184e3)
1.\"	$OpenBSD: pdisk.8,v 1.18 2010/08/26 17:55:10 jmc 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: August 26 2010 $
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 hilrv
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 h
43Prints a rather lame set of help messages for the
44.Nm
45program.
46.It Fl i
47Causes
48.Nm
49to go into an interactive mode similar to the Mac OS version of the program.
50.It Fl l
51List the partition tables for the specified
52.Ar disk .
53.It Fl r
54Prevents
55.Nm
56from writing to the disk.
57.It Fl v
58Prints version number of the program.
59.It Ar disk
60Specify the
61.Ar disk
62to operate on.
63It can be specified either by its full pathname or an abbreviated disk form.
64In its abbreviated form, the path to the device, the
65.Sq r
66denoting
67.Dq raw device ,
68and the partition letter, can all be omitted.
69For example, the first IDE disk can be specified as either
70.Pa /dev/rwd0c ,
71.Pa /dev/wd0c ,
72or
73.Ar wd0 .
74.El
75.Sh COMMAND MODE
76The list of commands and their explanations are given below.
77.Bl -tag -width "update"
78.It Em h
79command help
80.It Em p
81print the partition table
82.It Em P
83print ordered by base address
84.It Em i
85initialize partition map
86.It Em s
87change size of partition map
88.It Em c
89create new partition (standard
90.Ox
91type)
92.It Em C
93create with type also specified
94.It Em n
95(re)name a partition
96.It Em d
97delete a partition
98.It Em r
99reorder partition entry in map
100.It Em t
101change the type of an existing partition
102.It Em w
103write the partition table
104.It Em q
105quit editing (don't save changes)
106.El
107.Pp
108Commands which take arguments prompt for each argument in turn.
109You can also type any number of the arguments separated by spaces
110and those prompts will be skipped.
111The only exception to typeahead are the confirmation prompts on the
112.Em i
113and
114.Em w
115commands.
116The idea being that if we expect you to confirm the decision we
117shouldn't undermine that by allowing you to be precipitate about it.
118.Pp
119Partitions are always specified by their number,
120which is the index of the partition entry in the partition map.
121Most of the commands will change the index numbers of all partitions
122after the affected partition.
123You are advised to print the table as frequently as necessary.
124.Pp
125Creating more than fifteen partitions is not advised, for
126compatibility reasons.
127.Pp
128The
129.Em c
130(create new partition) command is the only one with complicated arguments.
131The first argument is the base address (in blocks) of the partition.
132Besides a raw number, you can also specify a partition number followed
133by the letter 'p' to indicate that the first block of the new partition should
134be the same as the first block of that existing free space partition.
135The second argument is the length of the partition in blocks.
136This can be a raw number or can be a partition number followed by the
137letter 'p' to use the size of that partition or can be a number followed
138by 'k', 'm', or 'g' to indicate the size in kilobytes, megabytes, or gigabytes
139respectively.
140(These are powers of 1024, of course, not powers of 1000.)
141The last argument is the name of the partition.
142This can be a single word without quotes, or a string surrounded by
143single or double quotes.
144The type of the created partition is the correct type for
145.Ox .
146.Pp
147The
148.Em C
149command is identical to the
150.Em c
151command, with the addition of a partition type argument after the
152other arguments.
153.Pp
154The
155.Em n
156(name) command allows the name of a partition to be changed.
157The name must not contain any spaces.
158Note that the various "Apple_Driver" partitions depend
159on the name field for proper functioning.
160I am not aware of any other partition types with this limitation.
161.Pp
162The
163.Em r
164(reorder) command allows the index number of partitions to be changed.
165The index numbers are constrained to be a contiguous sequence.
166.Pp
167The
168.Em t
169(change type) command allows the type of an existing partition to be changed.
170Examples of valid partition types are: Apple_Free, Apple_HFS, and
171.Ox .
172.Pp
173The
174.Em i
175(initialize) command prompts for the size of the disk.
176This was done to get around a bug in the kernel where it reports the wrong
177size for the disk.
178.Pp
179The
180.Em w
181(write) command does write the partition map out,
182but there is currently a bug in the interaction between the
183disk and the kernel where
184.Nm disklabel
185.Fl c
186.Ar disk
187must be issued to cause the kernel to reinterpret the new label.
188.Sh SEE ALSO
189.Xr disklabel 8 ,
190.Xr fdisk 8 ,
191.Xr newfs 8
192.Sh HISTORY
193The
194.Nm
195utility was originally developed for MkLinux.
196.Sh AUTHORS
197.An Eryk Vershen
198.Sh BUGS
199Some people believe there should really be just one disk partitioning utility.
200.Pp
201.Nm
202should be able to create HFS partitions that work.
203.Pp
204Filesystem volume names are out of place in a partition utility.
205This utility supports HFS volume names, but not volume names
206of any other filesystem types.
207.Pp
208Even more help should be available during user input.
209