Mac Developer Library Developer


This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.

PDISK(8)                  BSD System Manager's Manual                 PDISK(8)

     pdisk -- Apple partition table editor

     pdisk [-acdfhilLrv] [--abbr] [--compute_size] [--debug] [--fname] [--help] [--interactive] [--list]
           [--logical] [--readonly] [--version] [device ...]

     pdisk 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 sup-ported supported
     ported by fdisk(8).

     Supported options are:
     --abbr            Abbreviate the partition types shown in the partition list.
     --compute_size    Causes pdisk to always ignore the device size listed in the partition table and com-pute compute
                       pute the device size by other means.
     --debug           Turns on debugging.  Doesn't add that much output, but does add a new command `x' to
                       the editing commands that accesses an eclectic bunch of undocumented functionality.
     --fname           Show HFS volume names instead of partition name when available.
     --help            Prints a short help message.
     --interactive     Causes pdisk to go into an interactive mode similar to the MacOS version of the pro-gram. program.
     --list            If no device argument is given, pdisk tries to list partition tables for all avail-able available
                       able drives.  Otherwise, pdisk lists the partition tables for the specified devices.
     --logical         Show partition limits in logical blocks.  Default is physical blocks.
     --readonly        Prevents pdisk from writing to the device.
     --version         Prints the version number of pdisk.

   Editing Partition Tables
     An argument which is simply the name of a device indicates that pdisk should edit the partition table
     of that device.

     The current top level editing commands are:

           C    (create with type also specified)
           c    create new partition
           d    delete a partition
           h    command help
           i    initialize partition map
           n    (re)name a partition
           P    (print ordered by base address)
           p    print the partition table
           q    quit editing (don't save changes)
           r    reorder partition entry in map
           s    change size of partition map
           t    change the type of an existing partition
           w    write the partition table

     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 i and w commands, since if we expect you to confirm the decision, we
     shouldn't undermine that by allowing you to be precipitate about it.

     Partitions are always specified by their number, which is the index of the partition entry in the par-tition partition
     tition 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.

     The 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 third 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 C command is similar to the c command, with the addition of a partition type argument after the
     other arguments.

     The i (initalize) command prompts for the size of the device.

     The n (name) command allows the name of a partition to be changed.

     The r (reorder) command allows the index number of partitions to be changed.  The index numbers are
     constrained to be a contiguous sequence.

     The t (change partition type) command allows the type of a partition to be changed.

     The w (write) command writes the partition map out.

     fdisk(8), gpt(8), newfs(8)

     The pdisk utility was originally developed for MkLinux.

     Eryk Vershen

     Some people believe there should really be just one disk partitioning utility.

     Filesystem volume names are out of place in a partition utility.  This utility supports HFS volume
     names, but not volume names of any other filesystem types.

     The --logical option has not been heavily tested.

BSD                             April 24, 2003                             BSD

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.