2002-12-01 02:10:34 +00:00
|
|
|
.\" Copyright (c) 2002 Marcel Moolenaar
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\"
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2004-11-13 05:13:33 +00:00
|
|
|
.Dd November 12, 2004
|
2002-12-01 02:10:34 +00:00
|
|
|
.Os
|
|
|
|
.Dt GPT 8
|
|
|
|
.Sh NAME
|
|
|
|
.Nm gpt
|
2003-06-02 11:19:24 +00:00
|
|
|
.Nd "GUID partition table maintenance utility"
|
2002-12-01 02:10:34 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Ar general_options
|
|
|
|
.Ar command
|
|
|
|
.Op Ar command_options
|
|
|
|
.Ar device ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility provides the necessary functionality to manipulate GUID partition
|
2003-06-02 11:19:24 +00:00
|
|
|
tables (GPTs), but see
|
|
|
|
.Sx BUGS
|
|
|
|
below for how and where functionality is missing.
|
2004-08-07 06:10:45 +00:00
|
|
|
The basic usage model of the
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
tool follows that of the
|
|
|
|
.Xr cvs 1
|
|
|
|
tool.
|
|
|
|
The general options are described in the following paragraph.
|
|
|
|
The remaining paragraphs describe the individual commands with their options.
|
2003-06-02 11:19:24 +00:00
|
|
|
Here we conclude by mentioning that a
|
|
|
|
.Ar device
|
|
|
|
is either a special file
|
2002-12-01 02:10:34 +00:00
|
|
|
corresponding to a disk-like device or a regular file.
|
2003-06-02 11:19:24 +00:00
|
|
|
The command is applied to each
|
|
|
|
.Ar device
|
|
|
|
listed on the command line.
|
|
|
|
.Ss General Options
|
2002-12-01 02:10:34 +00:00
|
|
|
The general options allow the user to change default settings or otherwise
|
2003-06-02 11:19:24 +00:00
|
|
|
change the behaviour that is applicable to all commands.
|
2002-12-01 02:10:34 +00:00
|
|
|
Not all commands use all default settings, so some general options may not
|
|
|
|
have an effect on all commands.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl p Ar count
|
2003-06-02 11:19:24 +00:00
|
|
|
option allows the user to change the number of partitions the GPT can
|
2002-12-01 02:10:34 +00:00
|
|
|
accomodate.
|
|
|
|
This is used whenever a new GPT is created.
|
2003-06-02 11:19:24 +00:00
|
|
|
By default, the
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
utility will create space for 128 partitions (or 32 sectors of 512 bytes).
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl r
|
|
|
|
option causes the
|
|
|
|
.Nm
|
|
|
|
utility to open the device for reading only.
|
2003-06-02 11:19:24 +00:00
|
|
|
Currently this option is primarily useful for the
|
|
|
|
.Ic show
|
|
|
|
command, but the intent
|
2002-12-01 02:10:34 +00:00
|
|
|
is to use it to implement dry-run behaviour.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl v
|
|
|
|
option controls the verbosity level.
|
|
|
|
The level increases with every occurrence of this option.
|
|
|
|
There is no formalized definition of the different levels yet.
|
2003-06-02 11:19:24 +00:00
|
|
|
.Ss Commands
|
|
|
|
.Bl -tag -width indent
|
2002-12-01 02:10:34 +00:00
|
|
|
.\" ==== add ====
|
2003-06-02 11:19:24 +00:00
|
|
|
.It Xo
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
.Ic add
|
|
|
|
.Op Fl b Ar number
|
2004-08-07 06:10:45 +00:00
|
|
|
.Op Fl i Ar index
|
2002-12-01 02:10:34 +00:00
|
|
|
.Op Fl s Ar count
|
|
|
|
.Op Fl t Ar type
|
|
|
|
.Ar device ...
|
2003-06-02 11:19:24 +00:00
|
|
|
.Xc
|
2002-12-01 02:10:34 +00:00
|
|
|
The
|
|
|
|
.Ic add
|
|
|
|
command allows the user to add a new partition to an existing table.
|
2003-06-02 11:19:24 +00:00
|
|
|
By default, it will create a UFS partition covering the first available block
|
|
|
|
of an unused disk space.
|
2002-12-01 02:10:34 +00:00
|
|
|
The command-specific options can be used to control this behaviour.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl b Ar number
|
|
|
|
option allows the user to specify the starting (beginning) sector number of
|
|
|
|
the partition.
|
2003-06-02 11:19:24 +00:00
|
|
|
The minimum sector number is 1, but has to fall inside an unused region of
|
2002-12-01 02:10:34 +00:00
|
|
|
disk space that is covered by the GPT.
|
|
|
|
.Pp
|
|
|
|
The
|
2004-08-07 06:10:45 +00:00
|
|
|
.Fl i Ar index
|
|
|
|
option allows the user to specify which (free) entry in the GPT table is to
|
|
|
|
be used for the new partition.
|
2005-01-10 16:17:34 +00:00
|
|
|
By default, the first free entry is selected.
|
2004-08-07 06:10:45 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2002-12-01 02:10:34 +00:00
|
|
|
.Fl s Ar count
|
|
|
|
option allows the user to specify the size of the partition in sectors.
|
|
|
|
The minimum size is 1.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl t Ar type
|
|
|
|
option allows the user to specify the partition type.
|
|
|
|
The type is given as an UUID, but
|
|
|
|
.Nm
|
2004-08-07 06:10:45 +00:00
|
|
|
accepts
|
2004-07-02 18:39:15 +00:00
|
|
|
.Cm efi , swap , ufs , linux
|
2002-12-01 02:10:34 +00:00
|
|
|
and
|
2004-07-01 22:27:12 +00:00
|
|
|
.Cm windows
|
2004-08-07 06:10:45 +00:00
|
|
|
as aliases for the most commonly used partition types.
|
2002-12-01 02:10:34 +00:00
|
|
|
.\" ==== create ====
|
2003-06-02 11:19:24 +00:00
|
|
|
.It Xo
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
.Ic create
|
2004-11-13 08:01:48 +00:00
|
|
|
.Op Fl fp
|
2002-12-01 02:10:34 +00:00
|
|
|
.Ar device ...
|
2003-06-02 11:19:24 +00:00
|
|
|
.Xc
|
2002-12-01 02:10:34 +00:00
|
|
|
The
|
|
|
|
.Ic create
|
|
|
|
command allows the user to create a new (empty) GPT.
|
2005-01-10 16:17:34 +00:00
|
|
|
By default, one cannot create a GPT when the device contains a MBR,
|
2004-11-13 05:13:33 +00:00
|
|
|
however this can be overridden with the
|
|
|
|
.Fl f
|
|
|
|
option.
|
|
|
|
If the
|
|
|
|
.Fl f
|
|
|
|
option is specified, an existing MBR is destroyed and any partitions
|
|
|
|
described by the MBR are lost.
|
2002-12-01 02:10:34 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl p
|
|
|
|
option tells
|
|
|
|
.Nm
|
|
|
|
to create only the primary table and not the backup table.
|
|
|
|
This option is only useful for debugging and should not be used otherwise.
|
|
|
|
.\" ==== destroy ====
|
2003-06-02 11:19:24 +00:00
|
|
|
.It Xo
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
.Ic destroy
|
|
|
|
.Op Fl r
|
|
|
|
.Ar device ...
|
2003-06-02 11:19:24 +00:00
|
|
|
.Xc
|
2002-12-01 02:10:34 +00:00
|
|
|
The
|
|
|
|
.Ic destroy
|
|
|
|
command allows the user to destroy an existing, possibly not empty GPT.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl r
|
|
|
|
option instructs
|
|
|
|
.Nm
|
|
|
|
to destroy the table in a way that it can be recovered.
|
|
|
|
.\" ==== migrate ====
|
2003-06-02 11:19:24 +00:00
|
|
|
.It Xo
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
.Ic migrate
|
2004-11-13 08:01:48 +00:00
|
|
|
.Op Fl fs
|
2002-12-01 02:10:34 +00:00
|
|
|
.Ar device ...
|
2003-06-02 11:19:24 +00:00
|
|
|
.Xc
|
2002-12-01 02:10:34 +00:00
|
|
|
The
|
|
|
|
.Ic migrate
|
2003-06-02 11:19:24 +00:00
|
|
|
command allows the user to migrate an MBR-based disk partitioning into a
|
2002-12-01 02:10:34 +00:00
|
|
|
GPT-based partitioning.
|
2005-01-10 16:17:34 +00:00
|
|
|
By default, the MBR is not migrated when it contains partitions of an unknown
|
2004-11-13 05:44:02 +00:00
|
|
|
type.
|
|
|
|
This can be overridden with the
|
|
|
|
.Fl f
|
|
|
|
option.
|
|
|
|
Specifying the
|
|
|
|
.Fl f
|
|
|
|
option will cause unknown partitions to be ignored and any data in it
|
|
|
|
to be lost.
|
2002-12-01 02:10:34 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl s
|
2003-06-02 11:19:24 +00:00
|
|
|
option prevents migrating
|
|
|
|
.Bx
|
|
|
|
disk labels into GPT partitions by creating
|
2002-12-01 02:10:34 +00:00
|
|
|
the GPT equivalent of a slice.
|
2004-08-07 07:52:31 +00:00
|
|
|
.\" ==== remove ====
|
|
|
|
.It Xo
|
|
|
|
.Nm
|
|
|
|
.Ic remove
|
|
|
|
.Op Fl b Ar number
|
|
|
|
.Op Fl i Ar index
|
|
|
|
.Op Fl s Ar count
|
|
|
|
.Op Fl t Ar type
|
|
|
|
.Ar device ...
|
|
|
|
.Xc
|
|
|
|
The
|
|
|
|
.Ic remove
|
|
|
|
command allows the user to remove any partitions that match the selection.
|
|
|
|
BEWARE: when no options are given, all GPT partitions will match and thus
|
|
|
|
will be deleted.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl b Ar number
|
|
|
|
option selects the partitions that starts at the given number.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl i Ar index
|
|
|
|
option selects the partition with the given partition number.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl s Ar count
|
|
|
|
option selects all partitions that have the given size.
|
|
|
|
This can cause multiple partitions to be removed.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl t Ar type
|
|
|
|
option selects all partitions that have the given type.
|
|
|
|
The type is given as an UUID or by the aliases that the
|
|
|
|
.Ic add
|
|
|
|
command accepts.
|
|
|
|
This can cause multiple partitions to be removed.
|
2002-12-01 02:10:34 +00:00
|
|
|
.\" ==== show ====
|
2003-06-02 11:19:24 +00:00
|
|
|
.It Xo
|
2002-12-01 02:10:34 +00:00
|
|
|
.Nm
|
|
|
|
.Ic show
|
|
|
|
.Ar device ...
|
2003-06-02 11:19:24 +00:00
|
|
|
.Xc
|
2002-12-01 02:10:34 +00:00
|
|
|
The
|
|
|
|
.Ic show
|
|
|
|
command displays the current partitioning on the listed devices and gives
|
|
|
|
an overall view of the disk contents.
|
2003-06-02 11:19:24 +00:00
|
|
|
.El
|
2002-12-01 02:10:34 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr fdisk 8 ,
|
|
|
|
.Xr mount 8 ,
|
|
|
|
.Xr newfs 8 ,
|
|
|
|
.Xr swapon 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility appeared in
|
2003-06-02 11:19:24 +00:00
|
|
|
.Fx 5.0
|
2002-12-01 02:10:34 +00:00
|
|
|
for ia64.
|
|
|
|
.Sh BUGS
|
|
|
|
The development of the
|
|
|
|
.Nm
|
|
|
|
utility is still work in progress.
|
|
|
|
Many necessary features are missing or partially implemented.
|
|
|
|
In practice this means that the manual page, supposed to describe these
|
|
|
|
features, is farther removed from being complete or useful.
|
|
|
|
As such, missing functionality is not even documented as missing.
|
|
|
|
However, it is believed that the currently present functionality is reliable
|
|
|
|
and stable enough that this tool can be used without bullet-proof footware if
|
|
|
|
one thinks one does not make mistakes.
|
|
|
|
.Pp
|
2004-08-07 06:10:45 +00:00
|
|
|
It is expected that the basic usage model does not change, but it is
|
2002-12-01 02:10:34 +00:00
|
|
|
possible that future versions will not be compatible in the strictest sense
|
|
|
|
of the word.
|
|
|
|
For example, the
|
|
|
|
.Fl p Ar count
|
|
|
|
option may be changed to a command option rather than a generic option.
|
2003-06-02 11:19:24 +00:00
|
|
|
There are only two commands that use it so there is a chance that the natural
|
2002-12-01 02:10:34 +00:00
|
|
|
tendency for people is to use it as a command option.
|
2003-06-02 11:19:24 +00:00
|
|
|
Also, options primarily intended for diagnostic or debug purposes may be
|
2002-12-01 02:10:34 +00:00
|
|
|
removed in future versions.
|
|
|
|
.Pp
|
|
|
|
Another possibility is that the current usage model is accompanied by
|
|
|
|
other interfaces to make the tool usable as a back-end.
|
|
|
|
This all depends on demand and thus feedback.
|