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