1 .\" $NetBSD: pdisk.8,v 1.16 2003/04/24 12:28:12 wiz Exp $
7 .Nd Apple partition table editor
17 .Op Fl -list Ar device
24 is a menu driven program which partitions disks using the standard Apple
25 disk partitioning scheme described in "Inside Macintosh: Devices".
26 It does not support the Intel/DOS partitioning scheme supported by
29 Supported options are:
30 .Bl -tag -width "--compute_sizeXX" -compact
33 Abbreviate the partition types shown in the partition list.
38 to always ignore the device size listed in the partition table
39 and compute the device size by other means.
43 Doesn't add that much output, but does add a new command
45 to the editing commands that accesses an eclectic bunch of
46 undocumented functionality.
49 Show HFS volume names instead of partition name when available.
52 Prints a short help message.
57 to go into an interactive mode similar to the MacOS version of the program.
59 .It Fl -list Ar device
64 .\"tries to list partition tables for all available hard drives.
69 the partition tables for the specified
73 Show partition limits in logical blocks.
74 Default is physical blocks.
79 from writing to the device.
82 Prints the version number of
85 .Ss Editing Partition Tables
86 An argument which is simply the name of a
90 should edit the partition table of that device.
92 The current top level editing commands are:
93 .Bd -unfilled -offset indent
94 C (create with type also specified)
95 c create new partition
98 i initialize partition map
99 n (re)name a partition
100 P (print ordered by base address)
101 p print the partition table
102 q quit editing (don't save changes)
103 r reorder partition entry in map
104 s change size of partition map
105 t change the type of an existing partition
106 w write the partition table
109 Commands which take arguments prompt for each argument in turn.
110 You can also type any number of the arguments separated by spaces
111 and those prompts will be skipped.
112 The only exception to typeahead are the confirmation prompts on the
117 since if we expect you to confirm the decision, we shouldn't undermine
118 that by allowing you to be precipitate about it.
120 Partitions are always specified by their number,
121 which is the index of the partition entry in the partition map.
122 Most of the commands will change the index numbers of all partitions
123 after the affected partition.
124 You are advised to print the table as frequently as necessary.
126 .\"Creating more than fifteen partitions is not advised.
127 .\"There may be a bug in old linux kernels which causes
128 .\"access to the whole disk fail if more than fifteen partitions are in the map.
132 (create new partition) command is the only one with complicated arguments.
133 The first argument is the base address (in blocks) of the partition.
134 Besides a raw number, you can also specify a partition number followed
137 to indicate that the first block of the new partition should be the same
138 as the first block of that existing free space partition.
139 The second argument is the length of the partition in blocks.
140 This can be a raw number or can be a partition number followed by the
143 to use the size of that partition or can be a number followed
149 to indicate the size in kilobytes, megabytes, or gigabytes respectively.
150 (These are powers of 1024, of course, not powers of 1000.)
151 The third argument is the name of the partition.
152 This can be a single word without quotes, or a string surrounded by
153 single or double quotes.
154 The type of the created partition will be Apple_UNIX_SVR2, which is
155 the correct type for use with
157 This command will prompt for the unix filesystem slice to set
158 in the Block Zero Block bits.
162 command is similar to the
164 command, with the addition of a partition type argument after the
166 Choosing a type of Apple_UNIX_SVR2 will prompt for
167 the unix filesystem slice to set in the Block Zero Block bits.
171 (initalize) command prompts for the size of the device.
172 .\"This was done to get around a bug in the kernel where it reports the wrong
173 .\"size for the device.
177 (name) command allows the name of a partition to be changed.
178 Note that the various "Apple_Driver" partitions depend
179 on the name field for proper functioning.
180 We are not aware of any other partition types with this limitation.
184 (reorder) command allows the index number of partitions to be changed.
185 The index numbers are constrained to be a contiguous sequence.
189 (change partition type) command allows the type of a partition to be
191 Changing the type to Apple_UNIX_SVR2 will prompt for the
192 unix filesystem slice to set in the Block Zero Block bits.
196 (write) command writes the partition map out.
197 .\"but there is currently a bug in the interaction between MkLinux and Mach
198 .\"which causes the partition map not to be reinterpreted.
199 In order to use the new partition map you must reboot.
206 utility was originally developed for MkLinux.
210 Some people believe there should really be just one disk partitioning utility.
213 .\"should be able to create HFS partitions that work.
215 Filesystem volume names are out of place in a partition utility.
216 This utility supports HFS volume names, but not volume names
217 of any other filesystem types.
221 option has not been heavily tested.
224 will first try to use
228 to compute the size of the device.
229 If this fails, it will try a binary search using
233 to find the end of the device.
234 This has been observed to fail on some raw disk devices.
235 As a workaround, try using the block device instead.
237 should probably read the disklabel using the
240 to get the device size instead.