summaryrefslogtreecommitdiff
path: root/sbin/pdisk/pdisk.8
blob: 2000a9cad274860efb86d72ec49ce7b878cbd5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
.\"	$OpenBSD: pdisk.8,v 1.12 2005/04/25 01:32:16 martin 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 September 26, 1997
.Dt PDISK 8
.Os
.Sh NAME
.Nm pdisk
.Nd HFS(DPME) partition maintenance program
.Sh SYNOPSIS
.Nm pdisk
.Op Fl c
.Op Fl h
.Op Fl i
.Op Fl l
.Op Fl r
.Op Fl v
.Ar device
.Sh DESCRIPTION
.Nm
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
.Em fdisk .
The
.Ar device
is usually one of the following:
.Pp
.Pa /dev/sd0c
.Pa /dev/sd1c
.Pa /dev/sd2c
.Pa /dev/sd3c
.Pa /dev/sd4c
.Pa /dev/sd5c
.Pa /dev/sd6c
.Pa /dev/wd0c
.Pa /dev/wd1c
.Pa /dev/wd2c
.Pa /dev/wd3c
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c
Causes
.Nm
to always ignore the device size listed in the partition table
and compute the device size by other means.
.It Fl h
Prints a rather lame set of help messages for the
.Nm
program.
.It Fl i
Causes
.Nm
to go into an interactive mode similar to the Mac OS version of the program.
.It Fl l
List the partition tables for the specified
.Ar devices .
.It Fl r
Prevents
.Nm
from writing to the device.
.It Fl v
Prints version number of the program.
.El
.Pp
An argument which is simply the name of a
.Ar device
indicates that
.Nm
should edit the partition table of that device.
.Sh COMMAND MODE
The list of commands and their explanations are given below.
.Bl -tag -width "update"
.It Em h
command help
.It Em p
print the partition table
.It Em P
print ordered by base address
.It Em i
initialize partition map
.It Em s
change size of partition map
.It Em c
create new partition (standard
.Ox
type)
.It Em C
create with type also specified
.It Em n
(re)name a partition
.It Em d
delete a partition
.It Em r
reorder partition entry in map
.It Em t
change the type of an existing partition
.It Em w
write the partition table
.It Em q
quit editing (don't save changes)
.El
.Pp
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.
.Pp
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.
.Pp
Creating more than fifteen partitions is not advised, for
compatibility reasons.
.Pp
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 .
.Pp
The
.Em C
command is identical to the
.Em c
command, with the addition of a partition type argument after the
other arguments.
.Pp
The
.Em n
(name) command allows the name of a partition to be changed.
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.
.Pp
The
.Em r
(reorder) command allows the index number of partitions to be changed.
The index numbers are constrained to be a contiguous sequence.
.Pp
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 .
.Pp
The
.Em i
(initialize) command prompts for the size of the device.
This was done to get around a bug in the kernel where it reports the wrong
size for the device.
.Pp
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 device
must be issued to cause the kernel to reinterpret the new label.
.Sh SEE ALSO
.Xr disklabel 8 ,
.Xr fdisk 8
.Sh AUTHORS
.An Eryk Vershen Aq eryk@apple.com .
.Sh BUGS
Some people believe there should really be just one disk partitioning utility.
.Pp
.Nm
should be able to create HFS partitions that work.
.Pp
Even more help should be available during user input.