2003-04-24 16:28:12 +04:00
|
|
|
.\" $NetBSD: pdisk.8,v 1.16 2003/04/24 12:28:12 wiz Exp $
|
2003-04-24 11:43:53 +04:00
|
|
|
.Dd April 24, 2003
|
2002-08-19 03:41:38 +04:00
|
|
|
.Os
|
|
|
|
.Dt PDISK 8
|
|
|
|
.Sh NAME
|
|
|
|
.Nm pdisk
|
|
|
|
.Nd Apple partition table editor
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2002-09-09 15:33:31 +04:00
|
|
|
.Op Fl acdfhilLrv
|
2002-09-09 15:26:29 +04:00
|
|
|
.Op Fl -abbr
|
|
|
|
.Op Fl -compute_size
|
|
|
|
.Op Fl -debug
|
2002-09-09 15:33:31 +04:00
|
|
|
.Op Fl -fname
|
2002-09-09 15:26:29 +04:00
|
|
|
.Op Fl -help
|
|
|
|
.Op Fl -interactive
|
2002-09-09 15:43:27 +04:00
|
|
|
.Op Fl -list Ar device
|
2002-09-09 15:26:29 +04:00
|
|
|
.Op Fl -logical
|
|
|
|
.Op Fl -readonly
|
|
|
|
.Op Fl -version
|
|
|
|
.Op Ar device ...
|
2002-08-19 03:41:38 +04:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2002-07-09 09:49:02 +04:00
|
|
|
is a menu driven program which partitions disks using the standard Apple
|
|
|
|
disk partitioning scheme described in "Inside Macintosh: Devices".
|
2002-08-19 03:41:38 +04:00
|
|
|
It does not support the Intel/DOS partitioning scheme supported by
|
|
|
|
.Xr fdisk 8 .
|
|
|
|
.Pp
|
|
|
|
Supported options are:
|
2002-09-09 15:33:31 +04:00
|
|
|
.Bl -tag -width "--compute_sizeXX" -compact
|
2002-08-19 03:41:38 +04:00
|
|
|
.It Fl a
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -abbr
|
2002-08-19 03:41:38 +04:00
|
|
|
Abbreviate the partition types shown in the partition list.
|
|
|
|
.It Fl c
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -compute_size
|
2002-07-09 09:49:02 +04:00
|
|
|
Causes
|
2002-08-19 03:41:38 +04:00
|
|
|
.Nm
|
|
|
|
to always ignore the device size listed in the partition table
|
|
|
|
and compute the device size by other means.
|
|
|
|
.It Fl d
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -debug
|
2003-04-24 16:28:12 +04:00
|
|
|
Turns on debugging.
|
|
|
|
Doesn't add that much output, but does add a new command
|
2002-08-19 03:41:38 +04:00
|
|
|
.Sq x
|
|
|
|
to the editing commands that accesses an eclectic bunch of
|
|
|
|
undocumented functionality.
|
2002-09-09 15:33:31 +04:00
|
|
|
.It Fl f
|
|
|
|
.It Fl -fname
|
|
|
|
Show HFS volume names instead of partition name when available.
|
2002-08-19 03:41:38 +04:00
|
|
|
.It Fl h
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -help
|
2002-08-19 03:41:38 +04:00
|
|
|
Prints a short help message.
|
|
|
|
.It Fl i
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -interactive
|
2002-08-19 03:41:38 +04:00
|
|
|
Causes
|
|
|
|
.Nm
|
2002-07-09 09:49:02 +04:00
|
|
|
to go into an interactive mode similar to the MacOS version of the program.
|
2002-08-19 03:41:38 +04:00
|
|
|
.It Fl l
|
2002-09-09 15:43:27 +04:00
|
|
|
.It Fl -list Ar device
|
2002-09-09 17:07:36 +04:00
|
|
|
.\"If no
|
|
|
|
.\".Ar device
|
|
|
|
.\"argument is given,
|
|
|
|
.\".Nm
|
|
|
|
.\"tries to list partition tables for all available hard drives.
|
|
|
|
.\"Otherwise,
|
|
|
|
.\".Nm
|
|
|
|
.\"lists
|
|
|
|
List
|
|
|
|
the partition tables for the specified
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ar devices .
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl L
|
|
|
|
.It Fl -logical
|
2003-04-24 16:28:12 +04:00
|
|
|
Show partition limits in logical blocks.
|
|
|
|
Default is physical blocks.
|
2002-08-19 03:41:38 +04:00
|
|
|
.It Fl r
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -readonly
|
2002-07-09 09:49:02 +04:00
|
|
|
Prevents
|
2002-08-19 03:41:38 +04:00
|
|
|
.Nm
|
2002-07-09 09:49:02 +04:00
|
|
|
from writing to the device.
|
2002-08-19 03:41:38 +04:00
|
|
|
.It Fl v
|
2002-09-09 15:26:29 +04:00
|
|
|
.It Fl -version
|
2002-08-19 03:41:38 +04:00
|
|
|
Prints the version number of
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm .
|
2002-08-19 03:41:38 +04:00
|
|
|
.El
|
|
|
|
.Ss Editing Partition Tables
|
2002-07-09 09:49:02 +04:00
|
|
|
An argument which is simply the name of a
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ar device
|
2002-07-09 09:49:02 +04:00
|
|
|
indicates that
|
2002-08-19 03:41:38 +04:00
|
|
|
.Nm
|
2002-07-09 09:49:02 +04:00
|
|
|
should edit the partition table of that device.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
The current top level editing commands are:
|
2002-08-19 03:41:38 +04:00
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
C (create with type also specified)
|
|
|
|
c create new partition
|
|
|
|
d delete a partition
|
2002-07-09 09:49:02 +04:00
|
|
|
h command help
|
|
|
|
i initialize partition map
|
|
|
|
n (re)name a partition
|
2002-08-19 03:41:38 +04:00
|
|
|
P (print ordered by base address)
|
|
|
|
p print the partition table
|
|
|
|
q quit editing (don't save changes)
|
2002-07-09 09:49:02 +04:00
|
|
|
r reorder partition entry in map
|
2002-08-19 03:41:38 +04:00
|
|
|
s change size of partition map
|
2003-03-03 10:35:45 +03:00
|
|
|
t change the type of an existing partition
|
2002-07-09 09:49:02 +04:00
|
|
|
w write the partition table
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
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
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic i
|
2002-07-09 09:49:02 +04:00
|
|
|
and
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic w
|
|
|
|
commands,
|
|
|
|
since if we expect you to confirm the decision, we shouldn't undermine
|
|
|
|
that by allowing you to be precipitate about it.
|
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
Partitions are always specified by their number,
|
2002-08-19 03:41:38 +04:00
|
|
|
which is the index of the partition entry in the partition map.
|
2002-07-09 09:49:02 +04:00
|
|
|
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.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
2002-09-17 11:42:55 +04:00
|
|
|
.\"Creating more than fifteen partitions is not advised.
|
2002-09-09 15:26:29 +04:00
|
|
|
.\"There may be a bug in old linux kernels which causes
|
2002-08-19 03:41:38 +04:00
|
|
|
.\"access to the whole disk fail if more than fifteen partitions are in the map.
|
2002-09-17 11:42:55 +04:00
|
|
|
.\".Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
The
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic c
|
2002-07-09 09:49:02 +04:00
|
|
|
(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
|
2002-08-19 03:41:38 +04:00
|
|
|
by the letter
|
|
|
|
.Sq 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.
|
2002-07-09 09:49:02 +04:00
|
|
|
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
|
2002-08-19 03:41:38 +04:00
|
|
|
letter
|
|
|
|
.Sq p
|
|
|
|
to use the size of that partition or can be a number followed
|
|
|
|
by
|
|
|
|
.Sq k ,
|
|
|
|
.Sq m ,
|
|
|
|
or
|
|
|
|
.Sq g
|
|
|
|
to indicate the size in kilobytes, megabytes, or gigabytes respectively.
|
2002-07-09 09:49:02 +04:00
|
|
|
(These are powers of 1024, of course, not powers of 1000.)
|
2003-04-24 07:34:34 +04:00
|
|
|
The third argument is the name of the partition.
|
2002-07-09 09:49:02 +04:00
|
|
|
This can be a single word without quotes, or a string surrounded by
|
|
|
|
single or double quotes.
|
2003-04-24 07:34:34 +04:00
|
|
|
The type of the created partition will be Apple_UNIX_SVR2, which is
|
|
|
|
the correct type for use with
|
|
|
|
.Nx .
|
|
|
|
This command will prompt for the unix filesystem slice to set
|
|
|
|
in the Block Zero Block bits.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
The
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic C
|
2002-09-17 11:42:55 +04:00
|
|
|
command is similar to the
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic c
|
2002-07-09 09:49:02 +04:00
|
|
|
command, with the addition of a partition type argument after the
|
2003-04-24 16:28:12 +04:00
|
|
|
other arguments.
|
|
|
|
Choosing a type of Apple_UNIX_SVR2 will prompt for
|
2003-04-24 07:34:34 +04:00
|
|
|
the unix filesystem slice to set in the Block Zero Block bits.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Ic i
|
|
|
|
(initalize) 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
|
2002-07-09 09:49:02 +04:00
|
|
|
The
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic n
|
2002-07-09 09:49:02 +04:00
|
|
|
(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.
|
2002-08-19 03:41:38 +04:00
|
|
|
We are not aware of any other partition types with this limitation.
|
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
The
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic r
|
2002-07-09 09:49:02 +04:00
|
|
|
(reorder) command allows the index number of partitions to be changed.
|
|
|
|
The index numbers are constrained to be a contiguous sequence.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
2002-07-09 09:49:02 +04:00
|
|
|
The
|
2003-04-24 07:34:34 +04:00
|
|
|
.Ic t
|
|
|
|
(change partition type) command allows the type of a partition to be
|
2003-04-24 16:28:12 +04:00
|
|
|
changed.
|
|
|
|
Changing the type to Apple_UNIX_SVR2 will prompt for the
|
2003-04-24 07:34:34 +04:00
|
|
|
unix filesystem slice to set in the Block Zero Block bits.
|
|
|
|
.Pp
|
|
|
|
The
|
2002-08-19 03:41:38 +04:00
|
|
|
.Ic w
|
|
|
|
(write) command writes the partition map out.
|
|
|
|
.\"but there is currently a bug in the interaction between MkLinux and Mach
|
|
|
|
.\"which causes the partition map not to be reinterpreted.
|
2002-07-09 09:49:02 +04:00
|
|
|
In order to use the new partition map you must reboot.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr fdisk 8 ,
|
|
|
|
.Xr newfs 8
|
2002-09-17 12:14:22 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility was originally developed for MkLinux.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Eryk Vershen
|
|
|
|
.Sh BUGS
|
2002-07-09 09:49:02 +04:00
|
|
|
Some people believe there should really be just one disk partitioning utility.
|
2002-08-19 03:41:38 +04:00
|
|
|
.Pp
|
2002-09-09 15:26:29 +04:00
|
|
|
.\".Nm
|
|
|
|
.\"should be able to create HFS partitions that work.
|
|
|
|
.\".Pp
|
|
|
|
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.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl -logical
|
|
|
|
option has not been heavily tested.
|
2003-04-24 10:32:42 +04:00
|
|
|
.Pp
|
|
|
|
.Nm
|
2003-04-24 16:28:12 +04:00
|
|
|
will first try to use
|
2003-04-24 10:32:42 +04:00
|
|
|
.Xr lseek 2
|
|
|
|
with
|
|
|
|
.Dv SEEK_END
|
2003-04-24 16:28:12 +04:00
|
|
|
to compute the size of the device.
|
|
|
|
If this fails, it will try a binary search using
|
2003-04-24 10:32:42 +04:00
|
|
|
.Xr lseek 2
|
|
|
|
and
|
|
|
|
.Xr read 2
|
2003-04-24 16:28:12 +04:00
|
|
|
to find the end of the device.
|
|
|
|
This has been observed to fail on some raw disk devices.
|
|
|
|
As a workaround, try using the block device instead.
|
2003-04-24 10:32:42 +04:00
|
|
|
.Nm
|
|
|
|
should probably read the disklabel using the
|
|
|
|
.Dv DIOCGDINFO
|
|
|
|
.Xr ioctl 2
|
|
|
|
to get the device size instead.
|