pdisk.8 revision 1.9
1.Dd September 26, 1997
2.Dt PDISK 8 macppc
3.Os
4.Sh NAME
5.Nm pdisk
6.Nd HFS(DPME) partition maintenance program
7.Sh SYNOPSIS
8.Nm pdisk
9.Op Fl c
10.Op Fl h
11.Op Fl i
12.Op Fl l
13.Op Fl r
14.Op Fl v
15.Ar device
16.Sh DESCRIPTION
17.Nm
18is a menu driven program which partitions disks using the standard Apple
19disk partitioning scheme described in "Inside Macintosh: Devices".
20It does not support the intel/dos partitioning scheme supported by
21.Em fdisk .
22The
23.Ar device
24is usually one of the following:
25.Pp
26.Pa /dev/sd0c
27.Pa /dev/sd1c
28.Pa /dev/sd2c
29.Pa /dev/sd3c
30.Pa /dev/sd4c
31.Pa /dev/sd5c
32.Pa /dev/sd6c
33.Pa /dev/wd0c
34.Pa /dev/wd1c
35.Pa /dev/wd2c
36.Pa /dev/wd3c
37.Pp
38The options are as follows:
39.Bl -tag -width Ds
40.It Fl c
41Causes
42.Nm
43to always ignore the device size listed in the partition table
44and compute the device size by other means.
45.It Fl h
46Prints a rather lame set of help messages for the
47.Nm
48program.
49.It Fl i
50Causes
51.Nm
52to go into an interactive mode similar to the MacOS version of the program.
53.It Fl l
54List the partition tables for the specified
55.Ar devices .
56.It Fl r
57Prevents
58.Nm
59from writing to the device.
60.It Fl v
61Prints version number of the program.
62.El
63.Pp
64An argument which is simply the name of a
65.Ar device
66indicates that
67.Nm
68should edit the partition table of that device.
69.Sh COMMAND MODE
70The list of commands and their explanations are given below.
71.Bl -tag -width "update"
72.It Em h
73command help
74.It Em p
75print the partition table
76.It Em P
77print ordered by base address
78.It Em i
79initialize partition map
80.It Em s
81change size of partition map
82.It Em c
83create new partition (standard
84.Ox
85type)
86.It Em C
87create with type also specified
88.It Em n
89(re)name a partition
90.It Em d
91delete a partition
92.It Em r
93reorder partition entry in map
94.It Em t
95change the type of an existing partition
96.It Em w
97write the partition table
98.It Em q
99quit editing (don't save changes)
100.El
101.Pp
102Commands which take arguments prompt for each argument in turn.
103You can also type any number of the arguments separated by spaces
104and those prompts will be skipped.
105The only exception to typeahead are the confirmation prompts on the
106.Em i
107and
108.Em w
109commands.
110The idea being that if we expect you to confirm the decision we
111shouldn't undermine that by allowing you to be precipitate about it.
112.Pp
113Partitions are always specified by their number,
114which is the index of the partition entry in the partition map.
115Most of the commands will change the index numbers of all partitions
116after the affected partition.
117You are advised to print the table as frequently as necessary.
118.Pp
119Creating more than fifteen partitions is not advised, for
120compatibility reasons.
121.Pp
122The
123.Em c
124(create new partition) command is the only one with complicated arguments.
125The first argument is the base address (in blocks) of the partition.
126Besides a raw number, you can also specify a partition number followed
127by the letter 'p' to indicate that the first block of the new partition should
128be the same as the first block of that existing free  space partition.
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', or 'g' to indicate the size in kilobytes, megabytes, or gigabytes
133respectively.
134(These are powers of 1024, of course, not powers of 1000.)
135The last argument is the name of the partition.
136This can be a single word without quotes, or a string surrounded by
137single or double quotes.
138The type of the created partition is the correct type for OpenBSD.
139.Pp
140The
141.Em C
142command is identical to the
143.Em c
144command, with the addition of a partition type argument after the
145other arguments.
146.Pp
147The
148.Em n
149(name) command allows the name of a partition to be changed.
150Note that the various "Apple_Driver" partitions depend
151on the name field for proper functioning.
152I am not aware of any other partition types with this limitation.
153.Pp
154The
155.Em r
156(reorder) command allows the index number of partitions to be changed.
157The index numbers are constrained to be a contiguous sequence.
158.Pp
159The
160.Em t
161(change type) command allows the type of an existing partition to be changed.
162Examples of valid partition types are: Apple_Free, Apple_HFS, and OpenBSD.
163.Pp
164The
165.Em i
166(initialize) command prompts for the size of the device.
167This was done to get around a bug in the kernel where it reports the wrong
168size for the device.
169.Pp
170The
171.Em w
172(write) command does write the partition map out,
173but there is currently a bug in the interaction between the
174disk and the kernel where
175.Nm disklabel
176.Fl c
177.Ar device
178must be issued to cause the kernel to reinterpret the new label.
179.Sh BUGS
180Some people believe there should really be just one disk partitioning utility.
181.Pp
182.Nm
183should be able to create HFS partitions that work.
184.Pp
185Even more help should be available during user input.
186.Sh SEE ALSO
187.Xr disklabel 8 ,
188.Xr fdisk 8
189.Sh AUTHORS
190.An Eryk Vershen Aq eryk@apple.com .
191